Repository navigation
Inbox: OpenCode's model list reads whole and in time; a failed start with a model says why - #4194
Merged
Merged
Conversation
…h a model fails OpenCode's list reads (models, agents, default) get 30 seconds each and run one after another; the window's timeout words name that limit. Each read's output goes to a file in the Inbox's launch folder, read after OpenCode exits and then removed, so a long list is never cut short. When OpenCode makes no session, the failed start says OpenCode's own reason, on one line, with the home folder as ~ and credential-like values hidden.
An Inbox that quits or restarts during an OpenCode list read leaves the read's stdout file in its launch folder. The host's first list read now removes such files: only the exact name listRead makes, of a pid that is not this process and not running, older than 5 minutes; a link is removed itself, never followed; every error is ignored.
backnotprop
marked this pull request as ready for review
November 29, 2026 03:28
DuongCoder04
pushed a commit
to DuongCoder04/plannotator
that referenced
this pull request
Nov 29, 2026
Move the marker from f00a501 to b74c769 and list the additive ./inbox-* changes core 0.25.37 carries from backnotprop#4161, backnotprop#4172, backnotprop#4194, backnotprop#3595, backnotprop#4186, backnotprop#3676 and backnotprop#3598.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Starting a new OpenCode agent with a model picked: three weaknesses fixed.
The model list may never load. Each list read (models, agents, default) is a whole OpenCode start with the person's plugins, and the three ran at once with 5 seconds each. They now get 30 seconds each and run one after another (models, then agents, then the default; no agent read when the models could not be read). Nothing waits on them longer than before: compose and a Send still wait 250 ms at most, and a slow read still shows "Reading OpenCode's models…". The timeout line now names the real limit: "Couldn't read OpenCode's models: it took longer than 30 seconds." (the number comes from the same constant the server reads with). Claude Code, Pi and Codex keep their 5 s.
A long list can arrive cut off. A CLI that writes a large list to a pipe and exits at once can lose the end of it; the Inbox then could not read the list and showed only Default. Each OpenCode list read now writes its output to a file of its own in the Inbox's launch folder (0600), read after OpenCode exits and then removed (the 16 Mi cap stays; a pipe as before if the file can't be made).
A start with a model that fails now says why. When OpenCode makes no session, the failed line reads "OpenCode didn't start. OpenCode did not make a session: <OpenCode's reason>. Your message is kept." The reason is OpenCode's error message (or the request's own error, such as a time-out), on one line, the home folder shown as ~, the server's password and credential-like login values hidden, 200 characters at most. With no reason, the line is as before.
Not in this PR: telling the person when OpenCode starts on a different model than the one picked (no existing sentence fits; needs words).
Tests:
packages/server/inbox-launch-opencode-choices.test.ts(a 6 s read is read, the three reads never overlap, a ~3.5 MB list written just beforeprocess.exit(0)is read whole, a run's output file is removed, a pipe when it can't be made),packages/server/inbox-launch-opencode.test.ts(the refusal's reason, its bound, plain-text and empty answers).