Skip to content

fix(agent): surface retries and honor Retry-After - #6112

Open
GitGeniusX wants to merge 1 commit into
block:mainfrom
GitGeniusX:codex/agent-failure-feedback
Open

fix(agent): surface retries and honor Retry-After#6112
GitGeniusX wants to merge 1 commit into
block:mainfrom
GitGeniusX:codex/agent-failure-feedback

Conversation

@GitGeniusX

Copy link
Copy Markdown

Summary

When a provider turn fails transiently, the harness currently stays silent until the full retry budget is exhausted. For Azure Foundry that can leave a healthy, online agent visibly unresponsive for about 25 minutes. The generic OpenAI-compatible transport also ignores the provider's Retry-After hint on HTTP 429, so its three attempts can land inside the same throttle window.

This change:

  • posts one immediate user-visible notice on the first generic retry, while preserving the existing final dead-letter notice
  • suppresses repeated notices on later exponential-backoff attempts
  • honors bounded Retry-After hints on the generic OpenAI-compatible transport used by Azure Foundry, falling back to existing jittered backoff
  • logs only the retry delay metadata, not response content

Related issue

Closest existing issue: #5196. Related: #5557 and #5918 / #5975.

This is complementary rather than duplicate work: #5557 is the relay HTTP publish path; this PR changes the buzz-agent provider transport. #5975 parks recognized multi-hour subscription-limit errors; this PR gives immediate feedback for the generic retry path and does not change retry/dead-letter policy.

Testing

  • regression test proves the generic OpenAI-compatible transport waits for Retry-After before its successful retry
  • queue regression test proves the first-failure counter increments and resets after completion
  • cargo test -p buzz-agent -p buzz-acp
  • cargo clippy -p buzz-agent -p buzz-acp --all-targets -- -D warnings
  • cargo fmt --all -- --check
  • full just ci (workspace lint/tests, desktop, web, Tauri, and 1,465 mobile tests)

No desktop or mobile UI changes.

Follow-up

After merge and an upstream image release, downstream deployments can pin the released digest; no deployment-specific fork is required.

Signed-off-by: Johan Schmidt <130892839+GitGeniusX@users.noreply.github.com>
@GitGeniusX
GitGeniusX requested a review from a team as a code owner August 17, 2026 10:08

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 03b0911e67

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +3972 to +3974
let first_failure = queue.retry_count(&batch.channel_id) == 0;
if first_failure {
spawn_failure_notice(

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Surface the first recently-active hard-timeout retry

When the first failure is TimeoutKind::Hard { recently_active: true }, the preceding branch requeues the batch without posting the new notice. Because that increments the channel's retry count, this check also suppresses the notice if a later attempt fails through the generic branch. Repeated recently-active hard timeouts can therefore leave the user without feedback until final dead-lettering, contrary to the change's retry-visibility goal; emit the one-shot notice for this retry path as well or track notice delivery separately from the retry count.

AGENTS.md reference: AGENTS.md:L13-L18

Useful? React with 👍 / 👎.

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