GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — [FEATURE]: Improve compaction prompt to preserve critical context details · Issue #16512 · anomalyco/opencode Closed as not planned Closed as not planned Copy link DescriptionProblemI use GitHub Copilot as my provider. Disabling auto-compaction is not an option — Copilot enforces a hard token limit and the session crashes with context overflow if compaction is off. So I'm forced to rely on it. The compaction prompt in
The result: after compaction the AI repeats questions already answered, forgets user constraints, and loses investigation state. Often worse than starting a fresh session. Compaction threshold (related)Additionally, for a 200k context model with Proposed solutionMake the default compaction prompt more aggressive about preserving specifics. At minimum, instruct the compaction LLM to:
WorkaroundThe // ~/.config/opencode/plugins/better-compaction.ts export const BetterCompactionPlugin = async (ctx) => { return { "experimental.session.compacting": async (input, output) => { output.prompt = `You are compacting a conversation to allow it to continue in a new context window. Your job is to produce a continuation prompt that preserves ALL information needed to seamlessly resume the work. CRITICAL RULES: 1. NEVER generalize or summarize away specific details. Keep exact names, paths, values, error messages, flag names, config keys, URLs, and version numbers. 2. If the user pasted external content (conversation logs, error output, code snippets, config files), reproduce the KEY PARTS verbatim. 3. Preserve ALL user-stated constraints, preferences, and instructions. 4. Preserve the investigation/debugging state: what hypotheses were tested, what was ruled out with what evidence. 5. Preserve emotional context and communication style preferences. Use this template: --- ## Goal [Specific goal(s)] ## Instructions - [User instructions, behavioral constraints, communication preferences] ## Discoveries [Exact technical details: config values, paths, flag names, versions, what was tried and what happened] ## User-Pasted Content [Verbatim key parts of any content the user pasted] ## Accomplished ### ✅ Completed [Specific completed work] ### ❌ Not Solved [Unsolved items with investigation state] ### ⏭️ Next Steps [Planned next actions] ## Relevant files / directories [Files read/modified/created, with key external references] ---` }, } } System info
Related issues
Reacted by Henrik Lia, SaladDay, Ryu, vii33, Helliton Soares Mesquita and Kael Activity
MetadataMetadataAssigneesLabelsNo labels TypeProjectsMilestoneRelationshipsDevelopmentIssue actions |
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |