feat: merge upstream opencode v1.1.58#323
Conversation
This reverts commit 213a872.
b307937 to
5e2c380
Compare
This comment has been minimized.
This comment has been minimized.
b7a88db to
fa4e579
Compare
fa4e579 to
ca61733
Compare
|
|
||
| const lookup = (directory: string, sessionID?: string) => { | ||
| if (!sessionID) return Promise.resolve(undefined) | ||
| const [syncStore] = globalSync.child(directory, { bootstrap: false }) |
There was a problem hiding this comment.
WARNING: lookup() can throw synchronously before returning a Promise
globalSync.child(...) and Binary.search(...) are executed before any .catch(...). If either can throw (e.g. store not bootstrapped / unexpected data), it can break the event listener and silently stop further notifications. Consider wrapping the body in Promise.resolve().then(() => { ... }) and keeping the existing .catch(() => undefined) to ensure failures stay contained.
|
|
||
| useKeyboard((evt) => { | ||
| if (evt.name === "escape" && store.stack.length > 0) { | ||
| if ((evt.name === "escape" || (evt.ctrl && evt.name === "c")) && store.stack.length > 0) { |
There was a problem hiding this comment.
WARNING: Ctrl+C now closes dialogs, which can conflict with copy/interrupt expectations
This handler closes the top dialog on (evt.ctrl && evt.name === "c") without checking whether the user is trying to copy selected text (or whether a focused control wants Ctrl+C). Consider gating this to cases where there is no active selection (e.g. via the renderer selection API) or limiting it to specific dialogs so Ctrl+C keeps its conventional behavior.
| "With a single API key you'll get access to models such as Claude, GPT, Gemini, GLM and more.", | ||
| "provider.connect.opencodeZen.visit.prefix": "Visit ", | ||
| "provider.connect.opencodeZen.visit.link": "https://opencode.ai/zen", | ||
| "provider.connect.opencodeZen.visit.link": "opencode.ai/zen", |
There was a problem hiding this comment.
question(non-blocking): should we look to change these to point to kilo.ai/gateway at some point?
There was a problem hiding this comment.
Fully removing zen is not our interest. Only where it interfers with kilo gateway. So let's keep it to reduce conflicts for now. I think here we are good for now.
Summary
getDisplayBackend/setDisplayBackendto useinvoke()instead ofcommands.*Kilo-specific fixes during merge
--provenanceflag onnpm publishcommandsbuild.ts(opencode→kilo) and user-agent string__OPENCODE__→__KILO__in desktopindex.tsxkilo-install.shtemp script name incli.rs"kilo"in desktop sidecar spawnbuild.tsandpublish.tsto dev versions (upstream had only branding reversions, no functional changes)binentries inpackage.json(kilo,kilocodeinstead ofopencode)opencode/→Kilo-Code/)instance.dispose()+clearWorkspaceTerminals()in workspace reset flow — these frontend changes depended on backend changes that were silently dropped during merge (see note below)kilocode_changemarkers on all Kilo-specific changes in shared filesMerge script improvements
script/upstream/utils/git.ts):git commitnow uses.nothrow()and returns a boolean instead of throwing when there's nothing to commit. The caller inmerge.tshandles the empty case gracefully.__OPENCODE__→__KILO__transform (script/upstream/transforms/transform-tauri.ts): Added.tsxto thefileTypeslist so the window global replacement also applies to TypeScript React files (previously only.rs).Known issue: silent backend change loss
The pre-merge transform script converts upstream branding (
opencode→kilo) before merging. When transformed upstream files become identical to our files, git auto-resolves as "no change" — keeping ours. This means real code changes made alongside branding changes in the same files get silently dropped. In this merge, ~9600 lines of upstream changes inpackages/opencode/src/were lost this way. Theinstance.dispose()revert above was needed because the frontend picked up changes that depend on those dropped backend changes.