fix: filter system-reminder messages in OpenCode transcript parser#671
Merged
peyton-alt merged 2 commits intoentireio:mainfrom Mar 21, 2026
Merged
Conversation
5 tasks
a64ab90 to
e9daf9a
Compare
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>
Rewrite isSystemReminderOnly to delegate to stripSystemReminders, fixing a false positive where content like <system-reminder>a</system-reminder>real<system-reminder>b</system-reminder> was incorrectly classified as system-reminder-only (HasPrefix+HasSuffix matched but real user content existed between the blocks). - Guard the empty-string edge case (empty is not a system-reminder) - Consolidate two separate const declarations into one block - Add test case covering the multi-block false-positive scenario Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
e9daf9a to
b7903c9
Compare
evisdren
approved these changes
Mar 21, 2026
Contributor
Author
|
Thanks for the review! |
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).