Skip to content

feat: expose typed session failures for AIR - #383

Open
nikita-ashihmin wants to merge 2 commits into
agentclientprotocol:mainfrom
nikita-ashihmin:codex/ijai-845-typed-session-failure
Open

feat: expose typed session failures for AIR#383
nikita-ashihmin wants to merge 2 commits into
agentclientprotocol:mainfrom
nikita-ashihmin:codex/ijai-845-typed-session-failure

Conversation

@nikita-ashihmin

@nikita-ashihmin nikita-ashihmin commented Aug 9, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Negotiate the JetBrains AIR sessionFailure extension when the client advertises an integer version >= 1 and the capability name.
  • Return turn-terminal failures only on PromptResponse._meta; publish late, idle, and otherwise session-scoped failures through session/update.
  • Keep legacy ACP cancellation and RequestError behavior for capability-off clients.
  • Emit bounded fixed safe messages without provider details, stderr, paths, headers, tokens, or stack traces.

Recovery contract

Failures use _meta.jetbrains.air.sessionFailure with a stable id, monotonic revision, phase, category, source, safe message, retryability, and optional real turn attribution. Turn failures use the completed app-server turn id. Session-scoped ids include a per-server epoch so an AIR replay tombstone cannot suppress a new outage after process restart.

AIR owns localized action presentation. Codex supplies typed category and retryability facts. A successful prompt clears only the exact failure revision that was active when that recovery attempt started; a newer failure is never cleared accidentally.

The event routing covers the boundaries that previously lost or misattributed errors: before turn start, after turn/completed, during plan approval, between approval and implementation turnStart, during implementation, after prompt return, process exit, and local slash commands that complete without creating a turn.

Validation

  • 394 passed, 28 skipped.
  • Build passed.
  • Typecheck passed.
  • Diff check passed.
  • In-memory NDJSON tests cover initialize negotiation, terminal PromptResponse metadata, session-scoped updates, process exit, capability-off behavior, restart-safe ids, and plan/slash-command races.

Negotiate safe typed session failures while preserving legacy ACP behavior for other clients.

Use PromptResponse metadata for terminal turn failures and session updates for asynchronous failures, with restart-safe identities and deterministic recovery revisions.
@nikita-ashihmin
nikita-ashihmin force-pushed the codex/ijai-845-typed-session-failure branch from 325903d to bea79c0 Compare August 9, 2026 21:45
Tie session-failure categories to the generated CodexErrorInfo union so schema changes fail typecheck instead of silently falling through. Preserve a safe runtime fallback for newer app-server variants and extract HTTP status codes structurally.
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