fix(acp): reduce runaway subscription usage - #3066
Conversation
Signed-off-by: David Fitzsimmons <dave_fitz@icloud.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 29884e433f
ℹ️ 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".
Signed-off-by: David Fitzsimmons <dave_fitz@icloud.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: dea9672f7d
ℹ️ 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".
| } else if matches!(&result.outcome, PromptOutcome::Error(e) if is_usage_limit_error(e)) | ||
| { |
There was a problem hiding this comment.
Stop heartbeat retries after provider quota errors
When BUZZ_ACP_HEARTBEAT_INTERVAL is enabled and a heartbeat prompt receives one of these quota errors, result.batch is None, so execution never reaches this classifier; the later PromptSource::Heartbeat branch clears heartbeat_in_flight, allowing the next interval to submit the same provider request again—as often as every 10 seconds. This leaves an automatic request storm for heartbeat agents despite treating the error as terminal; suspend or back off heartbeats when their outcome satisfies is_usage_limit_error.
Useful? React with 👍 / 👎.
Signed-off-by: David Fitzsimmons <dave_fitz@icloud.com>
Summary
buzz_acplogging namespace so the desktop child-process filter records itWhy
These safeguards prevent unrelated events and retry loops from unnecessarily consuming model subscription capacity while making unusually large prompts observable. Legacy compatibility sessions continue to receive their governing preamble on every turn so context compaction cannot discard it.
Related issue
Related to #2422, which describes an adjacent class of deterministic ACP retry loops. This PR does not address that issue's JSON-RPC diagnostic-loss problem.
Testing
cargo fmt --all -- --checkcargo test -p buzz-acp(604 unit tests and 9 lifecycle tests)cargo clippy -p buzz-acp --all-targets -- -D warningswarn,buzz_acp=info)just ciProvider usage-limit classification is covered by automated tests. A direct manual test would require deliberately forcing an external provider quota error, so it was not performed.