Skip to content

[EPIC-U][LOU-U22] Resumed sub-agent that pauses again keeps the session awaiting approval - #77

Merged
LinuxDevil merged 1 commit into
mainfrom
lou-u22-subagent-repause-checkpoint
Oct 1, 2026
Merged

LinuxDevil merged 1 commit into
mainfrom
lou-u22-subagent-repause-checkpoint

Conversation

@LinuxDevil

Copy link
Copy Markdown
Owner

What

When resumeAfterApproval() resumes a sub-agent (task tool) call and the sub-agent pauses again, it now writes an 'awaiting-approval' checkpoint (new approvalId, carried businessState) under the session. New helper markAwaitingApproval() in src/execution/resume.ts (+34 lines). Documented in docs/durable-execution.md; llms-full.txt regenerated with npm run docs:llms. Three tests added in src/execution/subagentInheritance.test.ts.

Why

resumeAfterApproval() deletes the pre-pause checkpoint before resuming. On the "sub-agent paused again" path no execute() call runs, so nothing rewrote it. A later execute() on that sessionId then started a fresh run with only the new input instead of throwing SessionAwaitingApprovalError, bypassing the pending decision. Found while merging PR #68 with PR #71.

Acceptance criteria

  • A run paused on a sub-agent marks its session awaiting approval, then finishes and continues after approval
  • The session stays awaiting approval when the resumed sub-agent pauses again (execute() throws SessionAwaitingApprovalError)
  • Approval mid-batch, where the remaining task call's sub-agent pauses in turn, works
  • Full suite passes
  • docs/durable-execution.md documents the behaviour
  • AgentExecutor.ts, toolCallExecution.ts, createAgent.ts untouched

How verified

  • Reverting only resume.ts to main: keeps the session awaiting approval when the resumed sub-agent pauses again fails (expected null to match object { status: 'awaiting-approval', ... }); with the fix it passes. The other two tests pass on both (they guard the surrounding behaviour).
  • npx tsc --noEmit: pass
  • npm run lint: 0 errors, 433 warnings, none in the changed files
  • npm run test:types: no errors
  • npx vitest run (after npm run build): 137 files passed, 2024 passed, 3 skipped
  • npm run build && npm run build --workspace=packages/create-loushy-agent: pass
  • npm run docs:verify-snippets -- --skip-build: all 91 snippets type-check
  • npm run docs:llms:check: pass
  • npm run test:coverage: pass (137 files, 2024 passed); one earlier run had 1 failing test that passed on re-run, not identified
  • npm run fallow: 0 above threshold, exit 0

🤖 Generated with Claude Code

https://claude.ai/code/session_016bY29ibQgv3MDdjAbUT4YR


Generated by Claude Code

resumeAfterApproval() deletes the pre-pause checkpoint before resuming a
sub-agent. When that sub-agent paused again, nothing rewrote it, so a later
execute() on the same sessionId started a fresh run instead of throwing
SessionAwaitingApprovalError. Write an 'awaiting-approval' checkpoint with
the new approvalId (and the carried businessState) on that path.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016bY29ibQgv3MDdjAbUT4YR
@LinuxDevil
LinuxDevil merged commit 2231995 into main Oct 1, 2026
1 check 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.

2 participants