Skip to content

fix: silence successful daemon diagnostics and simplify switch warnings - #205

Merged
Loongphy merged 1 commit into
mainfrom
fix/simplify-switch-daemon-diagnostics
Dec 2, 2026
Merged

Loongphy merged 1 commit into
mainfrom
fix/simplify-switch-daemon-diagnostics

Conversation

@Loongphy

@Loongphy Loongphy commented Dec 2, 2026

Copy link
Copy Markdown
Owner

Summary

v0.4.0 enabled automatic daemon coordination on every switch, which caused redundant stderr lines (Account files switched successfully; ...) even when the switch completed cleanly. Since Switched to <account> on stdout already confirms the switch and codex app-server daemon restart stops the old daemon, starts a fresh one, and waits until it is ready, successful coordination needs no extra stderr chatter.

  • Silence .reloaded and .restarted in printCodexDaemonDiagnostic / writeCodexDaemonDiagnosticTo alongside .not_running.
  • Remove the redundant "Account files switched successfully; " prefix and the multi-line CODEX_HOME=... / version + restart dump (along with the now-unused writeDaemonCommandTo and writeShellArgumentTo helpers and unused home/executable parameters).
  • Replace remaining unapplied and failure diagnostics with concise single-line stderr messages:
    • .deferred: Codex daemon reload deferred while a turn is running. Run `codex app-server daemon restart` to apply now.
    • .running: Codex daemon is still using the previous credentials; run `codex app-server daemon restart` to apply.
    • .unknown: Could not confirm Codex daemon status.
    • .reload_failed: Codex daemon auth reload failed.
    • .restart_failed: Codex daemon restart failed.
    • .timed_out: Codex daemon restart timed out after 120 seconds.
    • .unsupported: Automatic Codex daemon coordination is unsupported on this platform.
  • Keep --json ("daemon": "...") and --live status reporting unchanged.
  • Update docs/commands/switch.md, tests/cli_behavior_test.zig, and tests/cli_integration_test.zig.

Test plan

  • zig build clean with zero warnings.
  • zig build test test-helpers full suite green (including unit tests in tests/cli_behavior_test.zig and integration tests in tests/cli_integration_test.zig).
  • ReleaseSafe E2E (zig build -Doptimize=ReleaseSafe) against an isolated HOME/CODEX_HOME fixture covering .reloaded, .restarted, .deferred, and .restart_failed.

@greptile-apps

greptile-apps Bot commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5RetriggerView in Greptile

[Medium impact] The PR appears safe to merge.

Summary

Makes successful daemon coordination silent and shortens switch warnings.

  • One-shot switches stay quiet when daemon coordination succeeds.

No actionable findings were identified.

Reviews (1) · Last reviewed commit: "fix: silence successful daemon diagnosti..." · Reviewed by Greptile

@pkg-pr-new

pkg-pr-new Bot commented Dec 2, 2026

Copy link
Copy Markdown

Open in StackBlitz

@loongphy/codex-auth-darwin-arm64

npx https://pkg.pr.new/@loongphy/codex-auth-darwin-arm64@fee3993

@loongphy/codex-auth-darwin-x64

npx https://pkg.pr.new/@loongphy/codex-auth-darwin-x64@fee3993

@loongphy/codex-auth-linux-arm64

npx https://pkg.pr.new/@loongphy/codex-auth-linux-arm64@fee3993

@loongphy/codex-auth-linux-x64

npx https://pkg.pr.new/@loongphy/codex-auth-linux-x64@fee3993

@loongphy/codex-auth-win32-arm64

npx https://pkg.pr.new/@loongphy/codex-auth-win32-arm64@fee3993

@loongphy/codex-auth-win32-x64

npx https://pkg.pr.new/@loongphy/codex-auth-win32-x64@fee3993

@loongphy/codex-auth

npx https://pkg.pr.new/@loongphy/codex-auth@fee3993

commit: fee3993

@Loongphy
Loongphy merged commit 34cdb0b into main Dec 2, 2026
14 checks passed
@Loongphy
Loongphy deleted the fix/simplify-switch-daemon-diagnostics branch December 2, 2026 15:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant