Skip to content

Add cooperative session takeover to CLI - #351

Merged
Brian Krabach (bkrabach) merged 2 commits into
mainfrom
feat/cooperative-session-handoff
Sep 19, 2026
Merged

Brian Krabach (bkrabach) merged 2 commits into
mainfrom
feat/cooperative-session-handoff

Conversation

@bkrabach

@bkrabach Brian Krabach (bkrabach) commented Sep 19, 2026

Copy link
Copy Markdown
Collaborator

CLI sessions can now yield to Unified or another compatible local host without asking the user to manually close the terminal. A release request wakes idle input or gracefully stops active work, saves native history, finishes cleanup while holding the lock, then exits with a notice naming the requesting app.

When resuming a busy session, interactive CLI startup identifies the owner and offers takeover. Scripts opt in with --takeover; --handoff-timeout bounds the wait. Startup acquires ownership and reloads saved state before execution. Failed saves retain ownership, timeouts never force unlock, and a competing successor is not silently targeted.

Depends on microsoft/amplifier-foundation#398, pinned in package metadata and the lockfile. Companion Unified integration: https://github.com/bkrabach/amplifier-unified/pull/46.

Validation: full suite passed against the installed pinned Foundation package: 2,364 passed, 45 skipped, 13 deselected by the existing test configuration, and 1 expected failure. The run enabled terminal colors for existing ANSI-rendering assertions. Coverage includes idle wakeup, real-lock acquisition, save-before-cleanup, failed-save retention, interactive accept/decline, noninteractive opt-in, shell completion, JSON persistence, and TTY teardown. Static checks and whitespace checks passed. All six macOS/Linux/Windows CI unit jobs and both macOS/Linux integration jobs passed.

This preserves the current native transcript/metadata format and existing POSIX shared-ownership boundary. It does not introduce event-only recovery or migrate execution between machines. See docs/SESSION_HANDOFF.md.

@bkrabach
Brian Krabach (bkrabach) merged commit 57fbba1 into main Sep 19, 2026
9 checks passed
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