Skip to content

feat: show the retry cause as details of the AIR retry warning - #755

Merged
nikita-ashihmin merged 2 commits into
agentclientprotocol:mainfrom
nikita-ashihmin:feat/retry-warning-details
Nov 11, 2026
Merged

nikita-ashihmin merged 2 commits into
agentclientprotocol:mainfrom
nikita-ashihmin:feat/retry-warning-details

Conversation

@nikita-ashihmin

@nikita-ashihmin nikita-ashihmin commented Nov 11, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

When the Codex app-server reports an error with willRetry: true, codex-acp publishes an AIR sessionFailure warning. The warning had only the title, such as Reconnecting... 2/5. Codex puts the cause of the retry in TurnError.additionalDetails, for example stream disconnected before completion: idle timeout waiting for websocket. codex-acp dropped it, so a user saw the same title for minutes and did not know why.

Changes

  • recordRetryWarning passes the trimmed additionalDetails as details of the warning. With null or a blank value, the warning has no details key.
  • recordSessionFailure takes an optional details. Each revision builds the record again, so a later revision without a cause does not keep the old one.
  • Both paths of a retry warning use it: createErrorEvent and handleSessionScopedNotification.
  • The title, the actions, the id and the revision do not change.
  • Terminal failures (willRetry: false) still do not send additionalDetails. The earlier tests asserted that a retry warning also must not send it. This change removes that rule for retry warnings only. The legacy, non-typed path already sends the full error, additionalDetails included.

Why the cause is safe to send for a retry

PR #383 kept additionalDetails out of every typed failure. This PR changes that rule for retry warnings only. Terminal failures still send no details.

  • The cause goes to the same user whose Codex session retries. A user who uses Codex directly sees the same text.
  • The legacy, non-typed path already sends the full error to every other client, additionalDetails included.
  • For an HTTP retry, the text can hold the response body, the provider URL and a request id. These belong to the user's own account and gateway. They help the user see why the turn waits.

Tests

  • auth-error-events.test.ts: the cause is in details for a retry of the current turn, of another turn, of an HTTP 429, and for a late retry after the turn. No details key for null and for a blank value.
  • typed-session-failure-wire.test.ts: the raw wire JSON for one id across 4 revisions. A new cause replaces the old one, and a revision without a cause has no details.
  • npm run typecheck: clean.
  • npm run test: 2507 passed. 2 tests in standard-subagent-live.test.ts fail. They fail on main without this change too.

A retry warning showed only "Reconnecting... N/5". Codex sends the cause
of the retry in TurnError.additionalDetails, and the adapter dropped it.

The retry warning now carries the trimmed additionalDetails as details.
With null or blank additionalDetails, the failure has no details key.
Each revision of a failure carries only its own details.
Terminal failures and the legacy path do not change.
@nikita-ashihmin nikita-ashihmin changed the title feat: show the retry cause as details of the Air retry warning feat: show the retry cause as details of the AIR retry warning Nov 11, 2026
…ision

Document that a retry warning carries the trimmed additionalDetails as details,
and that a terminal failure carries no details.
Assert the details for ACP v1 and v2.
Assert that the terminal revision of the same incident has no details key.
Remove unit tests that repeat the wire test and take the same code path.
@nikita-ashihmin
nikita-ashihmin merged commit e981b3c into agentclientprotocol:main Nov 11, 2026
2 checks passed
EugeneTheDev pushed a commit that referenced this pull request Nov 16, 2026
🤖 I have created a release *beep* *boop*
---


##
[2.7.0](v2.6.0...v2.7.0)
(2026-11-16)


### Features

* report delegated tasks as session messages and reference children from
tool calls
([#760](#760))
([6567651](6567651))
* send structured plans as items plan_update when the client supports it
([#752](#752))
([ab7a968](ab7a968))
* show the retry cause as details of the AIR retry warning
([#755](#755))
([e981b3c](e981b3c))


### Bug Fixes

* Map priority mode to fast
([#327](#327))
([52cc518](52cc518))
* report hooks that block or stop Codex
([#767](#767))
([bcf0e92](bcf0e92))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: acp-release-bot[bot] <246668977+acp-release-bot[bot]@users.noreply.github.com>
mrmans0n added a commit to mrmans0n/codex-acp that referenced this pull request Nov 17, 2026
Upstream v2.7.0 (agentclientprotocol#767) replaces the event handler's session failure epoch and
per-handler notice counter with SessionFailureIds, one counter per connection
that every prompt's handler shares, and passes it as the fourth constructor
argument. 8aaab39 conflicted there: it kept the epoch string and numbered
client-neutral incidents with the incident counter of its connection-wide
NeutralSessionFailureLedger. Upstream's counter now does exactly that for both
typed forms, with the same <epoch>:<n> id format, so the adaptation:

- takes upstream's SessionFailureIds next to the format (the boolean AIR flag
  of upstream's own callers still means air or none);
- allocates failure and notice ids from it in both forms and drops the
  ledger's now unused incident counter;
- keeps the ledger's revision floor for the neutral form, which upstream does
  not have (a later handler can still re-send <turnId>:error);
- passes this.capabilities.sessionFailureFormat and this.sessionFailureIds
  from the server, including the pre-prompt goal subscription.

With agentclientprotocol#755 the retry warning carries the trimmed Codex additionalDetails as
details; the neutral record follows the AIR lane's title and details rules, as
docs/air-extensions.md already states, so the neutral retry test now expects
them. With agentclientprotocol#767 a hook that blocks or stops Codex is a notice: a neutral client
without session.notices gets it as a _meta.sessionFailure record with kind
notice. New test for that; it and the existing neutral tests fail when the
typed lane is AIR-only, and the later-prompt id test fails with per-handler ids.
Adapted from 8aaab39 (originally 2a1384e).
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