fix: filter system-reminder messages in OpenCode transcript parser#671
Open
mvanhorn wants to merge 1 commit intoentireio:mainfrom
Open
fix: filter system-reminder messages in OpenCode transcript parser#671mvanhorn wants to merge 1 commit intoentireio:mainfrom
mvanhorn wants to merge 1 commit intoentireio:mainfrom
Conversation
Messages sent with role "user" that consist entirely of <system-reminder>...</system-reminder> tags (injected by oh-my-opencode for multi-agent orchestration) are now excluded from ExtractAllUserPrompts. Mixed messages have system-reminder sections stripped, preserving the actual user content. Closes entireio#564 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
5 tasks
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
Fixes #564
Filters out
<system-reminder>messages that are injected by tools like oh-my-opencode withuserrole. These messages were incorrectly counted as user prompts in attribution and checkpoint data.Changes
cmd/entire/cli/agent/opencode/transcript.go- AddedisSystemReminderOnly()andstripSystemReminders()functions; updatedExtractAllUserPrompts()to skip or strip system-reminder contentcmd/entire/cli/agent/opencode/transcript_test.go- Added 6 test functions covering pure system-reminder messages, mixed content, and whitespace handlingApproach
Content-based heuristic: messages entirely wrapped in
<system-reminder>...</system-reminder>tags are skipped. Mixed messages have the reminder tags stripped. This is the best approach given that OpenCode doesn't exposex-initiatormetadata.Test plan
gofmtandgo vetcleanThis contribution was developed with AI assistance (Claude Code).