Add plan-mode pending guard to enforce enter_plan_mode after reading plan_sop#459
Open
HamsteRider-m wants to merge 1 commit into
Open
Add plan-mode pending guard to enforce enter_plan_mode after reading plan_sop#459HamsteRider-m wants to merge 1 commit into
HamsteRider-m wants to merge 1 commit into
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.
What
When
plan_sop.mdis read, a pending plan-mode flag is now set. If the agent does not callhandler.enter_plan_mode(...)in the same turn, the turn-end callback injects a hard guard that blocks normal execution until plan mode is properly entered. Onceenter_plan_mode()succeeds, the pending state is cleared and all existing in-plan-mode checks take over.This prevents the agent from reading the SOP, extracting its points, and then continuing ordinary execution without ever creating a plan file or entering plan mode.
Changes
ga.py: setplan_mode_pendingon plan SOP read; inject guard inturn_end_callback()when pending but not yet in plan mode; clear pending onenter_plan_mode().test_plan_mode_guard.py: three test cases covering pending flag set, guard interception, and pending cleared on entry.Verification
Closes #458