Skip to content

fix(codex): start safely with Windows CUA disabled - #50

Merged
EvilWeasel merged 4 commits into
mainfrom
fix/cua-disabled-transport-20261021
Oct 21, 2026
Merged

EvilWeasel merged 4 commits into
mainfrom
fix/cua-disabled-transport-20261021

Conversation

@EvilWeasel

@EvilWeasel EvilWeasel commented Oct 21, 2026 •

Copy link
Copy Markdown
Collaborator

Codex failed before starting an ordinary agent turn when Windows CUA was off: the managed MCP entry contained enabled: false without a transport. Supply a valid disabled stdio descriptor and replace previous routing. When the CUA generation changes, unsubscribe the loaded native thread before resuming it, because resume alone retains its MCP connections. Other provider, driver, application, lockfile and Android paths are unchanged.

Validation: focused configuration, disabled-control and adapter checks; actual Codex 0.162 on Linux and installed 0.163.0-alpha.10.2 on Windows reproduced the old failure and accepted disabled start/resume. A harmless isolated stdio fixture changed from connected to disabled after unsubscribe/resume; its explicitly marked saved-history fixture did not request a model turn. Scoped type-aware/type-check lint passed with existing warnings, plus formatting and diff checks. The failed .62 rollout was stopped and the Windows canary restored to .61 with one completed shell-action agent check.

This PR is source-only. No production build, packaging, publication or further fleet installation is authorized by it.

Model: GPT-6.1-Sol, high reasoning/default tier. Harness: Codex in T3 Code.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-21T07:13:04.625645Z d9286c6 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:S labels Oct 21, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8b80457ed9

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@EvilWeasel

Copy link
Copy Markdown
Collaborator Author

The failed check on 8b80457 reported three TS377057 diagnostics in the new parser test: direct Node child_process, fs and path imports. The test now uses the existing Effect FileSystem/Path services and ProcessRunner with NodeServices and the standard it.effect test scope; no diagnostic suppression and no production changes.

The four focused configuration/parser cases passed with the actual Codex binary after the port, along with scoped type-aware/type-check lint, formatting and diff checks. The previously recorded Windows parser/resume and .61 restoration evidence remains unchanged. Normal exact-head CI will verify this follow-up; production build/publication and the remaining device rollout are still held.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6db5b2d71f

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

if ((cuaGenerations.get(turnInput.threadId) ?? null) !== generation) {
// Resume reuses a loaded thread's MCP connections. Unload it first
// so a revoked attachment cannot survive the configuration change.
yield* client.request("thread/unsubscribe", { threadId });

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Wait for actual unload before resuming CUA

When a loaded thread’s CUA generation changes under the normal nonzero unload delay, thread/unsubscribe removes only this connection’s subscription; it does not unload the thread, and the immediately following thread/resume re-subscribes and cancels the pending unload. Codex’s own unsubscribe test verifies that the thread remains loaded and can be resumed immediately. Since a loaded-thread resume retains its existing MCP connections, the replacement config is never applied and a revoked CUA attachment remains agent-accessible; wait for thread/closed/notLoaded or otherwise force immediate unload before resuming.

AGENTS.md reference: AGENTS.md:L74-L74

Useful? React with 👍 / 👎.

// Resume reuses a loaded thread's MCP connections. Unload it first
// so a revoked attachment cannot survive the configuration change.
yield* client.request("thread/unsubscribe", { threadId });
observatoryRegisteredThreads.delete(threadId);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve observatory qualification across the CUA rebind

When an observatory-enabled thread changes CUA generation, deleting this entry disables observatory for every subsequent turn even though the native tool remains available: Codex persists dynamic tools in thread history and restores them on resume. buildCodexTurnStartParams then omits the observatory instructions and routeObservatoryInvocation rejects every native call because the set no longer contains the thread, while the entry is never re-added except during a new thread/start; preserve the known same-session registration or explicitly re-establish it.

Useful? React with 👍 / 👎.

@github-actions github-actions Bot added size:M and removed size:S labels Oct 21, 2026
@EvilWeasel
EvilWeasel merged commit 8fbca0b into main Oct 21, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant