Repository navigation
fix(agent-core-v2): match regional plugin locales - #4666
Conversation
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
commit: |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 78fdaa1552
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
* fix(tui): read welcome cwd and footer git status from the session environment (#4649) * fix(tui): show remote cwd in welcome panel * fix(tui): read footer git status through the session environment The footer ran git and gh on the local machine, so a remote-bound session hid the git badge. Read branch, working-tree, and pull request state through the SDK instead: a live session's own environment, or the local work dir before the lazy session exists. The local HEAD poll stays as a refresh trigger only. Core git commands now time out after 30s, and the pull request cache is keyed by branch so a branch switch no longer serves the previous branch's pull request. * fix(agent-core-v2): resolve local git and gh outside the working directory GitService spawned bare git and gh with the workspace as cwd. On Windows a bare name is looked up in the cwd before PATH, so a binary planted in the workspace could run, and the TUI footer now reads git status at startup, before the workspace trust gate. Resolve both through PATH for the local environment and refuse any match inside the working directory. * chore: merge changesets for remote cwd and git status * fix(tui): drop the startup Ready. row once startup succeeds The startup progress row turned into a permanent "Ready." line under the welcome panel. Remove it on success; a failed startup still leaves the "Startup failed." row. * fix(agent-core-v2): compare workspace containment case-insensitively on Windows resolveProgramPath compared the PATH candidate against the working directory case-sensitively, so on Windows a PATH entry spelled with different casing (c:\repo\bin vs C:\Repo) let a workspace-local executable through. * fix(tui): keep the footer git badge through a remote disconnect The git cache key included the environment status, so a remote dropping to connecting or disconnected rebuilt the cache and lost the last badge. Key the cache by session and work dir only, and refresh it when the environment turns ready again. * feat: isolate plugin availability by client (#4653) * fix: preserve marketplace descriptions * fix: preserve localized plugin display names * feat: isolate plugin availability by client * fix: preserve cli marketplace loading * fix: harden plugin availability reconciliation * fix: hash plugin marketplace provenance * fix: complete plugin availability reconciliation * fix(transcript): keep realigned turn ids unique when folding cold facts (#4658) * fix(transcript): keep realigned turn ids unique when folding cold facts Realigning base turns to their wire ids only skipped ordinals held by turns without a wire id. When an inherited turn held a forked turn's wire id, that turn kept its base ordinal, and the next turn's wire id could land on the same ordinal, so two turns shared a turn id and the later one replaced the earlier in clients. Claim ordinals in order: turns without a wire id or already at their wire id first, then each realigned turn takes its wire id when free, else keeps its ordinal or moves to the next free one. * chore: add changeset for side chat turn order fix * fix(kap-server): wait for an agent's history before accepting its prompt (#4659) * fix(kap-server): backfill a side chat fork before replying to :btw A fork's inherited history folds into a cold turn at t0, while the live transcript only records it as markers. When the fork's first prompt started before anything read the fork transcript, its live turn took t0; the history backfill then merged the inherited main turn into it by turn id, so the first side chat turn carried the main answer and the real answer landed in a duplicate turn. Finish the fork's history backfill before :btw replies, so the inherited turn holds t0 before the first prompt can start. * fix(kap-server): wait for an agent's history before accepting its prompt Delaying the :btw reply did not order the fork's first prompt after its history backfill: other clients learn the fork from the agent roster as soon as it is created, and checking for a live transcript with forSessionLive created one, so every :btw also waited for the whole main history. Move the wait to prompt submission: a prompt for a non-main agent awaits that agent's history backfill before it is enqueued, which covers every client and leaves :btw unchanged. The backfill is cached per agent, so later prompts do not wait again. * fix: safely launch Windows SSH executors (#4664) * feat: support Windows SSH remote environments * Delete .changeset/windows-remote-environments.md Signed-off-by: 7Sageer <[email protected]> --------- Signed-off-by: 7Sageer <[email protected]> * fix(agent-core-v2): match regional plugin locales (#4666) * fix(plugins): confirm stopping Windows CU processes before install (#4670) * fix(plugins): confirm stopping Windows CU processes before install * test(plugins): cover capability install confirmation contract * fix(plugins): preserve bodyless installs and plugin-only repairs * chore: sync web dist from code-app (#4667) * chore: sync web dist from code-app code-app: 63661fc449e2ec0ce024bc08fe87f2c757d483e8 * chore: sync web dist from code-app code-app: d0e913a6c9607be778c62f0c74ee7310bfb8862a * chore: sync web dist from code-app code-app: b306f4a2f9be8944e5a8064ecb076e3137c968f1 --------- Co-authored-by: kimi-agent-bot <[email protected]> * ci: release packages (#4672) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --------- Signed-off-by: 7Sageer <[email protected]> Co-authored-by: 7Sageer <[email protected]> Co-authored-by: liruifengv <[email protected]> Co-authored-by: qer <[email protected]> Co-authored-by: kimi-agent-bot <[email protected]> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Fifteen rows enter the ledger: the six commits that landed on upstream/main after the last refresh, and the nine commits that reach main only through the release/2026-11-04 sync (MoonshotAI#4674), which is where the 2.5.0 changelog entries come from. Each 2.5.0 row records what it needs from this tree, so the next batch starts from the blocker instead of rediscovering it: - MoonshotAI#4658 and MoonshotAI#4659 are ported (79a4199, 7a531f5) with tests that fail on the pre-change tree. - MoonshotAI#4649 is in_progress: its agent-core-v2 half landed in 2fa7b6b, while the footer and welcome half needs the pull-request API of MoonshotAI#4527 and the session workdir of MoonshotAI#4062. - MoonshotAI#4653, MoonshotAI#4666 and MoonshotAI#4670 build on the MoonshotAI#4525 plugin marketplace, absent here; MoonshotAI#4670 additionally needs isError2. - MoonshotAI#4664 needs the MoonshotAI#4062 remote environments. - MoonshotAI#4667 and MoonshotAI#4672 are generated-bundle and release commits; settling them as not-applicable needs a signature. Rows were appended by a one-off writer because --refresh fetches and that fetch does not complete on this network; the file still parses under the tool's own column contract, and --verify --batch B5 passes both new probes.
…ection layer The row reads as a two-file change, but it edits `pluginInterfaceForLocale`, which this tree does not have: the fork's plugin manager parses and stores `interfaceLocales` and declares `PluginCapabilities`, yet nothing builds the inspection surface that consumes them (no `pluginCapabilities`, `pluginSkillsInfo` or `pluginMcpServersInfo`). Porting the selector alone would leave it uncalled. Prerequisite named in the row: the inspection half of MoonshotAI#4525, which the ledger already marks equivalent with a note listing only the entry model and parser as ported. Ledger: MoonshotAI#4666 blocked; closed 79, remaining 20.
Port of upstream MoonshotAI/kimi-code 0f05974 (MoonshotAI#4666). A plugin that ships `zh-CN` (or `zh_Hans`) could not answer a client asking for `zh-TW`, and `en` never reached an `en-US` translation: the lookup only tried the exact tag and the bare language, so any region mismatch fell through to the unlocalized manifest. The resolution order is now exact tag, then bare language, then the manifest's declared `defaultLocale` when it shares the language, then the first same-language variant in a stable order. Keys are normalized (lowercase, `_` to `-`) on both sides, so a file named `zh_HK.json` participates like `zh-HK`. `getPluginInfo({ id, locale })` carries the locale and the resolved interface overrides each MCP server's `displayName`, `description` and `iconUrl`, with the localized override ahead of the base manifest's. `PluginMcpServerInfo` gains those three optional fields. Local-form notes: - Upstream resolves this through a `PluginInspection` record carrying per-skill records, so its test also covers `info.skills`. This fork has no per-skill record source (only `skillCount` and `skillInstruction`); `PluginCapabilities`, `PluginSkillRecord` and `PluginSkillInfo` are declared but have no consumer anywhere, so building that pipeline here would be new machinery for a dead surface. The port covers the live one: MCP server presentation, driven by the same `pluginInterfaceForLocale`. - `getPluginInfo` is only called from the kimiCu capability and tests today, so adding `locale` to the input stays inside the engine; there is no kap-server route or SDK contract to update. Verified: agent-core-v2 typecheck clean; test/app/plugin/manager.test.ts 11 pass, pluginService 32, marketplace 13, kimiCu 38, pluginCommand 2; oxlint --type-aware 0 errors; check:no-comments green (the JSDoc that explained the fallback order was removed rather than exempted, since this package forbids comments). The two new cases fail if the base-language and same-language fallbacks are dropped.
Requirement or Bug
Desktop / Web 的插件详情页在界面语言为
en时,无法使用仅提供en-US.json的插件翻译,Skills 和 MCP 会回退到 manifest 的默认语言。本 PR 让语言-only locale 能正确匹配同语言的区域翻译,同时保持中文及其他默认文案行为不变。Bug Reproduction Steps
defaultLocale为zh-CN,Skills 和 MCP 默认文案为中文,只额外提供locales/en-US.json。locale=en。Root Cause
插件能力详情的 locale 选择只支持精确匹配,以及区域 locale 向基础语言的回退。请求为
en时只会查找en,不会命中en-US,因此返回 manifest 的默认文案。本次是根本修复:统一补全同语言区域版本的选择规则,不改客户端传参、接口协议或插件 manifest 格式。
Code Changes
在
PluginManager共享的 locale 选择逻辑中补全回退顺序,已安装插件详情和 marketplace preview 都经过这条路径,因此 Skills 与 MCP 可以同时修复。同语言区域版本只在前面的精确匹配和基础语言匹配均未命中时参与选择;如果
defaultLocale与请求属于同一语言,则优先使用默认语言文案。最终仍未命中时继续返回undefined,沿用现有 manifest 默认文案回退。阅读入口是
packages/agent-core-v2/src/app/plugin/manager.ts的pluginInterfaceForLocale;其余变更为对应回归测试。Behavior Changes and Affected Users
en,插件仅提供en-US.jsonen-US翻译en-GB,只存在同语言区域翻译影响模块为
agent-core-v2的插件详情与插件包 inspection。测试覆盖已安装插件的 Skills / MCP 文案、marketplace preview,以及en、en-US、en-GB、zh、zh-CN的选择结果。验证记录
pnpm --filter @moonshot-ai/agent-core-v2 exec vitest run test/app/plugin/manager.test.ts:28/28 passed。pnpm --filter @moonshot-ai/agent-core-v2 run typecheck:通过。git diff --check:通过。Checklist
gen-changesetsskill; changeset omitted at the author's explicit request.