Skip to content

Fix remaining Codex bridge wait, selection, queue, and plugin commands - #118

Merged
ScriptedAlchemy merged 2 commits into
mainfrom
fix/gbot-codex-bridge-leftovers
Sep 29, 2026
Merged

ScriptedAlchemy merged 2 commits into
mainfrom
fix/gbot-codex-bridge-leftovers

Conversation

@ScriptedAlchemy

Copy link
Copy Markdown
Owner

Codex bridge fixes

  1. Long waits: codex_wait/gbot codex wait no longer treat a bounded notification buffer overflow as lost execution. They reconcile terminal state and final items from history and accept caller timeouts up to two hours. Added a notification-flood regression and long-timeout test.
  2. Model, effort, and new threads: codex send/codex_send accept validated model and effort overrides through stable 0.158.0 thread/resume and turn/start fields. gbot codex new/codex_new use thread/start with cwd, model, effort, and optional first message, preserving the expected-cwd guard. Added protocol and validation tests.
  3. Busy queue: Verified Codex 0.158.0 stable and experimental schemas. thread/queue/* remains experimental, so queue selection without GROK_BOT_CODEX_EXPERIMENTAL=1 fails before connecting with the supported alternatives; an opted-in daemon is checked by the actual thread/queue/add response. Updated the API pin, docs, and both-path tests.
  4. Remote reachability: Missing-socket errors explain that Codex and gbot must run on the same machine, name CODEX_APP_SERVER_SOCK, and point Grok Bot boxes to machine-targeted Grok Bot Shell. Added error guidance tests and README instructions.
  5. Plugin commands: Added generated Claude Code and Cursor slash commands for Codex send, threads, and wait, with a source-to-artifact test. Origin/main has no chatgpt-desktop status/list/read/send routes, so no Desktop commands were added.

Verification

  • npm run check: pass (419 unit tests; 15 route tests)
  • npm run build: pass
  • npm run validate:artifact: pass
  • npx changeset status --since=origin/main: patch release recognized
  • npm pack --dry-run: pass; all three command files included

A live 25-minute turn was not run because the separate checkout has an active end-to-end test; the flood regression exercises completion reconciliation in this worktree. No npm release or installation was attempted.

@changeset-bot

changeset-bot Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 0f4e856

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
grok-bot-cli Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 29, 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-09-29T03:10:07.291105Z de0b265 PR opened
ℹ️ 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.

@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: de0b265720

ℹ️ 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".

Comment thread src/core/codex/routes.ts
Comment on lines +15 to +16
model: z.string().regex(/^[A-Za-z0-9][A-Za-z0-9._:/-]{0,127}$/).optional(),
effort: z.enum(['none', 'minimal', 'low', 'medium', 'high', 'xhigh']).optional(),

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 Route model and effort through managed sends

When codex_send is called with replyToGrok or bindingId, these newly accepted options are passed to codexReturnOperation, but that function neither accepts nor includes model or effort in the managed sendToCodex payload. The request therefore succeeds while silently running with the thread's existing selection, which can produce results from a different model or reasoning effort than the caller requested.

Useful? React with 👍 / 👎.

Comment on lines 173 to 177
while (!done) {
const interactions = scan();
if (terminal(status)) return [status, error ?? historyError];
if (historyError || overflow) return ['unknown', historyError ?? 'Notification coverage overflow'];
if (historyError) return ['unknown', historyError];
if (interactions.length) return ['waiting-for-input'];

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 overflow uncertainty for pending interactions

When more than 500 notifications or 4 MiB of events arrive, the bounded event queue can evict an unresolved approval or user-input request, but this change no longer treats overflow as incomplete coverage and resets truncated to false. History polling only reconstructs turns and items, not server requests, so a flooded wait can now report a plain timeout with interactions: [] and reply.truncated: false even though the turn is blocked on an interaction that was dropped.

Useful? React with 👍 / 👎.

Comment thread src/core/codex/routes.ts
expectedCwd: z.string().min(1).optional(),
threadId: id,
timeoutMs: z.number().int().min(1).max(600000).optional(),
timeoutMs: z.number().int().min(1).max(7200000).optional(),

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 Keep the watch timeout limit aligned

watchSchema spreads observationFields, so raising this shared maximum to two hours also makes codex watch accept values above 600000 ms. conversation.watch still enforces a 600000 ms maximum and the watch route still advertises that limit, causing values such as 1800000 to pass route validation and then return a usage failure from the operation instead of being rejected consistently; use a wait-specific timeout field or update the watch implementation and render budget too.

Useful? React with 👍 / 👎.

@ScriptedAlchemy
ScriptedAlchemy merged commit e746891 into main Sep 29, 2026
2 checks passed
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