feat(sessions): transfer a session to another owner (v0.193.0)#321
Merged
Conversation
Reassign a session's run_as (the accountable human it acts as) from the
Sessions list. A new Transfer control in each session's action row picks a
target member; ownership, the "mine" filter, the owner chip, and future
connector/identity resolution all follow the new run_as, while provenance
(spawned_by) is left untouched.
- src/terminal.ts: TerminalManager.transferSession(sessionId, by, toMemberId)
— validates target member, updates run_as, audits session.transferred
({from,to,agent}). No schema change (run_as already existed).
- src/server.ts: POST /api/sessions/:id/transfer — canViewSession gate plus
owner/admin-or-current-owner accountability gate.
- web: api.transferSession wrapper + a reusable <TransferMenu> (base-ui
DropdownMenu member picker) wired into both the grid and list Sessions views.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds the ability to transfer a session to another owner from the Sessions list.
A session's accountable human is its
run_as— the identity it acts as, and the key its ownership, the "mine" filter, the owner chip, and connectors/identity of any future effect all derive from. This lets an owner/admin (or the session's current owner) hand a run off to a teammate.How
src/terminal.ts—TerminalManager.transferSession(sessionId, by, toMemberId): validates the target is a real member, updatesrun_as, and auditssession.transferred({from, to, agent}). Provenance (spawned_by— what originally triggered the run) is deliberately left untouched. No DB migration —run_asalready exists.src/server.ts—POST /api/sessions/:id/transfer: the existingcanViewSessiongate plus an accountability gate (owner/admin, or the session's currentrun_as), mirroring the UI.api.transferSessionwrapper + a reusable<TransferMenu>(base-uiDropdownMenumember picker), wired into both the grid (labeled button) and list (icon) Sessions views. Optimistic owner-chip update, reconciled by the poll.Verify
npm run typecheck✓ ·cd web && npm run build✓run_as, no-op re-transfer succeeds, unknown-member →unknown member, unknown-session →unknown session, and thesession.transferredaudit row lands with{from,to,agent}under the actor's principal.🤖 Generated with Claude Code