GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Experimental compaction improvements (prefix preservation + prompt customization) · Issue #11497 · anomalyco/opencode

Experimental compaction improvements (prefix preservation + prompt customization) #11497

New issue
Copy link
New issue
Copy link
Closed
Closed
Experimental compaction improvements (prefix preservation + prompt customization)#11497
Copy link
Assignees
thdxr

Description

@dixoxib
dixoxib
opened on Jan 31, 2026
Issue body actions

Problem

When sessions are compacted, the system currently switches to a generic "compaction" agent, losing:

  1. Original agent's tool definitions and system prompts
  2. Specialized instructions or model-specific optimizations
    → 3. Prefix cache benefits for providers that implement caching (Claude, GPT-4, etc.)

Proposed Solution

Add experimental feature flags for:

  1. OPENCODE_EXPERIMENTAL_COMPACTION_PRESERVE_PREFIX - Preserve original agent's prefix cache during compaction
  2. additionally OPENCODE_EXPERIMENTAL_COMPACTION_PROMPT - Allow customizable compaction prompts

Benefits

  • Performance: Cache hits for providers with prefix caching reduce token usage costs and latency up to 90%
  • Flexibility: Users can customize compaction prompts for their workflow
  • Gradual rollout: Experimental flags allow testing before stabilization

Testing

export OPENCODE_EXPERIMENTAL_COMPACTION_PRESERVE_PREFIX=true
export OPENCODE_EXPERIMENTAL_COMPACTION_PROMPT="Custom prompt if needed"

Activity

  1. github-actions
    assigned
    thdxr
    on Jan 31, 2026
  2. github-actions commented on Jan 31, 2026

    @github-actions
    github-actionsBot
    on Jan 31, 2026 – with GitHub Actions
    Contributor
    More actions

    This issue might be a duplicate of existing issues. Please check:

    • Auto-compaction causes the subagent to lose its original context, possibly the system prompt as well #6535: Subagent loses original context and system prompt during compaction
    • Soft compaction / AI global workspace metabolism #3032: Soft compaction / AI global workspace metabolism - proposes alternative compaction strategy to preserve context
    • [FEATURE] Sliding window context management for long-running sessions #4659: Sliding window context management for long-running sessions - addresses context preservation across compactions
    • [FEATURE]: Add systemPrompt option to SDK like Claude Agent SDK #7351: Add systemPrompt option to SDK - relates to the customizable compaction prompt aspect

    Feel free to ignore if none of these address your specific case.

  3. github-actions commented on Apr 3, 2026

    @github-actions
    github-actionsBot
    on Apr 3, 2026 – with GitHub Actions
    Contributor
    More actions

    To stay organized issues are automatically closed after 90 days of no activity. If the issue is still relevant please open a new one.

  4. github-actions
    closed this as completedon Apr 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @thdxr
    thdxr

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue 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.