[codex] Add Codex slash command support#3558
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
213da6a to
d42359e
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want reviews to match your repository better? Bugbot Learning can learn team-specific rules from PR activity. A team admin can enable Learning in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit d42359e. Configure here.
ApprovabilityVerdict: Needs human review This PR introduces two new user-facing slash commands (/compact and /review) with significant new runtime logic, async coordination patterns, and API integrations. New feature additions that enable new user-facing workflows warrant human review. You can customize Macroscope's approvability policy. Learn more. |
Co-authored-by: Codex <codex@openai.com>
d42359e to
21bf969
Compare

Summary
/reviewand/compactafter the app-server probe succeeds./review [instructions]and/compactprompts through Codex app-server RPCs instead of sending them as chat messages./goalhandling remains separate native goal work because Codex exposes dedicated goal RPCs.Why
Codex slash commands are not a generic text passthrough in T3 Code.
/reviewreturns a turn fromreview/start, while/compactstarts throughthread/compact/startand reports its turn throughturn/started, so the Codex provider runtime needs to own that mapping.Impact
Codex users see
/reviewand/compactin the composer command menu. Submitting either command starts the matching provider-native turn and preserves the usual T3 turn/session state.Validation
PATH="$HOME/.vite-plus/bin:$PATH" vp checkPATH="$HOME/.vite-plus/bin:$PATH" vp run --filter ./apps/server typecheckPATH="$HOME/.vite-plus/bin:$PATH" vp test run apps/server/src/provider/Layers/CodexAdapter.test.tsPATH="$HOME/.vite-plus/bin:$PATH" vp run typecheckRefs #2491
Note
Add
/compactand/reviewslash command support to the Codex providerCODEX_APP_SERVER_SLASH_COMMANDSin CodexProvider.ts advertisingcompactandreviewslash commands; successful provider probes now include these, while error/disabled states return an empty list.parseStandaloneCodexSlashCommandin CodexAdapter.ts to detect single-line/compactor/review [instructions]messages with no attachments, routing them torunSlashCommandinstead of a normalsendTurn.runSlashCommandin CodexSessionRuntime.ts:/compactcallsthread/compact/startand waits for the nextturn/startednotification;/reviewcallsreview/startwith optional instructions and inline delivery.sendTurnandrunSlashCommand) with a semaphore, tracking known turn IDs and pending waiters to correctly resolve or fail them on process exit or runtime close.sendTurncalls are now serialized, which changes timing behavior for back-to-back turn starts.Macroscope summarized 21bf969.
Note
Medium Risk
Changes Codex session turn-start orchestration and async compact turn correlation; failures or missing
turn/startedevents could block or error slash commands without affecting unrelated providers.Overview
Adds Codex-native slash commands so standalone
/reviewand/compactprompts are not sent as ordinary chat turns.After a successful app-server probe, the Codex provider snapshot now includes
reviewandcompactinslashCommands(empty while disabled or probe fails). InCodexAdapter,parseStandaloneCodexSlashCommandrecognizes attachment-free/compactor/review [instructions]input and callsrunSlashCommandinstead ofsendTurn, optionally passing the bound instance’s selected model.CodexSessionRuntimeimplementsrunSlashCommand:review/startwith custom instructions or uncommitted changes;thread/compact/startplus a deferred waiter on the nextturn/startedthat ignores already-known turn IDs. Turn starts (slash commands and normal sends) share a semaphore, and known turn IDs are tracked on thread open/read/rollback. Process exit/close fails pending compact waiters.Reviewed by Cursor Bugbot for commit 21bf969. Bugbot is set up for automated code reviews on this repo. Configure here.