fix(codex): keep app-server protocol decode current - #209
Conversation
Large Codex app-server messages were re-scanned on every chunk, and newer 0.150/0.151 enum values failed decode on account probes and historical thread payloads. Stale Codex approval callbacks also missed the shared recovery classifier. Adapt T3 Code pingdotgg#8605, pingdotgg#8346, pingdotgg#8447, pingdotgg#8897, pingdotgg#10373, and pingdotgg#5195 to the retained effect-codex-app-server client and ProviderCommandReactor. Primary Codex turns still use Mastra; this keeps probes, generated schemas, and leftover app-server sessions compatible. Made with Grok 4.6 High in Grok Build via Orca.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Greptile SummaryThe PR extends Codex protocol compatibility handling for retained historical values, including thread-list responses, while preserving fragmented JSONL framing behavior and focused regression coverage. Confidence Score: 5/5Safe to merge. The previously reported thread-list compatibility issue is resolved without explanation by greptile-apps[bot]. No outstanding findings remain. Files Needing Attention: None. Reviews (5): Last reviewed commit: "Merge branch 'main' into fix/codex-app-s..." | Re-trigger Greptile |
thread/list still rejected persisted rateLimitExceeded and misalignmentPolicyViolation values after read/resume learned them. One historical failed turn could fail the whole list response. Keep the same generator compatibility override and generated schema variants on V2ThreadListResponse. Made with Grok 4.6 High in Grok Build via Orca.
|
This is Leo's agent. Greptile's 'Bound inventory refreshes' finding in apps/server/src/provider/opencodeRuntime.ts is valid: I traced loadInventoryFromCli through checkOpenCodeProviderStatus, OpenCodeDriver, and makeManagedServerProvider; the inventory path has no deadline, while the four-second timeout covers only the version probe. This was inherited from already merged #205. I requested a separate current-main repair with child cleanup and semaphore-release regression tests through the existing OpenCode worker, but execution is blocked by service 503 errors and exhausted weekly usage. This PR remains on hold; the defect is not dismissed as outside the diff. |
Problem
The retained Codex app-server client still concatenates every stdin chunk into one growing buffer, so large JSONL messages get scanned again and again. Newer Codex 0.150/0.151 values also fail decode: multi-agent tools and activity kinds, extra ChatGPT plan types, and persisted
rateLimitExceeded/misalignmentPolicyViolationturn errors. After a recovered Codex session, answering an old approval card can returnUnknown pending Codex approval request, which the reactor did not classify as the existing stale-approval failure.Primary Codex, Kimi, and OpenCode Go turns use Mastra. This change does not switch that path. It keeps provider probes, generated schemas, and leftover app-server sessions from treating current Codex payloads as protocol errors.
Changes
current + chunkconcatenation.rateLimitExceededandmisalignmentPolicyViolationon the thread read/resume/rollback/fork andturn/completedschemas without folding them intoother.Adapted from T3 Code pingdotgg#8605, pingdotgg#8346, pingdotgg#8447, pingdotgg#8897, pingdotgg#10373, and pingdotgg#5195. Not a bulk cherry-pick. No Mastra turn-path change, no compaction, no restart continuation, and no question-lifecycle work.
Verification
vp test run packages/effect-codex-app-server/src/protocol.test.ts packages/effect-codex-app-server/src/schema.test.ts apps/server/src/orchestration/Layers/ProviderCommandReactor.test.ts --maxWorkers=2: 89 passed, including fragmented 4MiB notifications, 1/7/1024-byte JSONL/UTF-8 framing, malformed final lines, 0.150 enums, plan types, historical error variants, and stale Codex approval recovery.vp run --filter effect-codex-app-server typecheckandvp run --filter akeru-bot typecheckpassed (existing Effect suggestions only).No live Codex CLI session or paid provider call was used. Browser and native clients are unchanged. Settings Codex account labels for the new plan types are covered by the schema decode tests and the exhaustiveness check on
codexAccountAuthLabel.Limitations
Codex chat turns still go through Mastra. App-server
thread/resumedecode now accepts the extra historical error values, but that only helps retained CodexAdapter/session-runtime consumers and provider probes. Other workers own compaction, restart continuation, and question lifecycle.Implemented with Grok 4.6 High in Grok Build via Orca.