Repository navigation
[EPIC-U][LOU-U22] Resumed sub-agent that pauses again keeps the session awaiting approval - #77
Merged
Merged
Conversation
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
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
When
resumeAfterApproval()resumes a sub-agent (tasktool) call and the sub-agent pauses again, it now writes an'awaiting-approval'checkpoint (newapprovalId, carriedbusinessState) under the session. New helpermarkAwaitingApproval()insrc/execution/resume.ts(+34 lines). Documented indocs/durable-execution.md;llms-full.txtregenerated withnpm run docs:llms. Three tests added insrc/execution/subagentInheritance.test.ts.Why
resumeAfterApproval()deletes the pre-pause checkpoint before resuming. On the "sub-agent paused again" path noexecute()call runs, so nothing rewrote it. A laterexecute()on thatsessionIdthen started a fresh run with only the new input instead of throwingSessionAwaitingApprovalError, bypassing the pending decision. Found while merging PR #68 with PR #71.Acceptance criteria
execute()throwsSessionAwaitingApprovalError)taskcall's sub-agent pauses in turn, worksdocs/durable-execution.mddocuments the behaviourAgentExecutor.ts,toolCallExecution.ts,createAgent.tsuntouchedHow verified
resume.tsto main:keeps the session awaiting approval when the resumed sub-agent pauses againfails (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: passnpm run lint: 0 errors, 433 warnings, none in the changed filesnpm run test:types: no errorsnpx vitest run(afternpm run build): 137 files passed, 2024 passed, 3 skippednpm run build && npm run build --workspace=packages/create-loushy-agent: passnpm run docs:verify-snippets -- --skip-build: all 91 snippets type-checknpm run docs:llms:check: passnpm run test:coverage: pass (137 files, 2024 passed); one earlier run had 1 failing test that passed on re-run, not identifiednpm run fallow: 0 above threshold, exit 0🤖 Generated with Claude Code
https://claude.ai/code/session_016bY29ibQgv3MDdjAbUT4YR
Generated by Claude Code