2 Commits
Author SHA1 Message Date
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
NB 7b892a1508 Send fewer prompt tokens in each OpenCode agent request (#5632)
* Send fewer prompt tokens in each OpenCode agent request

OpenCode agents no longer get the OpenCode question tool, the two MCP
resource tools, or the report and opencode skills. OpenBot has its own
ask_user tool, and its MCP servers serve no resources. A one-reply
request on OpenCode 2.2.6 goes from 5,987 to 5,288 o200k tokens.

The rules go in an OPENCODE_CONFIG file in the provider state folder,
so a project opencode.json rule wins. The driver leaves out each rule
that a name or pattern in the global config matches. It adds no rule
when the user sets OPENCODE_CONFIG or a global file cannot be decoded.

Add bench:opencode-prompt-settings and smoke:opencode-agent, which run
the real driver and CLI against a fake model in temporary XDG folders.

* Read every OpenCode global rule before adding the prompt rules

Read OPENCODE_CONFIG_DIR as well as the XDG folder, as OpenCode 2.2.6
uses it in place of that folder, and count the rules of each agent in
`agent` and `agents`. Remove trailing commas only outside strings.
Write the rules file only when it changes, through a temporary file and
a rename, so that a process that starts meanwhile never reads part of
it. Log a config that cannot be decoded once, not at each spawn. The
scripts clear OPENCODE_CONFIG and OPENCODE_CONFIG_DIR of the shell.

* Run the OpenCode tool-trim e2e on the shared OpenCode harness
2026-11-07 21:41:14 +01:00