Skip to content

ucode: exec the real binary for non-interactive subcommands (codex app-server, --version/--help)#184

Open
Edwinhe03 wants to merge 1 commit into
databricks:mainfrom
Edwinhe03:edwin-he/ucode-composable-flag-injection
Open

ucode: exec the real binary for non-interactive subcommands (codex app-server, --version/--help)#184
Edwinhe03 wants to merge 1 commit into
databricks:mainfrom
Edwinhe03:edwin-he/ucode-composable-flag-injection

Conversation

@Edwinhe03

@Edwinhe03 Edwinhe03 commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator

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-server is a server subcommand the caller configures (e.g. omnigent supplies a private CODEX_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 --profile ucode injected.
  • <agent> --version / --help are 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's PASSTHROUGH_SUBCOMMANDS; codex → app-server), ucode execs the real binary directly — no ucode flags, no init. Extensible: add a flag to _PASSTHROUGH_GLOBAL_FLAGS, or a PASSTHROUGH_SUBCOMMANDS set + subcommand() to an agent module.

The claude --settings merge that was previously bundled in this PR is now handled by #189, so this PR is scoped to the codex/non-interactive passthrough.

Verification

  • Full test suite green; added passthrough tests (info flags for any tool, app-server incl. behind a leading global, exec/interactive negatives, and that passthrough execs the real binary with no injected flags).
  • Live on a staging managed sandbox: codex app-server through the wrapper bound in 1s (was 7s — past omnigent's 10s readiness budget); codex --version returned codex-cli 0.137.0 in 0.2s, cleanly (was ~6s plus ucode's banner).

This pull request and its description were written by Isaac.

@Edwinhe03 Edwinhe03 marked this pull request as ready for review July 6, 2026 22:29
@rohita5l rohita5l requested a review from lilly-luo July 7, 2026 13:19
@Edwinhe03 Edwinhe03 changed the title ucode: compose injected flags with the caller's command (claude --settings, codex --profile) ucode: compose claude --settings; passthrough non-interactive subcommands (codex app-server, --version/--help) Jul 7, 2026
@Edwinhe03 Edwinhe03 force-pushed the edwin-he/ucode-composable-flag-injection branch from c577f42 to bcff2ab Compare July 7, 2026 22:31
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
@Edwinhe03 Edwinhe03 changed the title ucode: compose claude --settings; passthrough non-interactive subcommands (codex app-server, --version/--help) ucode: exec the real binary for non-interactive subcommands (codex app-server, --version/--help) Jul 7, 2026
@Edwinhe03 Edwinhe03 force-pushed the edwin-he/ucode-composable-flag-injection branch from bcff2ab to 7d540fb Compare July 7, 2026 22:56
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