9 Commits
Author SHA1 Message Date
Aleksander DygońandClaude Opus 5.5 5d10dc64ec Let a custom OpenCode model take no reasoning effort (#8325)
* Let a custom OpenCode model take no reasoning effort

A custom model on OpenCode with no saved efforts got OpenCode's own Low,
Medium and High, and OpenBot sends the agent's effort with each turn. An
endpoint that refuses `reasoning_effort` for a model, such as xAI for
grok-4.20, then failed every turn with "Internal error: Model grok-4.20
does not support parameter reasoningEffort." The Efforts field had no
choice that sends no effort.

- An empty `reasoningEfforts` list now means "No reasoning", as an empty
  `inputs` list means "Text only". OpenBot writes `variants: {}` for it.
  OpenCode 2.2.5 and 2.2.7 then offer no effort and send none.
- The Efforts menu shows the harness default as ticked, as the Accepts
  menu does. The first change saves that default, so clearing all
  efforts selects No reasoning. An absent list keeps today's behavior.
- Pi treats an empty list as no reasoning, as it treats an absent one.
- The form, the IPC input, the saved file and instance transfer keep an
  empty list. An older build drops it and uses the default.
- When a custom endpoint refuses the effort, the chat names the endpoint
  and the setting to change, in place of the endpoint's text.

Fixes #7500

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

* Do not show the refused effort a second time as a provider error

The diagnostic line for a refused reasoning effort showed as a technical
toast beside the plain text in the chat. The chat text names the cause
and the setting, and the failed turn is still logged.

Refs #7500

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

* Log the refused effort, and test a custom model with no effort

- Write the endpoint's text for a refused reasoning effort to the log
  file, without a second error in the app.
- The OpenCode custom model E2E saves a model with no efforts. OpenCode
  must offer no effort for it, and a turn at high must send none.

Refs #7500

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

* Point the effort refusal text to the No reasoning item

The Efforts menu now has a No reasoning item, and clearing all efforts
goes back to Default. Change the error text in all 15 languages and
the release note to say "select No reasoning".

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

* Let the Efforts menu take an undefined No reasoning label

The dialog gives no label on Pi. With exactOptionalPropertyTypes, the
optional prop must name undefined, as the mount prop does. CI's
types:ratchet step found this.

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

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-19 14:04:37 +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 3c1738a0e7 Name both causes when a custom endpoint refuses a turn (#8509)
* Name both causes when a custom endpoint refuses a turn

OpenCode 2.2.7 sends HTTP 401, HTTP 403 and permission_denied from a
custom endpoint as one ACP auth_required error, with empty data. OpenBot
said that the endpoint refused its API key or headers. For a 403, the key
can be correct while the account cannot use the model, so entering the
key again did not help.

The new error.provider.customEndpointAccessRefused text names both causes
and both next steps. The old key stays in the catalog for hosts from
v0.57.0 to v0.69.0, which still send its text.

Fixes #7691

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

* Name the last release that sends the old endpoint text

Releases v0.70.0 to v0.73.0 came out after this branch started. They
also send the old customEndpointKeyRefused text.

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

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 19:57:17 +01:00
Aleksander DygońandClaude Fable 5.2 555b3bb44f Send no reasoning effort to an Ollama model that cannot reason (#12168)
* Send no reasoning effort to an Ollama model that cannot reason

OpenCode gives a custom model with no saved efforts its own Low, Medium
and High, so OpenBot sent the agent's effort as `reasoning_effort`.
Ollama refuses that for a model without its `thinking` capability, and
each turn failed with "does not support thinking".

The main process now asks an Ollama server (`/api/version`, then
`/api/show` for each model with no saved efforts) which models cannot
reason. Those models get an empty `variants` record in the OpenCode
config, so OpenCode lists no effort and OpenBot sends none. The probe
runs at start and before the restart of a saved or changed endpoint.
Nothing is saved. A server that is not Ollama or does not answer keeps
the behavior of before.

Fixes #8381

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

* Ask the model server again at start, and describe the requests

Review and CI fixes for #8381:

- A model server that starts after OpenBot gave no answer, and its
  models kept the refused efforts until a restart or an endpoint save.
  The start now asks again after 5, 20 and 60 seconds while a server
  does not answer. The existing provider teardown stops the wait.
- `PRIVACY.md` describes the `/api/version` and `/api/show` requests.
- `probeModelsWithoutReasoning` is no longer an unused export.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

---------

Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-18 18:25:45 +01:00
Aleksander DygońandClaude Opus 5.5 d7d416ac6f Let custom provider models accept images and PDF, and fill values from the model list (#5389)
* Let each custom provider model set its input kinds

A custom model on Pi got text only, so Pi dropped each image, also for a
vision model. On OpenCode, a custom model got text and images, but the
read tool refused each PDF. The form had no field for this.

- Add an optional `inputs` list to each custom model: `image` and `pdf`,
  beside text. An empty list means text only. With no list, each harness
  keeps its own default: text and images on OpenCode, text on Pi. It stays
  on this computer, like the efforts: the Team API save and list keep
  their released model fields.
- Pi gets `input: ["text", "image"]` when the list has `image`. Pi has no
  PDF input, so it ignores `pdf`.
- OpenCode gets the list as `modalities.input`.
- The form shows an "Accepts" group under each model row, with the
  default of the harness checked. Pi shows only Images. A kind that the
  harness cannot send stays saved when the user changes the harness.
- Instance transfer keeps the list.
- The Pi and OpenCode custom endpoint E2E scripts check that an image
  reaches a model with image input and not a text-only model, and that
  the OpenCode read tool gives a PDF only to a model with PDF input.

Fixes #5332
Refs #4154

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

* Fill custom model values from the endpoint's model list

Find models read only the model ids, so the user typed the context
window, the max output and the input kinds of each model by hand, also
when the endpoint lists them.

- The model probe reads what a list entry says, in the shapes that
  servers publish: models.dev (`modalities.input`, `limit`), OpenRouter
  (`architecture.input_modalities`, `context_length`,
  `top_provider.max_completion_tokens`) and vLLM (`max_model_len`). A
  missing or out-of-range value is left out; nothing is guessed. A max
  output comes only with a window, as the form takes it.
- The found values fill only empty fields: of a model that the user
  checks, and of the rows that the list names. A typed or saved value
  stays. A line under the list says that values come from the endpoint.
- Efforts are not filled: a list says at most that a model reasons, not
  which efforts the endpoint accepts.
- A scanned local server opens its form with the same values.
- The provider detection E2E checks each shape, values out of range,
  and the preload decoder.

Refs #3946
Refs #4154

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

* Fill model values only after Find models, and keep room for the prompt

- A list that the dialog opens with no longer fills a saved field that is
  empty. Only a Find click fills empty fields.
- A listed max output that is as large as the context window is not used.
- An empty `modalities` no longer hides the OpenRouter input kinds.
- An input checkbox change does not make an empty model row count as filled.
- The found-values line shows only when a row holds a listed value.
- Correct the OpenCode default input comment.

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

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-06 16:56:00 +01:00
Aleksander DygońandClaude Opus 5.5 0ced348d93 Let each custom provider model set its reasoning efforts (#5138)
* Let each custom provider model set its reasoning efforts

A custom model on OpenCode always showed Low, Medium and High, and a custom
model on Pi could not reason, because Pi got `reasoning: false`. The form had
no field for the efforts that an endpoint accepts.

- Add an optional `reasoningEfforts` list to each custom model (none, minimal,
  low, medium, high, xhigh, max). It stays on this computer, like the context
  window: the Team API save and list keep their released model fields.
- OpenCode gets the list as `variants`. OpenCode 2.2.5 drops a `reasoning`
  key from this config shape, and listed variants replace its own set.
- Pi gets `reasoning: true` and a `thinkingLevelMap` that sets each level that
  the list does not have to null, so Pi offers only the listed levels.
- The form shows the efforts under each model row. With none selected, the
  harness keeps its own behavior.
- Instance transfer keeps the list.
- The OpenCode and Pi custom endpoint E2E scripts check the listed efforts and
  the `reasoning_effort` that a turn sends.

Input kinds (images, PDF) from the same issue are not in this change.

Refs #4154

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

* Fix review findings on custom model efforts

- Send the invalid efforts error with `sourceText`, in all 14 languages.
- Keep the efforts of a found model when the user clears and checks it again.
- Make the preview list the saved efforts, as OpenCode and Pi do.
- Change the efforts list in place, and give each row its index as an
  accessor, so that a removed row does not rebuild the rows after it.

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

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 12:35:25 +01:00
4f22c6969d Write a real output limit for each custom model (#4478)
* Write a real output limit for each custom model

OpenBot wrote `output: 0` into the OpenCode entry of a custom model. OpenCode
2.2.5 then asked for its own 32,000-token fallback, and an endpoint whose
model has a smaller output cap refused every turn.

- Add an optional `maxOutput` to each custom model, next to the context
  window. It stays on this computer: the Team API list and save keep their
  released model fields.
- OpenCode and Pi use one helper: the saved `maxOutput`, or else at most
  16,384 tokens, or half a small window. Before, Pi had its own copy of this
  default, and OpenCode had none.
- The OpenCode E2E script checks the request budget for a saved cap, a blank
  cap on a 128K window, and a small window.

Based on #4238 by Muzhen2000.

Fixes #4234

Co-authored-by: Muzhen2000 <254800372+Muzhen2000@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Check the saved output limit in the Pi custom endpoint E2E

The Pi E2E now gives one model a saved max output, and checks that Pi
asks the endpoint for that budget.

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

* Keep the saved max output on detected endpoints and in a transfer

- An edit of a detected endpoint (Ollama, LM Studio) opened with the max
  output field empty, and a save then removed the saved value.
- A settings transfer dropped the max output of each custom model. The
  manifest now has an optional `maxOutput` key, as for `contextWindow`.
  An older app ignores the key.
- Name the OpenCode version of the 32,000 fallback.

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

* Name the release notes after the branch

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

* Keep the token counts readable in the model row

With a max output column, the context window column was too narrow to
show a value such as 131072. Each token column now has a minimum width.

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

* Name the Pi clamp that keeps a large max output inside the window

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

---------

Co-authored-by: Muzhen2000 <254800372+Muzhen2000@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 14:20:10 +01:00
NBandClaude Opus 5.5 e3b076f753 Show a joined server's custom models on the Custom tab and name the endpoint when it refuses its key (#4275)
* Show a joined server's custom endpoint models on the Custom tab

The model picker of a joined server's agent used the custom endpoints of
this computer. The Custom tab was missing, and the server's custom models
showed on the OpenCode tab. The picker now uses the endpoints of the
active server: this computer's list for a local agent, and the host's
list for a joined server where the user is an owner or an admin.

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

* Name the custom endpoint when it refuses its API key

OpenCode 2.2.5 reports an HTTP 401 from a custom endpoint as "provider
authentication required" (-32000), both when no key was sent and when the
endpoint refused the key. OpenBot showed that OpenCode had no sign-in and
asked for an OpenCode Go key, but the key of an endpoint is in Providers.

The ACP client option `providerName` becomes `customEndpoint`, which also
says whether the endpoint has a saved key. The OpenCode flavor uses it to
name the endpoint and to tell the user to enter its key again, or to add
one. The OpenCode custom model E2E now checks that a turn sends the saved
key, and that a refused key gives the new text.

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

* Point the endpoint key error to Server settings

The custom provider list is in Server settings → Providers, not in
Settings. An endpoint can also sign in with a header and no API key, so
the refused text names the key or the headers, and a saved header counts
as a credential. The E2E now also checks the text for a missing key.

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

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 18:08:41 +01:00
NBandClaude Opus 5.5 5807f1e2f9 Turn off OpenCode's chat titles (#4064)
OpenCode asks its small_model for a title on the first turn of each
session. On a llama-swap server, a small_model of the same server unloaded
the agent's model, and the next turn loaded it again. OpenBot does not use
these titles, so its OpenCode config layer now turns them off.

Add scripts/opencode-custom-model-e2e.ts. It runs the real OpenCode against
a fake endpoint with two models and checks that each request names the
agent's model. Without the fix, the title request named the other model.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 17:23:05 +01:00