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 — MCP server connection lost after context compaction — tools unavailable until new session · Issue #23556 · anomalyco/opencode

MCP server connection lost after context compaction — tools unavailable until new session #23556

New issue
Copy link
New issue
Copy link
Closed as not planned
Closed as not planned
MCP server connection lost after context compaction — tools unavailable until new session#23556
Copy link
Assignees
kitlangton

Description

@ramsyman
ramsyman
opened on Apr 20, 2026
Issue body actions

Description

After context compaction occurs, MCP server tools become completely unavailable for the rest of the session. The only workaround is to start a new session.

This was also reported in NeuralNomadsAI/CodeNomad#344, where the CodeNomad maintainer confirmed this is an OpenCode-level issue.

Steps to Reproduce

  1. Start a session with MCP servers configured
  2. Use MCP tools extensively (large tool outputs, many calls)
  3. Wait for or trigger context compaction (~95% context window)
  4. Attempt to call any MCP tool after compaction

Expected Behavior

MCP server connections are re-established after compaction. Tools remain available throughout the session.

Actual Behavior

All MCP tool calls fail after compaction. The tools are simply gone — no error, no reconnect attempt. A full new session is required to restore MCP functionality.

Impact

Any workflow relying on MCP tools (e.g. database tools, agent registries, custom servers) is silently broken after compaction. This is especially problematic for long-running sessions where compaction is expected.

Environment

  • OpenCode TUI (darwin)
  • MCP servers configured via config
  • Model: claude-sonnet-4-6

Related

  • [Bug]: MCP tools unavailable to agent after context compaction NeuralNomadsAI/CodeNomad#344

Activity

  1. github-actions
    assigned
    rekram1-node
    on Apr 20, 2026
  2. github-actions
    added
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on Apr 20, 2026
  3. github-actions commented on Apr 20, 2026

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

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

    • Bug: MCP tools permanently lost mid-session after single transient listTools() failure — no retry, no reconnect #17099: MCP tools permanently lost mid-session after a transient listTools() failure — same symptom (tools gone, restart required), possibly the same root cause where context compaction triggers a listTools() error path that permanently evicts the MCP client
    • [FEATURE]: Re-announce tools after context compaction #20290: Feature request to re-announce tools after context compaction — directly addresses tool unavailability after compaction from the model-awareness side

    It may be worth reviewing those issues to see if they overlap with what you're experiencing.

  4. thdxr
    removed
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on May 3, 2026
  5. thdxr
    assigned
    kitlangton
    and unassigned
    rekram1-node
    on May 3, 2026
  6. rekram1-node commented on Jun 24, 2026

    @rekram1-node
    rekram1-node
    on Jun 24, 2026
    Member
    More actions

    I don't think this is accurate nor can I reproduce.

  7. rekram1-node
    closed this as not plannedon Jun 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @kitlangton
    kitlangton

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.