fix(reflection): detect Plan mode in user-role system-reminder tags#113
Open
fix(reflection): detect Plan mode in user-role system-reminder tags#113
Conversation
) OpenCode injects Plan mode as <system-reminder> blocks inside user-role message parts, not system/developer messages. The old isPlanMode() only checked system messages and the last text part of the last user message, so it never detected Plan mode in practice. Rewrote isPlanMode() with three detection strategies: 1. Scan ALL messages' text parts for <system-reminder> containing 'plan mode' or 'READ-ONLY phase' 2. Check system/developer messages for plan mode keywords 3. Check all text parts of the last non-reflection user message Added 25+ unit tests covering all detection paths including the build-switch case (plan->build correctly returns false). Closes #74
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
isPlanMode()never detected it<system-reminder>blocks inside user-role message parts, not system/developer messagesisPlanMode()with 3 detection strategies covering all injection patternsChanges
reflection-3.ts: RewroteisPlanMode(), exported itreflection-3.test-helpers.ts: Added test-safe duplicate ofisPlanMode()test/reflection-3.unit.test.ts: Added comprehensiveisPlanModetest suiteTesting