Skip to content

fix(acp): reduce runaway subscription usage - #3066

Open
fitz2882 wants to merge 3 commits into
block:mainfrom
fitz2882:codex/acp-subscription-safeguards
Open

fix(acp): reduce runaway subscription usage#3066
fitz2882 wants to merge 3 commits into
block:mainfrom
fitz2882:codex/acp-subscription-safeguards

Conversation

@fitz2882

@fitz2882 fitz2882 commented Jul 27, 2026

Copy link
Copy Markdown

Summary

  • reject non-message UI activity events before wildcard subscription matching
  • treat provider usage-limit responses as terminal instead of retryable session failures
  • make subprocess stdin writes cancellation-safe
  • add prompt-size telemetry and a large-prompt warning
  • keep prompt telemetry inside the buzz_acp logging namespace so the desktop child-process filter records it

Why

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 -- --check
  • cargo test -p buzz-acp (604 unit tests and 9 lifecycle tests)
  • cargo clippy -p buzz-acp --all-targets -- -D warnings
  • regression test with the desktop child-process filter (warn,buzz_acp=info)
  • just ci

Provider 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.

Signed-off-by: David Fitzsimmons <dave_fitz@icloud.com>
@fitz2882
fitz2882 marked this pull request as ready for review July 27, 2026 04:11
@fitz2882
fitz2882 requested a review from a team as a code owner July 27, 2026 04:11

@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: 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".

Comment thread crates/buzz-acp/src/pool.rs Outdated
@fitz2882
fitz2882 marked this pull request as draft July 27, 2026 04:22
Signed-off-by: David Fitzsimmons <dave_fitz@icloud.com>
@fitz2882
fitz2882 marked this pull request as ready for review July 27, 2026 04:55

@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: 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".

Comment on lines +3165 to +3166
} else if matches!(&result.outcome, PromptOutcome::Error(e) if is_usage_limit_error(e))
{

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 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>
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