Follow-up from PR #20 review (CodeRabbit comment on compaction heuristics): #20 (comment)
In lib/request/request-transformer.ts, filterOpenCodeSystemPrompts currently relies on text heuristics (regexes over the content) to identify OpenCode auto-compaction prompts and sanitize/remove the summary-file instructions.
The review suggested hardening this by:
- Tagging OpenCode compaction prompts with an explicit metadata flag (e.g., item.meta?.opencodeCompaction === true or item.metadata?.source === 'opencode-compaction').
- Preferring that metadata flag over the regex-based detection when present, falling back to heuristics only when metadata is absent.
This issue tracks designing and wiring that explicit metadata marker so we can reduce the risk of future false positives while keeping current behavior intact for untagged prompts.
We kept the existing heuristic-only behavior in PR #20 and are deferring this improvement to a follow-up.
Follow-up from PR #20 review (CodeRabbit comment on compaction heuristics): #20 (comment)
In lib/request/request-transformer.ts, filterOpenCodeSystemPrompts currently relies on text heuristics (regexes over the content) to identify OpenCode auto-compaction prompts and sanitize/remove the summary-file instructions.
The review suggested hardening this by:
This issue tracks designing and wiring that explicit metadata marker so we can reduce the risk of future false positives while keeping current behavior intact for untagged prompts.
We kept the existing heuristic-only behavior in PR #20 and are deferring this improvement to a follow-up.