Repository navigation
chore: remove unused kaos package and MCP kaos executor option - #4184
Conversation
|
@codex review |
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. |
🦋 Changeset detectedLatest commit: c0c0898 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
commit: |
|
❌ Nix build failed Hash mismatch in
Please update |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e3065a9386
ℹ️ 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".
| function resumeCoalesceKey(id: string, input: ResumeSessionInput): string { | ||
| const { kaos, persistenceKaos, ...rest } = input; | ||
| return JSON.stringify({ | ||
| ...rest, | ||
| id, | ||
| kaos: kaos !== undefined, | ||
| persistenceKaos: persistenceKaos !== undefined, | ||
| }); | ||
| return JSON.stringify({ ...input, id }); |
There was a problem hiding this comment.
Strip legacy kaos objects before serializing the resume key
When a previously compiled or JavaScript SDK host upgrades but still passes the formerly valid kaos or persistenceKaos option, this now serializes the complete object. Custom Kaos implementations may contain circular runtime handles, so resumeSession can throw a TypeError before reaching the RPC; the previous implementation deliberately represented these values as booleans and therefore accepted such objects. Continue excluding the legacy fields from the coalescing key even after removing them from the TypeScript interface.
AGENTS.md reference: AGENTS.md:L97-L99
Useful? React with 👍 / 👎.
| if (active !== undefined && !active.isClosed) { | ||
| if (kaos !== undefined || persistenceKaos !== undefined) { | ||
| await this.rpc.resumeSessionWithKaos({ ...resumeInput, id }, kaos ?? persistenceKaos as Kaos, persistenceKaos); | ||
| } else if (input.agentProfile !== undefined) { | ||
| if (input.agentProfile !== undefined) { | ||
| await this.rpc.resumeSession({ ...resumeInput, id }); |
There was a problem hiding this comment.
Preserve option application when resuming an active session
For an SDK host that resumes an already-active session with a legacy kaos argument plus additionalDirs, the old kaos branch called resumeSessionWithKaos, which delegated to resumeSession and merged those directories; this replacement now calls the RPC only when agentProfile is present, silently dropping additionalDirs. This also means the documented escape hatch of merely removing the kaos argument cannot preserve the old behavior, so the active-session branch should still forward options that require re-resumption.
AGENTS.md reference: AGENTS.md:L97-L99
Useful? React with 👍 / 👎.
| "@moonshot-ai/kimi-code-sdk": minor | ||
| --- | ||
|
|
||
| Remove the `kaos` / `persistenceKaos` session options and the `createSessionWithKaos` / `resumeSessionWithKaos` client methods. They were already ignored at runtime; hosts should drop these arguments. The internal `@moonshot-ai/kaos` package has been removed from the repository. |
There was a problem hiding this comment.
Rewrite the changesets as single user-facing sentences
This changeset contains three sentences, including implementation detail about the internal package, and the accompanying MCP changeset likewise contains two sentences. Repository workflow requires each changeset to be exactly one short user-facing sentence stating only what changed, so both entries need to be condensed before release-note generation.
AGENTS.md reference: AGENTS.md:L84-L86
Useful? React with 👍 / 👎.
| env: StringRecordSchema.optional(), | ||
| cwd: z.string().optional(), | ||
| executor: z.enum(['local', 'kaos']).optional(), | ||
| executor: z.enum(['local']).optional(), |
There was a problem hiding this comment.
Prevent one legacy executor from disabling every MCP server
When any user, project, or workspace MCP file contains one legacy executor: "kaos" entry alongside otherwise valid servers, narrowing this schema makes parseMcpJsonServers reject the whole file; the three layers are loaded through one Promise.all, and WorkspaceMcpConfigService catches the initialization failure only by logging it, leaving its complete server set empty. Previously the file loaded and only the unsupported kaos entry failed during its independent connection attempt, so this silently removes every working MCP tool rather than merely reporting the legacy entry as invalid.
AGENTS.md reference: AGENTS.md:L117-L119
Useful? React with 👍 / 👎.
| @@ -0,0 +1,5 @@ | |||
| --- | |||
| "@moonshot-ai/kimi-code-sdk": minor | |||
There was a problem hiding this comment.
Mark the SDK API removal as a breaking release
Removing the exported session option properties and SDKRpcClientBase methods makes existing TypeScript hosts fail compilation and existing JavaScript calls find the methods undefined, but this changeset requests only a minor SDK bump. Preserve compatibility shims or obtain the required confirmation and use the repository-mandated major bump so consumers are not given a non-breaking release signal for a public API removal.
AGENTS.md reference: AGENTS.md:L62-L62
Useful? React with 👍 / 👎.
…ondense changesets
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 18a32439ab
ℹ️ 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".
| const { planMode, sessionStartedProperties, ...coreOptions } = options; | ||
| const summary = await this.rpc.createSession(coreOptions); |
There was a problem hiding this comment.
Strip legacy kaos fields before forwarding session RPCs
When a previously compiled JavaScript host still supplies a legacy kaos or persistenceKaos object and its public SDKRpcClientBase subclass serializes RPC inputs, coreOptions now retains that object and can fail on circular runtime handles before session creation; previously the harness removed both fields before invoking the ordinary RPC. The same leak occurs in doResumeSession. The new resumeCoalesceKey fix is fresh evidence that these objects may be circular, but it strips them only from the map key rather than from the RPC payload, so both lifecycle paths should discard the legacy fields before forwarding.
AGENTS.md reference: AGENTS.md:L97-L99
Useful? React with 👍 / 👎.
|
@codex review |
|
Codex Review: Didn't find any major issues. Chef's kiss. Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
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". |
|
@codex review |
|
Codex Review: Didn't find any major issues. You're on a roll. Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
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". |
Requirement or Bug
内部包
@moonshot-ai/kaos已无任何运行时使用者,将其整体删除,并清理 SDK 公共 API 与 MCP 配置中残留的 kaos 引用。Bug Reproduction Steps
N/A
Root Cause
N/A
Code Changes
关键设计点:MCP 的
executor字段本身保留,只收窄枚举。zod 默认剥离未知 key,若整个字段删除,写了executor = "kaos"的旧配置会被静默忽略并直接在本地启动 server;收窄枚举后这类配置在加载时显式报CONFIG_INVALID。Behavior Changes and Affected Users
CreateSessionOptions.kaos/persistenceKaos选项SDKRpcClientBase.createSessionWithKaos/resumeSessionWithKaos方法createSession/resumeSessionKaos类型executor = "kaos"NOT_IMPLEMENTED(该值从未可用,同文件其他 server 不受影响)CONFIG_INVALID,同文件其他 server 一并不可用直至移除该条目(经 review 评估后接受的取舍,避免该值被静默忽略)executor = "kaos"的用户(从未有可工作行为)executor字段或改为"local"executor = "local"或未设置~/.kimi/kimi.json中的kaos字段(migration-legacy 读取的历史数据)受影响模块与验证:
packages/node-sdk:typecheck + 完整 build(tsdown + api-extractor d.ts rollup)通过,公开 d.ts 中已无Kaospackages/agent-core-v2:mcpCore 测试 144/144;import-boundaries lint 测试 21/21;typecheck 通过packages/klient:契约测试 10/10、typecheck(含编译期 contract parity)通过apps/kimi-code/apps/vscode:typecheck 通过scripts/check-nix-workspace.mjs通过;全仓@moonshot-ai/kaos引用零残留Checklist
/approve).gen-changesetsskill, or this PR needs no changeset.gen-docsskill, or this PR needs no doc update.