feat(desktop): customize model connection requests - #2565
Merged
Conversation
M4n5ter
force-pushed
the
design/desktop-model-connection-settings
branch
from
August 9, 2026 05:29
4858b86 to
5f64ddf
Compare
M4n5ter
marked this pull request as ready for review
August 9, 2026 05:34
6 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.
English
Summary
Model connection setup now opens on All providers and keeps the active category when search is cleared, so providers such as OpenRouter are directly discoverable without knowing their catalog classification first.
Connections can define provider-independent custom HTTP headers and an extra JSON request body. Header values remain encrypted in the Runtime Policy credential vault; Desktop receives only saved header names and never reads retained values back into the renderer. Extra body data remains part of the connection catalog, is canonicalized and size-bounded, and rejects collisions with Maka-generated top-level fields explicitly.
Request customization is composed in the shared Runtime model factory rather than a Desktop client. The same settings therefore apply to Desktop, CLI, and TUI across OpenAI Chat Completions, OpenAI Responses, and Anthropic Messages clients. Runtime Host uses a singular, frame-safe credential export contract with Base64 wire payloads for configuration transfer.
The Desktop editor keeps advanced settings compact until opened, preserves stored header values through an explicit keep-saved state, and gives Save and Cancel controls sufficient separation from the following row divider.
Verification
main: 350 passed, 0 failednpm run buildnpm run lintnpm run format:checkgit diff --checkX-Title: Makawithout returning its value to the renderer, retainedprovider.only: ["openrouter", "deepseek"], and connected throughdeepseek/deepseek-v4-flash-0731Checklist
Does this PR entail a change in behavior?
中文
概要
模型连接设置现在默认展示全部提供商,并在清除搜索时保留当前分类,因此无需预先知道目录分类即可直接找到 OpenRouter 等提供商。
连接可以配置与提供商无关的自定义 HTTP 请求头和额外 JSON 请求体。请求头 value 继续加密存储在 Runtime Policy 凭据库中;Desktop 只会拿到已保存的请求头名称,不会把保留值读回 Renderer。额外请求体属于连接目录数据,会经过规范化和容量限制;如果与 Maka 生成的顶层字段冲突,会明确失败。
请求定制在共享 Runtime 模型工厂中组合,而不是由 Desktop client 单独处理。因此同一份设置会同时对 Desktop、CLI 和 TUI 生效,并覆盖 OpenAI Chat Completions、OpenAI Responses 与 Anthropic Messages client。Runtime Host 的配置导出使用单项、帧安全的凭据协议,并通过 Base64 wire payload 传输。
Desktop 的高级设置默认保持紧凑;展开后通过明确的“保留已保存值”状态保护现有请求头 value,并为 Save、Cancel 按钮与下一行分隔线保留足够间距。
验证
main的中间 frame 修复后,CLI:350 通过,0 失败npm run buildnpm run lintnpm run format:checkgit diff --checkX-Title: Maka且不向 Renderer 回传 value,保留provider.only: ["openrouter", "deepseek"],并通过deepseek/deepseek-v4-flash-0731成功连接检查清单
此 PR 是否包含行为变化?