GeezerVison is showing github.com — Lifecycle: reload/teardown safety for instances (bounded drains, interrupt-safe claims, reusable-reload wedge fix) · Issue #49977 · anomalyco/opencode
Lifecycle: reload/teardown safety for instances (bounded drains, interrupt-safe claims, reusable-reload wedge fix) #49977DescriptionContext
Part of the fork hardening series proposed in #48638 (branch session-diff-events). Tracker: #49565.
Problem
Instance lifecycle hazards: interrupt-unsafe claims, unbounded teardown waits, reload-ordering violations, stale teardown tracking, and a reusable-reload wedge where a never-settling disposer left reload/provide/load dead (total directory wedge). Also tombstone/lease correctness for directory reuse.
Change set (commit list, incl. instance halves of mixed commits)
Validation
- Base total-wedge probe (reload/provide/load all time-out) -> head fully live (provide ~1 ms, load ~0 ms); ordering guarantees preserved; instance suite 27/0.
Linked: PR #48638 · tracker #49565 · sibling tracking issues listed in a follow-up comment. ActivityAceRothstein71 commented on Sep 19, 2026 Cross-links: sibling tracking issues #49974 (perf/runtime), #49975 (shell classifier H-L), #49976 (shell classifier M-P), #49977 (instance lifecycle), #49978 (MCP/schema), #49979 (server/SSE + event/db), #49980 (updater tooling). Integration PR: #48638. Original tracker: #49565. opencodejr commented on Oct 28, 2026 Thanks for writing this up and for the work on the hardening branch.
Right now this issue reads as a tracking entry for commits on your fork, so we can't verify or reproduce the problem from it. Could you describe, briefly and in your own words, the user-facing bug you hit?
- The OpenCode version (
opencode --version, e.g. 2.2.0) and your OS / install method
- What you did: the steps, commands or setup (e.g. how many sessions or directories, what triggered a reload or dispose) that lead to an instance getting stuck
- What you expected and what actually happened, such as the hang or timeout you saw, with any logs or error output
A minimal reproduction against a released v2 build would help most. Fork commit hashes on their own can't be checked against a release.
You can either reply here with the details or edit the issue. If you edit it, please also leave a comment saying you've updated it so we know you're done.
These issues are related, ordered by likelihood:
- Worker-thread saturation under concurrent sessions: permission matching, turn-diff recomputation, event fanout, snapshot churn #49565: the original worker-thread saturation tracker this series came from (closed)
- fix: harden session diffs, snapshots, and write paths; cut worker-thread stalls under parallel agents #48638: the integration PR containing these commits (closed)
- Perf: cut worker-thread saturation/CPU from session diffs, snapshots, SQLite contention, and event fanout (PR #48638 series) #49974, MCP/schema: validation hardening + anchor-form $ref retention (PR #48638 series) #49978, Server/SSE + event/db hardening (audit-v7 and wave B findings) #49979: sibling tracking issues from the same series (perf/runtime, MCP/schema, server/SSE + event/db)
opencodejr commented on Oct 31, 2026 Closing this for now, since we haven't heard back. We asked for the OpenCode version, the steps that lead to an instance getting stuck (reload/provide/load timing out), and what you expected versus what happened. Without those, we can't reproduce the problem from the fork's commit list alone.
If you can reproduce it on a released v2 build, please open a new issue using the Bug Report template, with the version, your setup, the steps and any logs, and link back to this one. Thanks again for the time you put into the hardening work.
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|