Conversation
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.
Change
A follow-up user turn can call
update_goal(status="complete")after a Goal has already completed, or while a Goal is still active. Ordinary user turns do not carry a Goal execution binding. Previously, the collector classified this missing binding asstale, and the tool incorrectly reported that the objective had changed and forcibly ended the turn. The model could not recover from the rejected call and continue handling the user's clarification.This change separates an unbound turn from an invalidated Goal turn:
not_a_goal_turnwhen the current turn has no Goal binding.update_goalreturns a tool error with the current Goal snapshot and recovery guidance, without settingterminateor accepting a status proposal.The change is limited to the collection result type, collector classification, and tool error handling. Existing tests cover unbound turns with active/completed Goals, unchanged durable state, and termination after a Goal replacement. No test files were added. Goal admission, scheduling, accounting, and verifier settlement are unchanged. This fixes recovery from a mistaken tool call; it does not establish that a model's completion claim is correct.
Validation
pnpm exec vitest run --config vitest.oss.config.mjs \ packages/agent-modules/goal/test/unit/thread-goal/tool-impls.test.ts \ packages/local-runtime/test/unit/thread-goal/host-integration-settlement.test.ts \ packages/local-runtime/test/unit/thread-goal/host-integration-explicit-reset-rearm.test.tspnpm verify, full profile on clean commit389c7ca: all 15 applicable gates, including source export, release tooling, lint, typecheck, build/artifacts, capabilities (172 files / 4,586 passed, 14 skipped), status contract, CLI smoke, offline BYOK, permissions, and macOS sandbox. Windows and release-archive profiles are not applicable to this local run.git diff --check; the built CLI chunk contains the new recoverable rejection.perf:full, because the change affects whether a Goal tool result ends a turn. The latest-head/base CI result remains required before merge.Publication and contribution checks
Maintainer handoff
Publication scope or license changes: none.
Shared-source port: pending.
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.