Skip to content

fix(acp): resume pending turns after Desktop restart - #5181

Open
Tiago-Sonar wants to merge 1 commit into
block:mainfrom
Tiago-Sonar:fix/persistent-turn-ledger
Open

fix(acp): resume pending turns after Desktop restart#5181
Tiago-Sonar wants to merge 1 commit into
block:mainfrom
Tiago-Sonar:fix/persistent-turn-ledger

Conversation

@Tiago-Sonar

Copy link
Copy Markdown

Summary

Persist queued and in-flight ACP turns in a bounded, atomic local ledger so managed agents can resume admitted work after Buzz Desktop restarts when the per-agent resume_on_restart setting is enabled.

This wires the setting through Desktop configuration and the agent editor, restores eligible turns during ACP startup, and preserves the current spawn-snapshot, parallelism, and access-control behavior. Ledger retention is bounded and stale entries are pruned.

Related issue

No dedicated GitHub issue found. This repair originated from a live Buzz reliability assessment after admitted turns disappeared during Desktop outages.

Originating Buzz thread:

buzz://message?channel=4c0769da-da97-4e9d-bf12-152ddbaec0aa&id=31a1776cadd43bc656a438e5a89b052b476bf9f1919ae73bcbd99e7738e60f4a

Testing

  • BUZZ_ACP_LAZY_POOL=false BUZZ_ACP_MULTIPLE_EVENT_HANDLING=steer cargo test -p buzz-acp — 765 unit tests, 9 lifecycle integration tests, 1 setup-ledger integration test, and doc tests passed.
  • ./bin/just desktop-ci — 4,480 frontend tests, production build, Tauri compilation, and complete Tauri workspace tests passed.
  • cargo clippy -p buzz-acp --all-targets -- -D warnings — passed.
  • ./bin/just desktop-tauri-clippy — passed.
  • ../bin/pnpm exec playwright test --project=smoke tests/e2e/edit-agent.spec.ts tests/e2e/global-agent-config-screenshots.spec.ts — 29/29 passed.
  • git diff --cached --check — passed before commit.

Scope boundary

This closes the restart-loss path for admitted queued/in-flight turns. It does not add the separate full event-stage audit ledger for receipt, admission/rejection, ACP submission, completion, publication, and relay-accepted reply IDs.

Persist queued and in-flight turns in a bounded atomic ledger so enabled managed agents can recover work after Desktop restarts. Wire the per-agent setting through Desktop configuration and preserve current spawn-snapshot, parallelism, and access behavior.

Validation: cargo test -p buzz-acp; ./bin/just desktop-ci; 29 changed Desktop E2E tests; ACP and Desktop Tauri clippy with warnings denied.
Co-authored-by: TMC <tiago@sonargtm.com>
Signed-off-by: TMC <tiago@sonargtm.com>
@Tiago-Sonar

Copy link
Copy Markdown
Author

@block/buzz-oss-team Review requested. This critical restart-recovery fix is mergeable; DCO, Semgrep, and zizmor are green, and the PR body records full ACP/Desktop/E2E validation.

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