GeezerVison is showing github.com — fix(cli-rs): port selection colours and ACP fixes, and regenerate bindings by simonklee · Pull Request #66652 · anomalyco/opencode
Conversation
simonklee
commented
Nov 26, 2026
•
edited by opencodejr
Bot
Loading
Uh oh!
There was an error while loading. Please reload this page.
What it does
Brings the Rust client level with dev after #66470.
-
Text selections use the theme's colours (fix(tui): draw text selections in theme colours #65776). The theme gains text.selection and background.selection,
defaulting to the focused primary action colours as in TS. The TUI passes them to OpenTUI's selection colours. New
resolver and TUI tests, and the U.1 token fixture is regenerated.
-
ACP fixes (fix(acp): fix a batch of ACP issues #66631). All 12 fixes are ported to crates/acp:
- provider display names in model options, and skills offered as slash commands;
session.renamed sent as session_info_update, and child sessions marked in session/list;
- worktree project matching and the
directory error data in getSession, and MCP restored after a location shutdown;
- selection echo tracking with rollback on error, command error classification, and
status/retryAfterMs on
service failures;
- subagent cost counted recursively in
usage_update;
- inferred MIME types for blobs,
file: path normalisation and percent-decoded file names;
- credential-like select fields asked without a custom option.
The generated MIME table moves to crates/util so ACP and run share it. The ACP unit and wire tests are ported too.
-
A plugin's tree hash notices a same-size rewrite on a coarse clock. The cached hash of a plugin tree was keyed by
each entry's size, modification time and inode. Two saves in one clock tick keep all three, so a dependency rewritten
in place at its old size kept the old hash, and a_typescript_plugins_artifact_is_its_files failed on every
GitHub Actions run of chore(ci): build the Rust client for every target #66152. Now a hash is cached only when every entry is older than 2 s, as git treats racy
entries; unchanged trees still skip reading the bytes. The test uses fixed test clocks, and the approval lock test
waits on a handshake instead of a sleep.
-
Regenerated API and plugin bindings for the flags and browser-tunnel routes (feat(server): expose resolved feature flags at /api/experimental/flag #66469, feat(browser): stream remote browser traffic over multiplexed binary WebSocket #66217), Code Mode agents
(feat(core): agent(), llm() and structured JSON Schema output in Code Mode #66278), experimental spaces and their batched writes (feat(server): experimental spaces #63998, feat(server): batch writes for experimental spaces #66668), the new model types (feat(core): read voice, embedding and transcription models from config #66627) and the automation changes (feat(app): show where automations run and which session they wake #66393). The F.7
fold fixture is regenerated too.
Model speeds without the flag (#65877) and Code Mode's agent()/llm() output need no Rust change. Without the
regeneration and the hash fix, #66152's Rust check stays red.
Checks
cargo fmt --check, clippy -D warnings, check:drift, compat.test.ts, the ACP suite, and the API, store, plugin and
TUI suites with the TypeScript interop tests (OPENCODE_RS_REQUIRE_TS=1). The merge lane's gate and full suites run on
native-next and on this branch against dev.
Added by the opencode bot (AI-generated).
Public API: regenerated bindings replace experimental.space.set/delete with experimental.space.write, following the server (not backwards compatible for Luau plugins calling the old operations)
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The port looks faithful and I found nothing blocking. I couldn't build or test it: the review sandbox has no Rust toolchain, and check:drift stops without rustfmt. So I checked by reading the code against the TypeScript originals:
- ACP model/agent switch tracking and rollback, MCP restore after a location shutdown, the worktree match in
getSession, recursive subagent cost, skills as slash commands, provider names, and resource-link and MIME handling all follow the TS logic in packages/cli/src/acp.
- The selection colour defaults match
packages/theme/src/tui/expand.ts.
One small difference: for blobs without a MIME type, TS infers it with Bun's own MIME lookup, while Rust uses the mime-types table, so the two can disagree on a few rare extensions.
Public API: the HTTP API and plugin API are unchanged. The ACP side only adds things, so existing clients and themes keep working:
session/list entries get _meta["opencode/child-session"] for child sessions
- a rename now sends
session_info_update
- error data gains
directory (session directory mismatch) and status/retryAfterMs (service failures)
- themes accept two optional keys,
text.selection and background.selection
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
A project plugin's tree hash was reused while every entry kept its size,
modification time and inode. On a coarse filesystem clock two saves in one
tick keep all three, so a dependency rewritten at its old size kept the old
hash, and `a_typescript_plugins_artifact_is_its_files` failed on GitHub
Actions every run.
A hash is now kept only when every entry is older than `RACY`, the window
`pipe::tree`'s stamp already treats as unable to vouch for a tree: a call
while an entry is racy reads the bytes again and keeps no shortcut. A
reconcile that changed nothing still compares metadata alone; on a 256 MB
package a cold hash took 157 ms and the warm path 38 us. `Artifact::stage`
still hashes the bytes it copies, so nothing unapproved can run.
The tree hash test sets the clock its racy window reads to fixed times, so it
covers both sides without waiting: a settled tree keeps its cached hash, and a
same-size, same-time rewrite while an entry is racy is read again. The
approval lock test likewise releases its lock on a handshake at the save's
first blocked attempt instead of sleeping 100 ms.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The two new commits look sound. I checked them by reading the code; the review sandbox has no Rust toolchain, so I couldn't build or run anything.
The racy check in Artifact::tree is correct. While any entry changed within the 2 s window, the cached hash is not used and no new one is stored, so a same-size rewrite in one clock tick is read again. The fixed test clocks and the lock handshake remove the old timing dependence, and the holder thread always releases the lock after the save, so the test can't hang.
Public API: the regenerated bindings replace experimental.space.set (PUT /api/experimental/space/:space/:key) and experimental.space.delete (DELETE on the same path) with experimental.space.write (POST /api/experimental/space/:space/write, which takes changes). This follows the server's experimental API (#66668) and isn't backwards compatible: Luau plugins calling the old two operations need to move to space.write.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
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.
|