fix(coding-agent): preserve goals and dedupe stream notices - #733
Merged
Conversation
Let system-owned extensions abort without flowing through the user interrupt path. TTSR now preserves active goals and monitor-backed recovery while explicit user aborts still block.
Use the shared rule-activation entry as the only user-visible TTSR record, remove the transient warning, preserve the hidden model nudge, and retain read compatibility for legacy persisted entries.
Keep monitor-delayed Goal waits visible through their durable cache-warm entries and countdown status without repeating scheduled or resumed notices in the transcript area.
Use the stable activation custom type literal in the oversized race fixture so the behavior update adds no pure LOC to that file.
Assert durable cache-warm entries and the scheduling event across direct and RPC surfaces without expecting the removed transient notify request.
Delete the unused transient notice builders and their prose-only tests now that durable cache-warm entries own scheduled and resumed presentation.
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
agent_settled, regardless of handler orderRoot cause
ExtensionContext.abort()previously lost its initiator and always entered the user-abort path, so Goal persisted internal TTSR interruptions asblocked("user interrupted the turn").The first provenance fix exposed adjacent lifecycle gaps:
agent_endhandling could lose the race to a corrective follow-up;agent_endand was not revalidated after late user ownership;Changes
"user" | "system"provenance to extension aborts and forward it throughExtensionRunneragent_enddeliverysession_abortbeforeagent_settledwhen a late user join must cancel work an earlier handler already admittedagent_settledhandler dispatchsystemRecoverycontinuation for a terminal system error with no retry or monitor, then launch it from the settled idle pathsystemRecovery/goal resumestarts a fresh continuationPursuing goalrule-activationentry and remove private/transient duplicatesVerification
npm run check— PASSnpm run build— PASSnpm test— PASSThird-review RED/GREEN coverage proves:
agent_endboundary is delivered before settlementagent_settledhandler orders cancel remediation/goal resumeworks after canceled deferred recoveryGoal blockedReal-surface QA
Evidence:
local-ignore/qa-evidence/20260805-abort-provenance/local-ignore/qa-evidence/20260805-ttsr-widget-only/local-ignore/qa-evidence/20260805-goal-widget-ownership/local-ignore/qa-evidence/20260805-ttsr-goal-widget-regression/local-ignore/qa-evidence/20260805-final-sweep/local-ignore/qa-evidence/20260806-ttsr-goal-monitor/local-ignore/qa-evidence/20260806-ttsr-goal-monitor-final/local-ignore/qa-evidence/20260806-abort-provenance/local-ignore/qa-evidence/20260806-ttsr-goal-settlement-final/local-ignore/qa-evidence/20260806-ttsr-goal-latch-final/Risk
The extension API addition is source-compatible because the provenance argument is optional and defaults to user semantics. Provider-originated terminal failures without system provenance still block Goal. Explicit user interruption remains a durable intentional block. Legacy TTSR private entries remain readable.