Skip to content

codex-local 12/12: run TUI in-process (no app-server daemon) - #17

Closed
ehrvs wants to merge 4 commits into
pr/11-websearchfrom
pr/12-nodaemon
Closed

ehrvs wants to merge 4 commits into
pr/11-websearchfrom
pr/12-nodaemon

Conversation

@ehrvs

@ehrvs ehrvs commented Oct 15, 2026

Copy link
Copy Markdown
Collaborator

Root cause: upstream 0.162.1 enables features.daemon_auto_start by default, so an eligible local TUI launch discovers/starts the app-server daemon. Bootstrapping it needs a complete package (codex-package.json, bin/codex, helpers) next to the executable; codex-local distributes a bare binary, so a fresh home fails with "no complete local package". (--ollama-url and the retry overrides happened to exclude the daemon, which hid it.)

Why a daemon is wrong for codex-local: its model/resume registrations live in-process; a daemon-hosted server would not have them.

Fix (0 upstream lines; fork surface stays 122 lines):

  • A pure inject_no_daemon helper runs before cli_main: it classifies argv with upstream's own MultitoolCli::try_parse_from and inserts --no-daemon after argv[0] only for plain TUI, resume, fork, with no --remote (root or subcommand) and no existing --no-daemon. Parse failures (help/errors), exec, review, app-server and everything else pass through unchanged.
  • -c features.daemon_auto_start=false on every run, and seeded [features] daemon_auto_start = false.

Stock is unaffected: separate homes and sockets; codex-local never discovers, starts or stops stock's daemon. Verified stock daemon PIDs and socket inode unchanged.

Tests: table-driven injection test (TUI, prompt, resume id/--last, fork, existing flag, --remote at both scopes, exec, app-server (+daemon), --help, invalid arg, -- exec); override and seed tests. Live: TUI and resume --last from a temp non-repo dir under a pty with no package error and no daemon artifacts; exec against Ollama works.

🤖 Generated with Claude Code

https://claude.ai/code/session_01RPCzgwU247gMtjybR5v4iR

ehrvs and others added 4 commits October 15, 2026 10:41
Upstream auto-starts/discovers an app-server daemon for the TUI, which needs a
full codex-package.json package; codex-local ships a bare binary, so a fresh
home failed with "no complete local package". Inject --no-daemon for plain TUI,
resume and fork (unless --remote), add -c features.daemon_auto_start=false, and
seed it off.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RPCzgwU247gMtjybR5v4iR
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RPCzgwU247gMtjybR5v4iR
Upstream restores provider/model from the rollout on resume unless a CLI
layer sets them, so a resumed stock session would call OpenAI. Always
inject model_provider and model (flag > CODEX_LOCAL_MODEL > config).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RPCzgwU247gMtjybR5v4iR
The codex-local bin include!s upstream cli/main.rs, so testing the whole
package also runs upstream's cli tests, whose snapshots assume the binary
is named codex and fail here.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RPCzgwU247gMtjybR5v4iR
@ehrvs

ehrvs commented Oct 16, 2026

Copy link
Copy Markdown
Collaborator Author

Superseded: merged into codex-local/main via the integration PR #21 (3908b3d).

@ehrvs ehrvs closed this Oct 16, 2026
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