feat: expose typed session failures for AIR - #383
Open
nikita-ashihmin wants to merge 2 commits into
Open
Conversation
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
force-pushed
the
codex/ijai-845-typed-session-failure
branch
from
August 9, 2026 21:45
325903d to
bea79c0
Compare
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
sessionFailureextension when the client advertises an integer version>= 1and the capability name.PromptResponse._meta; publish late, idle, and otherwise session-scoped failures throughsession/update.RequestErrorbehavior for capability-off clients.Recovery contract
Failures use
_meta.jetbrains.air.sessionFailurewith 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 implementationturnStart, during implementation, after prompt return, process exit, and local slash commands that complete without creating a turn.Validation
PromptResponsemetadata, session-scoped updates, process exit, capability-off behavior, restart-safe ids, and plan/slash-command races.