refactor: split SDK RPC client#339
Conversation
🦋 Changeset detectedLatest commit: c559277 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 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 |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d7b1ec4fff
ℹ️ 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".
commit: |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4c39d31e99
ℹ️ 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".
| userAgentProduct: this.identity.userAgentProduct, | ||
| version: this.identity.version, |
There was a problem hiding this comment.
Preserve the identity user-agent suffix
When a host passes identity.userAgentSuffix, the local RPC client now rebuilds the headers with only userAgentProduct and version, so createKimiDefaultHeaders no longer receives the suffix and the generated User-Agent silently loses the host-provided qualifier. This regresses SDK callers that use the public KimiHostIdentity.userAgentSuffix to distinguish integrations; pass the full identity through as before instead of selecting only these two fields.
Useful? React with 👍 / 👎.
Related Issue
No linked issue. This change comes from maintainer discussion to make the SDK harness usable with a transport supplied by web integrations.
Problem
The SDK harness constructed its local in-memory RPC client internally, which made it hard for other runtimes to provide their own RPC transport without reworking the harness itself. CLI startup also needed to keep using the local runtime path after the constructor split.
What changed
Checklist
gen-changesetsskill, or this PR needs no changeset.gen-docsskill, or this PR needs no doc update.Verification
pnpm exec oxlint apps/kimi-code/src/cli/run-shell.ts apps/kimi-code/src/cli/run-prompt.ts apps/kimi-code/src/cli/sub/export.ts apps/kimi-code/test/cli/run-shell.test.ts apps/kimi-code/test/cli/run-prompt.test.ts apps/kimi-code/test/cli/export.test.ts apps/kimi-code/test/e2e/real-llm-smoke.e2e.test.ts apps/kimi-code/test/e2e/local-logging-export.e2e.test.ts packages/node-sdk/examples/kimi-harness-auth-smoke.ts packages/node-sdk/examples/t8-race-create.ts packages/node-sdk/src/kimi-harness.ts packages/node-sdk/src/local-rpc.tspnpm -C packages/node-sdk run typecheckpnpm -C apps/kimi-code run typecheckpnpm -C apps/kimi-code exec vitest run test/cli/run-shell.test.ts test/cli/run-prompt.test.ts test/cli/export.test.tspnpm dev:cli -- migrate