ucode: exec the real binary for non-interactive subcommands (codex app-server, --version/--help)#184
Open
Edwinhe03 wants to merge 1 commit into
Conversation
c577f42 to
bcff2ab
Compare
ucode's launch runs full session init on every invocation — auth validation,
per-launch model discovery, config write — before exec'ing the agent. For
non-interactive invocations that need none of it, this only adds latency and
can corrupt output:
- `codex app-server` is a server subcommand the *caller* configures (e.g.
omnigent supplies a private CODEX_HOME + its own provider config); ucode's
init adds several seconds and delays the socket bind past the caller's
readiness budget, so the app-server times out. It also rejects the global
`--profile` ucode injects.
- `<agent> --version` / `--help` are info commands; init delays them, and
ucode's own banner/version can be parsed by a caller instead of the agent's.
Add a passthrough: for a universal info flag (--version/-V/--help/-h) or a
tool-declared non-interactive subcommand (an agent module's
PASSTHROUGH_SUBCOMMANDS; codex -> app-server), exec the real binary directly
with no ucode flags or init. Extensible: add a flag to _PASSTHROUGH_GLOBAL_FLAGS,
or a PASSTHROUGH_SUBCOMMANDS set + subcommand() to an agent module.
This supersedes the earlier codex --profile-skip for app-server — the
passthrough runs before launch(), so ucode never adds --profile there — so
launch() goes back to always attaching --profile for the runtime subcommands
that accept it.
Co-authored-by: Isaac
bcff2ab to
7d540fb
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
ucode's launch runs full session init on every invocation — auth validation, per-launch model discovery, config write — before exec'ing the agent. For non-interactive invocations that need none of it, this only adds latency and can corrupt output:
codex app-serveris a server subcommand the caller configures (e.g. omnigent supplies a privateCODEX_HOME+ its own provider config). ucode's init added several seconds and delayed the socket bind past the caller's readiness budget → the app-server timed out. It also rejects the global--profileucode injected.<agent> --version/--helpare info commands; init delayed them, and ucode's own banner/version could be parsed by a caller instead of the agent's.Now: for a universal info flag (
--version/-V/--help/-h) or a tool-declared non-interactive subcommand (an agent module'sPASSTHROUGH_SUBCOMMANDS; codex →app-server), ucode execs the real binary directly — no ucode flags, no init. Extensible: add a flag to_PASSTHROUGH_GLOBAL_FLAGS, or aPASSTHROUGH_SUBCOMMANDSset +subcommand()to an agent module.Verification
app-serverincl. behind a leading global, exec/interactive negatives, and that passthrough execs the real binary with no injected flags).codex app-serverthrough the wrapper bound in 1s (was 7s — past omnigent's 10s readiness budget);codex --versionreturnedcodex-cli 0.137.0in 0.2s, cleanly (was ~6s plus ucode's banner).This pull request and its description were written by Isaac.