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 — V2: pending form and permission reads bootstrap idle session locations · Issue #53918 · anomalyco/opencode

V2: pending form and permission reads bootstrap idle session locations #53918

New issue
Copy link
New issue
Copy link
Open
Open
V2: pending form and permission reads bootstrap idle session locations#53918
Copy link
Assignees
kitlangton
Labels
reproduced

Description

@mlimarenko
mlimarenko
opened on Oct 8, 2026
Issue body actions

Summary

Listing pending forms or permissions for an idle session acquires its full Location service graph. A client restoring session state can therefore create otherwise unused locations, watchers, and MCP-related services just to receive an empty list.

Environment

  • opencode version: Desktop fork based on 2.0.24; the affected paths are also present in upstream v2 at 216c31174.
  • OS: Linux 7.2.8+deb14-amd64, x64.
  • Terminal: Desktop; diagnostic shell reports xterm-256color.
  • Shell: /bin/zsh.
  • Install/channel: locally built, packaged Desktop using the production/latest channel.
  • Active plugins: local provider/quota and tool-routing plugins are installed. The regression should be reproduced in an isolated server test without those plugins, rather than attributed to them.

Reproduction

  1. Create a session whose Location is not currently loaded.
  2. Request GET /api/session/:sessionID/form or GET /api/session/:sessionID/permission.
  3. Inspect the Location service map or count Location resource acquisitions.

The form-list endpoint provides FormLocationMiddleware, which acquires the session's instance. The permission-list handler explicitly calls instances.provide(session).

Expected Behavior

An existing session in a cold Location has no in-memory pending forms or permissions. Return an empty list without constructing the Location graph. For a warm Location, retain its existing scoped resources while reading and return its actual pending prompts. Preserve unknown-session errors and the existing sessionID=global form-placement behavior.

Actual Behavior

Read-only polling constructs the full Location graph before returning the list, including Location watchers and MCP-related services.

Additional Context

An incident on the workstation included earlyoom sending SIGTERM to the Desktop renderer twice. The preceding application process group recorded a 24 GB memory peak and a 16.5 GB swap peak; those are whole-group numbers, not a measurement of the renderer alone. After a server restart, its log showed 87 distinct Location boots and 18 MCP session-capacity failures.

The diagnostic archive contained form/permission reads for 54 sessions spanning 25 of those booted Locations. These observations motivate investigation, but do not prove that this endpoint defect alone caused the entire memory peak.

Related: #51003 and #53046 concern MCP connection lifecycle; #53049 and #53050 concern client request scheduling. This report concerns unnecessary Location acquisition by pending-prompt reads.

Activity

  1. github-actions
    assigned
    kitlangton
    on Oct 8, 2026
  2. opencode-agent commented on Oct 8, 2026

    @opencode-agent
    opencode-agentBot
    on Oct 8, 2026 – with OpenCode Agent
    Contributor
    More actions

    Thanks for the detailed report. I reproduced this on 2.0.24 and it still happens on the latest v2 (0621ea9).

    Steps:

    1. Start opencode serve --print-logs and create a session with POST /api/session and a project directory. Creating it does not start the location.
    2. Restart the server so the session's location is cold.
    3. GET /api/session/:id/permission returns {"data":[]}, and the server logs location services booted for the session's directory.
    4. After another restart, GET /api/session/:id/form does the same: an empty list, plus a full location boot.

    The code is the same on both: session.permission.list calls instances.provide(session), and FormLocationMiddleware does the same for real session IDs. Related: #51003 (MCP stdio servers started once per loaded directory, which makes these extra boots costly) and #53427 (evicting idle directory instances).

  3. opencode-agent
    added
    reproduced
    on Oct 8, 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

reproduced

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.