← Назад к задаче

FACTORY-HEALTH-20261106.md

Factory health authentication acceptance — 2026-11-06

Implemented within console/healthcheck.py, console/health_monitor.py and the requested tests/documentation. The existing server-native ai-factory-health-monitor.timer remains hourly and unchanged. No ChatGPT automation, service restart, deployment, configuration changes, token changes, repair, fallback or provider generation was performed.

Probe semantics

Existing infrastructure service and tool checks remain in place. Provider connectivity checks were not added. No model requests, including free-model requests, are issued.

Persistence and display

Each monitor run writes actual probe results to health_checks. The console snapshot reads those results directly and no longer queries executions or replaces probe failures with earlier successful tasks. Results older than two hours retain their observed status and acquire a STALE annotation rather than concealing a failure. Timestamps remain visible.

Status changes are recorded transactionally in health_transitions with category, component, previous/current status and check time, including transitions to unavailable. The existing 12,000-row health_checks retention remains; transitions are retained separately. The additional table is created by the next normal monitor run. No production database was modified during verification.

Executed verification

Command:

.venv/bin/python -m unittest discover -s tests -p test_factory_health_auth.py

Result: 8 tests ran, OK (2026-11-06). Tests use temporary SQLite databases and mocked CLI, credential and network responses. Coverage includes simulated expired Claude OAuth after prior successful execution; persisted failure visibility; transition recording; the real Claude auth_status wrapper with mocked subprocess failure; Codex stdout/stderr status parsing and output suppression; timeout uncertainty; Gemini non-execution; local provider credential checks; disabled profiles/aliases; and stale failure display without an executions table.

Only codex login --help was run to confirm the installed status subcommand; no live login or model probe was run. No assertion is made that current production credentials are valid, or that any authenticated executor can complete a model request. The monitor can report expiry when the CLI auth-status check reports it; locally accepted credentials can still be rejected remotely. Operator review is required before any deployment or service restart; neither was attempted. Factory's existing timer continues to own independent scheduled checks.

Материалы