fix(rooms): align model settings state with the saved modelRef contract - #1341
Merged
Merged
Conversation
The main/fast binding state was typed as AgentModelBinding, whose providerId is optional, while saveAgentModels requires the AgentModelRef shape with a mandatory providerId. tsc -p tsconfig.web.json has been failing on develop since the bindings state was introduced. Tighten the state to the saved ref shape and treat provider-less fallback options as "inherit" instead of sending a payload the API schema would reject. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Two tracked files on develop exceed the file-lines limit and fail Quality gates for every PR. Extract the extension-artifact IPC handler into register-extension-artifact-ipc-handlers.ts, and move the remote bridge clipboard helpers into remote-bridge-clipboard.js which the Remote gateway serves ahead of remote-bridge.js. No behavior change: the clipboard helper degrades gracefully when absent. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…vior memory_create is only advertised when the turn context enables memoryPolicy; the approval-gating test never set it, so resolution threw before reaching the approval path. The Codex Responses endpoint requires streamed requests and the client now forces stream:true, so the adapter case must expect it. Both failures reproduce on a clean develop checkout. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
The scale and rollback-migration tests do real SQLite work and sit close to their timeout budget; both timed out on the CI runner while passing locally. Give the migration case an explicit 30s and raise the 100k-message scale case to 120s. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
The PID-reuse guard in runtimeProcessInspectionMatchesRecord treats a record whose startedAt predates the real process start as a different owner, so the mock registration with a 2026-08-16 timestamp was being unregistered instead of kept as an external writer. Stamp the record with the current time so it matches the live test process. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
7 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary / 概要
develop:tsc -p tsconfig.web.jsonerrors inAgentModelSettings.tsx(AgentModelBinding | nullnot assignable to themodelRefcontract).npm run check:file-linesviolations:src/main/ipc/register-app-file-ipc-handlers.ts(707 lines) andsrc/renderer/public/remote-bridge.js(750 lines) exceed the 700-line limit.kun/test expectations:memory-store.test.tsnever enabledmemoryPolicyin the turn context (somemory_createwas not advertised), andmodel-client-1.cases.tsstill expectedstream: falsefor Codex, which the client now forces tostream: truesince Codex Responses only accepts streamed requests.Why / 背景
AgentModelSettingsstores the main/fast model binding in state typed asAgentModelBinding, whereproviderIdis optional, butsaveAgentModelsrequiresAgentIdentity['modelRef'](AgentModelRef), whereproviderIdis mandatory (zodmin(1)).develop— reproduced on a clean checkout — and they currently fail "Quality gates" for any PR (e.g. feat: add Opper as a model provider preset #1340).Changes / 变更
AgentModelSettings.tsx: type themain/faststate andapplyparameters asNonNullable<AgentIdentity['modelRef']> | null; guard the dropdown selection withoption?.providerIdso provider-less pseudo-options (thedeps.model()fallback) fall back to "inherit" instead of sending a payload the API schema would reject.extension:artifact:openhandler + its schemas intosrc/main/ipc/register-extension-artifact-ipc-handlers.ts(no behavior change).src/renderer/public/remote-bridge.jsintoremote-bridge-clipboard.js, exposed onwindow.__kunRemoteBridgeClipboard; the Remote gateway serves it ahead of the bridge script in the same response, and the bridge degrades gracefully when it is absent.Media / 截图或录屏
Tests / 测试
npx vitest run src/renderer/src/components/rooms/— 188 passednpx vitest run src/main/remote/ src/main/ipc/— 417 passedkun:vitest run tests/memory-store.test.ts tests/model-client.test.ts— 70 passed;tsc --noEmit -p tsconfig.json— cleannpx tsc --noEmit -p tsconfig.web.jsonandtsconfig.node.json— cleannpm run check:file-lines— passednpx eslinton touched files — cleanValidation / 验证
npm run test(affected files / 相关测试文件)npm run typechecknpm run buildnpm run dev(no runtime or UI behavior change / 无运行时或界面行为变化)Notes / 备注
Generated with Devin