3 Commits
Author SHA1 Message Date
Aleksander DygońandClaude Opus 5.5 190b012cfe Start OpenCode when its plugins need more time to load (#14567)
* Start OpenCode when its plugins need more time to load

OpenCode waits 5 seconds for the plugins of a folder to load. When they
take longer, it answers the session/new request that OpenBot sends to
list the models with -32603 "Internal error: Internal service failure"
and data.errorName "ServiceUnavailableError". OpenBot counted this as a
failed start, so each start failed after about 10 seconds, and after
three starts OpenBot stopped trying. The status showed only the raw
OpenCode text.

Now the model check asks again each second while OpenCode answers that
it is still loading, inside the existing discovery deadline. A cold
start, a slow sign-in refresh or many plugins now finish in the first
start. When OpenCode still cannot finish, the status says "OpenCode did
not finish loading in time. OpenBot will try again." The start keeps the
existing automatic restart, and the CLI update check accepts the new
text as it accepts the raw one, so a new OpenCode copy is not removed
(#6746).

The approach follows t3code (#30263) and the OpenCode app, which both
retry this 503 while OpenCode loads its plugins.

scripts/opencode-service-failure-e2e.ts, which CI already runs, now
starts a fake OpenCode that fails session/new with the same error: two
failures then success, and failures that never end. Without the fix the
first case ends in "error". Checked by hand against the real OpenCode
2.3.2 with a plugin that needs 12 seconds: the provider is available
after 14 seconds on the first start.

Fixes #13248

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Stop the OpenCode model retry before an attempt can pass the deadline

The smoke test found that, with an OpenCode plugin that never finishes
loading, the start ran for its full window and ended as a timeout. A
real failed attempt takes about 10 seconds, but the retry only checked
that 1 second was left before the deadline. So the last attempt ran past
the discovery timeout, the start took the timeout path, the new text did
not show, and each later start waited longer (up to 6 minutes seen).

Now the model check asks again only while the longest attempt so far,
plus the 1 second pause, still fits before the deadline. The time is
kept for each run, because the resume fallback runs the same check
again. The last error then stays OpenCode's error, so the start shows
"OpenCode did not finish loading in time. OpenBot will try again." and
uses the normal restarts, with no longer waits.

The fake OpenCode now waits before each failure, and the stuck case of
scripts/opencode-service-failure-e2e.ts uses a 6 second window with a
1.5 second wait. With the old check it fails as the smoke test did (a
timeout after 6 s and "did not answer in time"); with this change it
ends after 4 s with the new text.

Fixes #13248

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Say in the release note that OpenBot still stops after three OpenCode starts that cannot finish

The local review found that the note could be read as if OpenBot no
longer stops after three starts. That stop is still there for OpenCode
that never finishes loading its plugins, as the smoke test shows.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 12:29:59 +01:00
Aleksander DygońandClaude Opus 5.5 03c2ff34c2 Remove code comments and add the no-comments rule (#12604)
* Remove code comments and add the no-comments rule

Remove the comments from first-party code and configuration files:
TS/JS, JSX, CSS, SQL migrations, Swift, Kotlin, Gradle, shell,
Docker, systemd, Nix, YAML, TOML, JSONC and GritQL.

Keep only what a tool reads: license headers, shebangs, compiler
and lint directives, JSDoc types in plain .js files, generated file
headers, GritQL scope lines, the install-server.sh help text and the
openbot-boat-pre-stop marker. Vendored code, fixtures and released
schemas keep their comments.

Add the rule to AGENTS.md, and change the docs that asked for
comments. Add two i18n keys that only comments named to
RELEASED_SOURCE_KEYS.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Keep comments that are data in strings

The benchmark task files in opencode-free-models-bench.ts tell the
model what each function must do. The sample file and HTML page in
the two stories are display content. Put their comments back.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Keep released migrations and mobile native inputs unchanged

check:migrations compares each released migration with v0.73.0 byte
for byte, so restore src/backend/migrations. A change to a native
build input of apps/mobile makes a new runtime version, so restore
those files and the extra fingerprint sources.

List these files and the comment markers that a tool reads in
AGENTS.md. Remove the last requests for comments in
src/renderer/AGENTS.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-19 12:19:28 +01:00
Aleksander DygońandClaude Opus 5.5 bda18dd974 Name OpenCode 2.1 service failures and the provider of each provider error (#2872)
* Name OpenCode 2.1 service failures and the provider of each provider error

OpenCode 2.1.3 sends "Internal error: Internal service failure" for each
failure that has no ACP error. OpenBot matched only the older "OpenCode
service failure" text, so a failed turn showed the generic text. A failed
turn now shows the OpenCode service-failure message.

A provider error with no chat (start failed, restart failed, stderr
diagnostic) went to a toast with no provider name. The message now names
the provider. The provider row and the analytics cause keep the original
error.

Refs #2850

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Name the provider in the toast title, not in the error text

The backend put "{provider} reported an error:" in front of each provider
error. The renderer reads the kind of an error from the start of its text
(401, network, JSON or stack output), so the prefix showed raw technical
text and stopped the sign-in refresh. It also named the provider twice in
OpenBot's own messages, such as the disk check.

Remove the prefix. The toast of an error with no agent now takes the
provider from the event code `<provider>_<kind>` and shows "{provider}
error" as its title. The message does not change.

Refs #2850

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 10:36:39 +02:00