Skip to content

Codex: retries, compaction and compact-on-demand from app-server are unused #163

Closed

Description

@mubeda

Summary

Codex app-server 0.163.0 reports upstream retries, shows compaction as a thread item, and accepts a compaction request. The Codex adapter uses none of these, so a Codex chat can't show "retrying", can't show compaction, and can't recover from contextWindowExceeded by compacting. This is the Codex side of #161 (Claude) and of #160's recovery. The error classification itself is #162.

Environment

Field Value
BiBCode 0.10.2 (line numbers at 0b98d0a4)
Codex codex-cli 0.163.0 (latest), generated app-server v2 schema

Gaps

App-server feature (0.163) What it carries BiBCode today
error notification { error, threadId, turnId, willRetry } An upstream failure, and whether Codex will retry it Not handled: handle_notification has no "error" arm (apps/server/src/provider/codex/runtime.rs:2566), so retries are silent until the turn completes
contextCompaction thread item (item/started → item/completed); the legacy thread/compacted notification is deprecated Codex compacting the conversation item/started and item/completed only surface commandExecution and agentMessage (apps/server/src/provider/codex/runtime.rs:2691)
thread/compact/start request { threadId }; returns {} and streams progress as turn/* and item/* Compact on demand Never sent; there is no Compact action for Codex

Suggested fix direction

  • Handle error with willRetry: true as a runtime warning ("Codex is retrying: …"), as the Claude adapter does for api_retry.
  • Surface contextCompaction items as a "Compacting conversation…" status.
  • Offer Compact for Codex threads through thread/compact/start, and use it for the automatic contextWindowExceeded recovery proposed in Claude: full context fails turns as "blocking_limit" instead of compacting #160.
  • Capture 0.163 fixtures for each and add tests; document them in docs/providers/codex.md ("Context-window usage").

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementRequested improvement or new capability.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions