fix(agent): define lifecycle error outcomes - #180
Open
xz-dev wants to merge 5 commits into
Open
Conversation
xz-dev
added a commit
to xz-dev/pi-subagents-tintinweb
that referenced
this pull request
Jul 27, 2026
xz-dev
added a commit
to xz-dev/pi-subagents-tintinweb
that referenced
this pull request
Jul 27, 2026
xz-dev
added a commit
to xz-dev/pi-subagents-tintinweb
that referenced
this pull request
Jul 27, 2026
xz-dev
added a commit
to xz-dev/pi-subagents-tintinweb
that referenced
this pull request
Jul 29, 2026
xz-dev
force-pushed
the
fix/agent-startup-error-status
branch
from
July 31, 2026 04:34
3d22fcf to
a4fd0cd
Compare
xz-dev
added a commit
to xz-dev/pi-subagents-tintinweb
that referenced
this pull request
Jul 31, 2026
xz-dev
added a commit
to xz-dev/pi-subagents-tintinweb
that referenced
this pull request
Jul 31, 2026
Rethrow synchronous foreground and background startup failures so Pi records failed Agent tool calls with isError set instead of treating diagnostic text as a success. Add print-mode regression coverage for both execution paths. Fixes tintinweb#179
Separate pre-acceptance invocation failures from failures that occur after an Agent session has been accepted. Rejected calls now use Pi tool errors without retaining an Agent ID, while accepted provider, runtime, max-turn, and stop outcomes remain resumable lifecycle results with stable model-visible metadata. Sanitize public error causes, preserve truthful background notifications and partial output, and honor cancellation before child prompts or tools can run. Refs: tintinweb#179
Report fail-closed fallback and top-level model-scope refusals as Pi tool errors before any Agent is accepted. Rebuild stopped outcomes after a late session arrives so same-ID recovery remains truthful. Refs: tintinweb#179
xz-dev
force-pushed
the
fix/agent-startup-error-status
branch
from
August 2, 2026 12:45
3b0000f to
984e9f9
Compare
Contributor
Author
|
Added a follow-up commit for #196 because the structured worktree failure taxonomy and recovery guidance are introduced by this PR. The new commit:
Verification: lint, typecheck, build, 874 passed / 5 skipped, E2E passed; independent review C0/I0/M0. |
Classify Git prerequisites under a stable locale with structural checks that keep corrupt metadata fail-closed. Document that worktree isolation uses the parent session cwd across every Agent surface. Fixes: tintinweb#196
xz-dev
force-pushed
the
fix/agent-startup-error-status
branch
from
August 2, 2026 18:03
be959d9 to
c135e76
Compare
xz-dev
added a commit
to xz-dev/pi-subagents-tintinweb
that referenced
this pull request
Aug 2, 2026
xz-dev
added a commit
to xz-dev/pi-subagents-tintinweb
that referenced
this pull request
Aug 4, 2026
xz-dev
added a commit
to xz-dev/pi-subagents-tintinweb
that referenced
this pull request
Aug 4, 2026
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.
Summary
Agentinvocations from failures after an Agent session has been acceptedContract
isError: true)Accepted results include a stable model-visible block such as:
The same fields are mirrored in structured result/notification details for UI and extension consumers.
Details
isolationand forbid unchanged retry or Git initialization solely for Agent.git worktree addinfrastructure failures instead require fixing Git and retrying with isolation; they never recommend silently falling back to the shared working tree.resume_same_agentis emitted only when an actual session exists.No outputor as fabricated partial output.subagent_typefallback behavior is preserved.Verification
npm run lintnpm run typechecknpm run test -- --maxWorkers=1— 793 passed, 5 skippednpm run buildnpm run test:e2e -- --maxWorkers=1— 55 passed, 5 skippedisError: true, confirmed non-Git/unborn-HEAD recovery, and infrastructure-failure isolation-preservation regressionsFixes #179