Fix goal lifecycle changes during live execution - #65
Merged
Merged
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.
A host can create or revise a goal while a conversation turn is already running. The streaming loop previously initialized bookkeeping only at execute entry; a later goal could crash on missing
progress_evidenceafter the answer and evaluator had succeeded. It could also apply a stale evaluator result to a replacement goal.Normalize goals when consumed, defer completion when a goal appears mid-turn, and verify goal identity/revision after evaluator, judge, and summary awaits. A changed goal ends the current evaluation and preserves its successor for the next explicit execution. Cancellation and pause stop continuation without replaying work. Original four-field goals remain supported; no app-cli dependency is added.
Validation: 436 passed, 3 skipped in the full streaming suite, including 31 new lifecycle cases. The skips require the optional context-simple module, absent locally. Also passed 8 companion Unified RuntimeControls + real loop-live integration cases for Work and Anchors overlay plans using synthetic providers.
git diff --checkpassed.Scope review: loop-live inherits this engine; current loop-basic and loop-events have no shared goal-state implementation and are unchanged. This PR does not modify saved sessions or claim installed-host adoption.