Skip to content

fix(acp): bound retained worker sessions and recover nested CLI exits - #7507

Open
sincera7 wants to merge 1 commit into
block:mainfrom
sincera7:fix/acp-session-lifecycle-20260908
Open

fix(acp): bound retained worker sessions and recover nested CLI exits#7507
sincera7 wants to merge 1 commit into
block:mainfrom
sincera7:fix/acp-session-lifecycle-20260908

Conversation

@sincera7

@sincera7 sincera7 commented Sep 9, 2026

Copy link
Copy Markdown

When a nested Codex or Claude CLI exits while its ACP adapter stays alive, Buzz returns the adapter to the idle pool and retries requests against an unrecoverable process/session. Long-lived workers also retain provider sessions and MCP children after session-cache invalidation, allowing memory use to accumulate across channels and rotations.

Recognize the specific nested-process exit errors and use the existing respawn/backoff path, preserving failed batches for retry. Bound retained resources by recycling idle workers after five minutes or four session creations (both configurable, with zero disabling each bound). Recycling runs between turns, off the relay loop, keeps the relay connection and queue, preserves live model/effort choices across failed replacement attempts, and does not count as a crash. Fresh unused workers are not recycled. Replacement sessions reconstruct conversation context from the relay; local provider session caches are intentionally released. The Sprig image also installs the distro bubblewrap package; namespace policy remains an operator setting.

Validation covers nested-process errors retaining queued messages, active-worker exclusion, idle and creation limits, replacement initialization, model preservation, and separation of planned maintenance from crash accounting. Full buzz-acp library suite and a separately tested backport to the deployed 560fea7 revision; static musl binary startup verified in Alpine.

Duplicate issue/PR searches for retained sessions, session-close memory, and Codex process exits found no matching existing work. The originating Lingual operational work acknowledges [[lingual-release-process]]; no Lingual application release is part of this change.

Signed-off-by: bradmcauley <mcauley.brad@gmail.com>
@sincera7
sincera7 requested a review from a team as a code owner September 9, 2026 00:06
@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown

🔐 Codex Security Review

Status: review required for the current range.

The current range is c045321a7fb3ca8939f28519ce7a555a6f597728...fb4a22f1fef9fa74d229239c8996ac42bfd3adae.
A new review must complete for this exact range. When manual authorization
is required, a Block organization member must comment exactly
@buzz-security-review fb4a22f1fef9fa74d229239c8996ac42bfd3adae to authorize a new review.
Any previous review applies only to its recorded range.

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