Repository navigation
Conversation
The Pi harness stopped only on the gateway's refusal marker, so a skill that emitted [ABORT] <reason> ran on and could end on the success outro. It now ends the run with the skill's reason for programs that declare abort cases, like the Anthropic harness, and both share one parser. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every Pi run now ends on a skill's [ABORT] marker, whether or not the program declares abort cases; the sequence picks the matched copy or its generic fallback. Orchestrator task runs end on it too, with the same remark and complete_task boundaries as the gateway refusal. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Author
|
Note 🤖 Claude Opus 5.5 responding on behalf of Michael Decisions made during the build and review of this PR:
|
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.
Problem
The Pi harness, the Wizard's default agent harness, stops a run only on the AI gateway's refusal marker (
[posthog:abort]). When a skill hits a stop condition and writes[ABORT] <reason>, Pi carries on. The run can end on the success outro and tell the user setup worked when it did not. This hits every Pi program that relies on[ABORT]: revenue analytics, MCP analytics, self-driving, replay vision,wizard skill <name>and the transactional email program in #1487.Impact
Pays into Grow Workflows through activation, measured in the team's internal Workflows growth review. In scope: the Wizard's transactional email setup (#1487), which reports a stop such as "the API is not enabled for this project" through
[ABORT]. Expected move: small, up. A failed setup now says it failed and names the next step, so users don't walk away from a false "set up". Run cost: n/a.Merge Danger
Note
🔵 Merge risk: low · two-way door (merge-risk rubric)
[ABORT] <reason>now stops the run with the error outro. A run whose agent writes the marker by mistake stops too. No shared prompt mentions the marker; only skills and thewizard_askfallback do.complete_taskexemptions. A revert restores the old behavior with nothing left behind.Changes
skillAbortReasoninsrc/agent/signals.tsparses[ABORT] <reason>. Both harnesses use it, so Pi and Anthropic read the marker the same way.index.ts) and orchestrator task runs (task.ts). The first marker, a skill's[ABORT]or the gateway's refusal, is latched with its source and ends the run through the existing cancellation. The harness skips the continue nudges and the remark, and returnsabortwith the reason.complete_taskreported.agent abortedtags only a gateway refusal withsource: 'gateway_policy'.Test plan
piBackend.runandrunPiTaskinsrc/agent/runner/harness/pi/__tests__/structured-run.test.ts, the harness's public entries, with the Pi session faked at the SDK boundary. Each case runs in both linear and task mode:[ABORT] Could not find a Stripe integrationreturnsabortwith that reason, sends no nudge, never stops the spinner on the success message, captures noagent completed, and tags nogateway_policysource. The program declares no abort cases. Before the fix, the run hung waiting for a stop that never came.complete_taskleaves the task successful.abortresult turning into the matched error outro, is covered bysrc/agent/__tests__/run-agent-standalone.test.ts.pnpm typecheckpasses, lint has no errors, andpnpm testpasses (3809 tests). An earlier full run had a 5-second timeout flake insrc/cli/__tests__/cli.test.ts(--region), a file this PR does not touch.--cirun, so a real Pi run against a skill that aborts did not run. What stays unknown is the real Pi SDK resolvingprompt()after the cancellation. The gateway refusal path already relies on that same cancellation.Decisions
[ABORT]end runs for programs without abort cases?[ABORT]?complete_taskexemptionsInvolvement: 0 grilling rounds, 1 design pass (GPT-6.1 Sol), 1 review round and 1 final read (Codex
adversarial-review, GPT-6.1 Sol), live-run proof not captured (gap accepted).LLM context
Side fix from the Resend parity map, built test-first with Claude Code (Opus 5.5).
🤖 Generated with Claude Code