Skip to content

fix(sessions): a human turn into an unattended run claims it (v0.469.1) - #895

Merged
vikasprogrammer merged 1 commit into
mainfrom
feat/human-turn-claims
Oct 29, 2026
Merged

vikasprogrammer merged 1 commit into
mainfrom
feat/human-turn-claims

Conversation

@vikasprogrammer

Copy link
Copy Markdown
Owner

Problem

instapods ses_4e3c72563d181c88 (engineer, task-dispatched → unattended lane): the run reported at 04:24:23, the owner typed a follow-up in the terminal at 04:24:42 (turn.speaker via:terminal), the agent worked on it, and at 04:28:30 the Stop-hook markTurnIdle reaped it (session.reaped {reason: turn-end}). Typing into an unattended run never counted as a take-over, so the reply to a human was the run's last act.

Fix

attributeTurn (fires on UserPromptSubmit once a turn is attributed to a real person: terminal / composer / inject) now calls claimSession(id, email, 'human-turn') when the run is headless and unclaimed. Same end-state as Take over: sticky, headless → 0, launch env re-marked attended, status back to running. The interactive idle reaper still bounds an abandoned one. Server-delivered text (pokes, answers) attributes nobody, so it claims nothing.

Tests

  • turn-idle-background-guard-test.cjs §2b: a human turn claims the run, status returns to running, audited via: human-turn, and the next turn-end does not tear it down. A poke with no human typing is still reaped.
  • npm run test:governance green.

🤖 Generated with Claude Code

Typing into a task/automation-dispatched run's terminal didn't count as a
take-over, so the Stop-hook turn-end reaper closed the pane as soon as the
agent answered the follow-up (instapods ses_4e3c7256). attributeTurn now
claims an unclaimed headless run when a person's turn is attributed —
same end-state as Take over, audited session.claimed {via: human-turn}.
Server-delivered text still claims nothing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vikasprogrammer
vikasprogrammer merged commit d98d415 into main Oct 29, 2026
@vikasprogrammer
vikasprogrammer deleted the feat/human-turn-claims branch October 29, 2026 04:33
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