Skip to content

Commit 92a5ba1

Browse files
Update Kimi model references to kimi-k2.7-code and bump partyserver to 0.5.8 (#1757)
* chore(agents): bump partyserver to ^0.5.8 Updates the `partyserver` dependency from ^0.5.7 to ^0.5.8 (base64-encodes the x-partykit-props header so non-ASCII props no longer trigger workerd's non-ASCII header warning). Adds a patch changeset for the `agents` package. Co-authored-by: Cursor <cursoragent@cursor.com> * docs: update Workers AI model references to @cf/moonshotai/kimi-k2.7-code Replaces all Kimi model references (kimi-k2.5 / kimi-k2.6) across packages, examples, experimental apps, docs, design notes, guides, and starters with the new @cf/moonshotai/kimi-k2.7-code model. The voice-agent UI selector key "kimi" is left unchanged as it is a UI toggle value, not a model identifier. Co-authored-by: Cursor <cursoragent@cursor.com> * fix lockfile --------- Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 151d457 commit 92a5ba1

103 files changed

Lines changed: 162 additions & 201 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
"agents": patch
3+
---
4+
5+
Bump the `partyserver` dependency to `^0.5.8`, which base64-encodes the
6+
`x-partykit-props` header so props containing non-ASCII characters (e.g.
7+
accented names) no longer trigger workerd's "header value contains non-ASCII
8+
characters" warning (which throws a `TypeError` in browser fetch
9+
implementations). The header is decoded back to the original Unicode payload on
10+
the server, and raw-JSON values from older callers are still accepted for
11+
backwards compatibility.

‎design/chat-api.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export class MyAgent extends AIChatAgent<Env> {
3838
): Promise<Response | undefined> {
3939
const result = streamText({
4040
model: createWorkersAI({ binding: this.env.AI })(
41-
"@cf/moonshotai/kimi-k2.6"
41+
"@cf/moonshotai/kimi-k2.7-code"
4242
),
4343
system: "You are a helpful assistant.",
4444
messages: pruneMessages({

‎design/think-sessions.md‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ For agents that don't need context blocks, `getSystemPrompt()` still works exact
436436
export class SimpleAgent extends Think<Env> {
437437
getModel() {
438438
return createWorkersAI({ binding: this.env.AI })(
439-
"@cf/moonshotai/kimi-k2.6"
439+
"@cf/moonshotai/kimi-k2.7-code"
440440
);
441441
}
442442
getSystemPrompt() {
@@ -804,7 +804,7 @@ This is an advanced feature. Most agents use the default single-session mode and
804804
export class ChatAgent extends Think<Env> {
805805
getModel() {
806806
return createWorkersAI({ binding: this.env.AI })(
807-
"@cf/moonshotai/kimi-k2.6"
807+
"@cf/moonshotai/kimi-k2.7-code"
808808
);
809809
}
810810
}
@@ -818,7 +818,7 @@ No `configureSession` needed. No context blocks. `getSystemPrompt()` returns the
818818
export class ChatAgent extends Think<Env> {
819819
getModel() {
820820
return createWorkersAI({ binding: this.env.AI })(
821-
"@cf/moonshotai/kimi-k2.6"
821+
"@cf/moonshotai/kimi-k2.7-code"
822822
);
823823
}
824824
getSystemPrompt() {
@@ -833,7 +833,7 @@ export class ChatAgent extends Think<Env> {
833833
export class MemoryAgent extends Think<Env> {
834834
getModel() {
835835
return createWorkersAI({ binding: this.env.AI })(
836-
"@cf/moonshotai/kimi-k2.6"
836+
"@cf/moonshotai/kimi-k2.7-code"
837837
);
838838
}
839839

@@ -866,7 +866,7 @@ import { createCompactFunction } from "agents/experimental/memory/utils";
866866
export class LongChatAgent extends Think<Env> {
867867
getModel() {
868868
return createWorkersAI({ binding: this.env.AI })(
869-
"@cf/moonshotai/kimi-k2.6"
869+
"@cf/moonshotai/kimi-k2.7-code"
870870
);
871871
}
872872

@@ -895,7 +895,7 @@ import { R2SkillProvider } from "agents/experimental/memory/session";
895895
export class KnowledgeAgent extends Think<Env> {
896896
getModel() {
897897
return createWorkersAI({ binding: this.env.AI })(
898-
"@cf/moonshotai/kimi-k2.6"
898+
"@cf/moonshotai/kimi-k2.7-code"
899899
);
900900
}
901901

@@ -919,7 +919,7 @@ System prompt shows skill metadata (list of available docs). Model uses `load_co
919919
export class TrackedAgent extends Think<Env> {
920920
getModel() {
921921
return createWorkersAI({ binding: this.env.AI })(
922-
"@cf/moonshotai/kimi-k2.6"
922+
"@cf/moonshotai/kimi-k2.7-code"
923923
);
924924
}
925925

‎design/think-vs-aichat.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ If you don't need context blocks, compaction, search, or multi-session, AIChatAg
126126
export class MyAgent extends Think<Env> {
127127
getModel() {
128128
return createWorkersAI({ binding: this.env.AI })(
129-
"@cf/moonshotai/kimi-k2.6"
129+
"@cf/moonshotai/kimi-k2.7-code"
130130
);
131131
}
132132
}

‎design/think.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ Think requires almost no boilerplate. The minimal subclass overrides one method:
7777
export class ChatSession extends Think<Env> {
7878
getModel() {
7979
return createWorkersAI({ binding: this.env.AI })(
80-
"@cf/moonshotai/kimi-k2.6"
80+
"@cf/moonshotai/kimi-k2.7-code"
8181
);
8282
}
8383
}

‎docs/chat-agents.md‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export class ChatAgent extends AIChatAgent {
4040
const workersai = createWorkersAI({ binding: this.env.AI });
4141

4242
const result = streamText({
43-
model: workersai("@cf/moonshotai/kimi-k2.6"),
43+
model: workersai("@cf/moonshotai/kimi-k2.7-code"),
4444
messages: await convertToModelMessages(this.messages)
4545
});
4646

@@ -166,7 +166,7 @@ async onChatMessage() {
166166
const workersai = createWorkersAI({ binding: this.env.AI });
167167

168168
const result = streamText({
169-
model: workersai("@cf/moonshotai/kimi-k2.6"),
169+
model: workersai("@cf/moonshotai/kimi-k2.7-code"),
170170
system: "You are a helpful assistant.",
171171
messages: await convertToModelMessages(this.messages)
172172
});
@@ -221,7 +221,7 @@ async onChatMessage() {
221221
const workersai = createWorkersAI({ binding: this.env.AI });
222222

223223
const result = streamText({
224-
model: workersai("@cf/moonshotai/kimi-k2.6"),
224+
model: workersai("@cf/moonshotai/kimi-k2.7-code"),
225225
messages: pruneMessages({
226226
messages: await convertToModelMessages(this.messages),
227227
reasoning: "before-last-message",
@@ -577,7 +577,7 @@ When a user clicks "stop" in the chat UI, the client sends a `CF_AGENT_CHAT_REQU
577577
```typescript
578578
async onChatMessage(_onFinish, options) {
579579
const result = streamText({
580-
model: workersai("@cf/moonshotai/kimi-k2.6"),
580+
model: workersai("@cf/moonshotai/kimi-k2.7-code"),
581581
messages: await convertToModelMessages(this.messages),
582582
abortSignal: options?.abortSignal // Pass through for cancellation
583583
});
@@ -927,7 +927,7 @@ async onChatMessage() {
927927
const workersai = createWorkersAI({ binding: this.env.AI });
928928

929929
const result = streamText({
930-
model: workersai("@cf/moonshotai/kimi-k2.6"),
930+
model: workersai("@cf/moonshotai/kimi-k2.7-code"),
931931
messages: await convertToModelMessages(this.messages),
932932
tools: {
933933
getWeather: tool({
@@ -994,7 +994,7 @@ import { createToolsFromClientSchemas } from "@cloudflare/ai-chat";
994994

995995
async onChatMessage(_onFinish, options) {
996996
const result = streamText({
997-
model: workersai("@cf/moonshotai/kimi-k2.6"),
997+
model: workersai("@cf/moonshotai/kimi-k2.7-code"),
998998
messages: await convertToModelMessages(this.messages),
999999
tools: createToolsFromClientSchemas(options?.clientTools)
10001000
});
@@ -1165,7 +1165,7 @@ export class ChatAgent extends AIChatAgent {
11651165
const stream = createUIMessageStream({
11661166
execute: async ({ writer }) => {
11671167
const result = streamText({
1168-
model: workersai("@cf/moonshotai/kimi-k2.6"),
1168+
model: workersai("@cf/moonshotai/kimi-k2.7-code"),
11691169
messages: await convertToModelMessages(this.messages)
11701170
});
11711171

@@ -1357,7 +1357,7 @@ export class ChatAgent extends AIChatAgent {
13571357

13581358
async onChatMessage() {
13591359
const result = streamText({
1360-
model: workersai("@cf/moonshotai/kimi-k2.6"),
1360+
model: workersai("@cf/moonshotai/kimi-k2.7-code"),
13611361
messages: pruneMessages({
13621362
// LLM context limit
13631363
messages: await convertToModelMessages(this.messages),
@@ -1382,7 +1382,7 @@ import { createWorkersAI } from "workers-ai-provider";
13821382

13831383
const workersai = createWorkersAI({ binding: this.env.AI });
13841384
const result = streamText({
1385-
model: workersai("@cf/moonshotai/kimi-k2.6"),
1385+
model: workersai("@cf/moonshotai/kimi-k2.7-code"),
13861386
messages: await convertToModelMessages(this.messages)
13871387
});
13881388
```

‎docs/client-tools-continuation.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export class MyAgent extends AIChatAgent {
2424
const workersai = createWorkersAI({ binding: this.env.AI });
2525

2626
const result = streamText({
27-
model: workersai("@cf/moonshotai/kimi-k2.6"),
27+
model: workersai("@cf/moonshotai/kimi-k2.7-code"),
2828
messages: await convertToModelMessages(this.messages),
2929
tools: {
3030
// Client-side tool: no execute function

‎docs/codemode.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ export class BrowserCodemodeAgent extends AIChatAgent<Env> {
230230
const workersai = createWorkersAI({ binding: this.env.AI });
231231

232232
const result = streamText({
233-
model: workersai("@cf/moonshotai/kimi-k2.5"),
233+
model: workersai("@cf/moonshotai/kimi-k2.7-code"),
234234
messages: await convertToModelMessages(this.messages),
235235
tools: createToolsFromClientSchemas(options?.clientTools),
236236
stopWhen: stepCountIs(10)

‎docs/configuration.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ For Workers AI integration:
154154
Access in your agent:
155155

156156
```typescript
157-
const response = await this.env.AI.run("@cf/moonshotai/kimi-k2.6", {
157+
const response = await this.env.AI.run("@cf/moonshotai/kimi-k2.7-code", {
158158
prompt: "Hello!"
159159
});
160160
```

‎docs/human-in-the-loop.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ export class MyAgent extends AIChatAgent {
203203
const workersai = createWorkersAI({ binding: this.env.AI });
204204

205205
const result = streamText({
206-
model: workersai("@cf/moonshotai/kimi-k2.6"),
206+
model: workersai("@cf/moonshotai/kimi-k2.7-code"),
207207
messages: await convertToModelMessages(this.messages),
208208
tools: {
209209
// Tool with conditional approval
@@ -370,7 +370,7 @@ export class MyAgent extends AIChatAgent {
370370
const workersai = createWorkersAI({ binding: this.env.AI });
371371

372372
const result = streamText({
373-
model: workersai("@cf/moonshotai/kimi-k2.6"),
373+
model: workersai("@cf/moonshotai/kimi-k2.7-code"),
374374
messages: await convertToModelMessages(this.messages),
375375
tools: {
376376
// No execute function - client handles via onToolCall

0 commit comments

Comments
 (0)