You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix: plugin model without time crashes Model.snapshot and shows false "Session location unavailable" #54943
A plugin that registers a model without time crashes model loading for the whole directory. The TUI then shows "Session location unavailable — Choose another directory to continue this session", although the directory exists. opencode run fails with:
Error: undefined is not an object (evaluating 'rH.time.released')
The log shows it throws in the sort inside Model.snapshot (called from Model.available). editor.add accepts the incomplete model without validation, so the error only appears later and is misreported as a location problem. Building the model with Model.Info.default(...) avoids it.
Expected: reject or skip the invalid model at editor.add (or log which plugin/model is bad) instead of breaking every session in that directory.
Plugins
A local test plugin (repro below)
OpenCode version
2.0.27
Steps to reproduce
In any project, create .opencode/plugins/bad-model.ts:
Thanks for the clear repro, I could reproduce this on 2.0.27.
With your .opencode/plugins/bad-model.ts in a project, opencode run "hi" fails right away with undefined is not an object (evaluating 'rH.time.released'). In the TUI, model loading for the directory breaks: after sending a message, no models are available and the "Connect an integration" dialog opens. The same setup without the plugin works normally. My run only opened a new session, so I didn't see the "Session location unavailable" modal itself; it likely shows when an existing session is reopened, as you describe.
The TUI problem still happens on the latest dev (a22754f), and the time.released sort in Model.snapshot is unchanged there. The recording, screenshot and script below show the TUI side. Until this is handled, building the model with Model.Info.default(...) as you noted avoids it.
Related but different causes of the same modal: #49352, #43415.
Run it with opencode-drive: opencode-drive run ./drive.ts. It drives opencode from your PATH; set OC_DEV to the path of an OpenCode checkout to run that from source instead.
Activity
opencode-agent commentedon Oct 12, 2026
Thanks for the clear repro, I could reproduce this on 2.0.27.
With your
.opencode/plugins/bad-model.tsin a project,opencode run "hi"fails right away withundefined is not an object (evaluating 'rH.time.released'). In the TUI, model loading for the directory breaks: after sending a message, no models are available and the "Connect an integration" dialog opens. The same setup without the plugin works normally. My run only opened a new session, so I didn't see the "Session location unavailable" modal itself; it likely shows when an existing session is reopened, as you describe.The TUI problem still happens on the latest
dev(a22754f), and thetime.releasedsort inModel.snapshotis unchanged there. The recording, screenshot and script below show the TUI side. Until this is handled, building the model withModel.Info.default(...)as you noted avoids it.Related but different causes of the same modal: #49352, #43415.
recording.mp4
Reproduction script (drive.ts)
Run it with opencode-drive:
opencode-drive run ./drive.ts. It drivesopencodefrom yourPATH; setOC_DEVto the path of an OpenCode checkout to run that from source instead.