Skip to content

Preserve live Claude work during idle release - #2893

Merged
ymichael merged 1 commit into
mainfrom
bb/fixer-preserve-live-claude-background-tasks-duri-thr_3v6xrpw7dx
Sep 3, 2026
Merged

ymichael merged 1 commit into
mainfrom
bb/fixer-preserve-live-claude-background-tasks-duri-thr_3v6xrpw7dx

Conversation

@ymichael

@ymichael ymichael commented Sep 2, 2026

Copy link
Copy Markdown
Collaborator

Human comments

What was wrong

The opt-in Claude idle releaser treated translated turns, background-task presentation state, BB-forwarded tool calls, and interactive requests as the complete residency signal. That omitted Claude's authoritative running and requires_action session states and its pending session-cron snapshot, so the 30-second timer could stop a process that was still working or waiting to deliver a scheduled wakeup.

What changed

The Claude bridge now includes authoritative SDK session state and the Stop hook's replace-all session_crons snapshot in the shared quiescence decision. running, requires_action, and any pending scheduled work keep the query resident; idle with an empty cron snapshot permits the existing grace-period release. The existing authoritative background_tasks_changed handling and older-CLI task-bookend fallback remain intact. No daemon wire contract, CLI, guide, or configuration surface changed.

How you verified

  • Added timer regressions for running and requires_action transitioning to idle; they failed before the fix because query.close() ran and pass after it.
  • Added a timer regression for a nonempty Stop-hook session-cron snapshot transitioning to empty; it failed before the fix and now preserves the query until the snapshot clears.
  • Ran pnpm exec turbo run test typecheck build --filter=bb-plugin-provider-claude-code --force after rebasing onto current origin/main: 24 test files and 351 tests passed; typecheck and build passed; 6/6 Turbo tasks succeeded.
  • git diff --check passed.

Follow-up to #2808.

AGENT GENERATED

Idle release treated translated turns and background tasks as the complete residency signal. Honor authoritative running and requires-action session states, and use Stop-hook session cron snapshots so scheduled wakeups remain resident until the SDK reports no pending work.
@ymichael
ymichael force-pushed the bb/fixer-preserve-live-claude-background-tasks-duri-thr_3v6xrpw7dx branch from 00fd382 to 571eb16 Compare September 3, 2026 02:43
@ymichael
ymichael merged commit cb899e5 into main Sep 3, 2026
15 checks passed
@ymichael
ymichael deleted the bb/fixer-preserve-live-claude-background-tasks-duri-thr_3v6xrpw7dx branch September 3, 2026 02:47
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