feat(app-server): expose CODEX_COMPANION_APP_SERVER_DISABLE_BROKER env var - #691
feat(app-server): expose CODEX_COMPANION_APP_SERVER_DISABLE_BROKER env var#691tyoon10 wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a42211a662
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
|
||
| export class CodexAppServerClient { | ||
| static async connect(cwd, options = {}) { | ||
| const disableBroker = resolveDisableBroker(options); |
There was a problem hiding this comment.
Honor the disable flag in runtime status
When this environment variable is enabled while either CODEX_COMPANION_APP_SERVER_ENDPOINT or a saved broker session exists, connect() correctly chooses the direct transport, but getSessionRuntimeStatus() in plugins/codex/scripts/lib/codex.mjs:906-914 still reports a “shared session” because it only checks for an endpoint. Consequently, /codex:status and setup output claim jobs are reusing the broker even though every connection bypasses it; apply the same disable-value resolution when determining the displayed runtime mode.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Applied: getSessionRuntimeStatus() now calls resolveDisableBroker() so /codex:status reports direct mode whenever CODEX_COMPANION_APP_SERVER_DISABLE_BROKER is set, even if a broker endpoint or saved session exists. Added tests/codex.test.mjs covering disable-wins-over-endpoint and the default cases.
a42211a to
e297aae
Compare
…etSessionRuntimeStatus
Closes #602.
Summary
CodexAppServerClient.connect()already acceptsoptions.disableBroker, but there is no supported way for an integrator to request direct app-server spawn from the environment. This addsCODEX_COMPANION_APP_SERVER_DISABLE_BROKER. When set totrue,1, oryes, the client skips broker discovery and spawnscodex app-serverdirectly, giving the caller strict per-job process lifetime without the malformed-endpoint workaround.Pseudo-diff:
options.disableBrokerremains the explicit override. The existingCODEX_COMPANION_APP_SERVER_ENDPOINTbehavior is unchanged. New unit tests intests/app-server.test.mjscovertrue,1, and an explicit option override.