Skip to content

Commit 4f907c1

Browse files
committed
canopy wave kimi
1 parent 4cc9156 commit 4f907c1

15 files changed

Lines changed: 132 additions & 142 deletions

File tree

agents/__tests__/editor.test.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@ describe('editor agent', () => {
6262
expect(gpt5Editor.model).toBe('openai/gpt-5.1')
6363
})
6464

65-
test('creates glm editor', () => {
66-
const glmEditor = createCodeEditor({ model: 'glm' })
67-
expect(glmEditor.model).toBe('z-ai/glm-5.1')
65+
test('creates kimi editor', () => {
66+
const kimiEditor = createCodeEditor({ model: 'kimi' })
67+
expect(kimiEditor.model).toBe('moonshotai/kimi-k2.6')
6868
})
6969

7070
test('creates minimax editor', () => {
@@ -78,10 +78,10 @@ describe('editor agent', () => {
7878
expect(gpt5Editor.instructionsPrompt).not.toContain('</think>')
7979
})
8080

81-
test('glm editor does not include think tags in instructions', () => {
82-
const glmEditor = createCodeEditor({ model: 'glm' })
83-
expect(glmEditor.instructionsPrompt).not.toContain('<think>')
84-
expect(glmEditor.instructionsPrompt).not.toContain('</think>')
81+
test('kimi editor does not include think tags in instructions', () => {
82+
const kimiEditor = createCodeEditor({ model: 'kimi' })
83+
expect(kimiEditor.instructionsPrompt).not.toContain('<think>')
84+
expect(kimiEditor.instructionsPrompt).not.toContain('</think>')
8585
})
8686

8787
test('minimax editor does not include think tags in instructions', () => {
@@ -99,17 +99,17 @@ describe('editor agent', () => {
9999
test('all variants have same base properties', () => {
100100
const opusEditor = createCodeEditor({ model: 'opus' })
101101
const gpt5Editor = createCodeEditor({ model: 'gpt-5' })
102-
const glmEditor = createCodeEditor({ model: 'glm' })
102+
const kimiEditor = createCodeEditor({ model: 'kimi' })
103103

104104
// All should have same basic structure
105105
expect(opusEditor.displayName).toBe(gpt5Editor.displayName)
106-
expect(gpt5Editor.displayName).toBe(glmEditor.displayName)
106+
expect(gpt5Editor.displayName).toBe(kimiEditor.displayName)
107107

108108
expect(opusEditor.outputMode).toBe(gpt5Editor.outputMode)
109-
expect(gpt5Editor.outputMode).toBe(glmEditor.outputMode)
109+
expect(gpt5Editor.outputMode).toBe(kimiEditor.outputMode)
110110

111111
expect(opusEditor.toolNames).toEqual(gpt5Editor.toolNames)
112-
expect(gpt5Editor.toolNames).toEqual(glmEditor.toolNames)
112+
expect(gpt5Editor.toolNames).toEqual(kimiEditor.toolNames)
113113
})
114114
})
115115

agents/base2/base2.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export function createBase2(
2525
const isFree = mode === 'free' || mode === 'lite'
2626

2727
const isSonnet = false
28-
const model = isFree ? 'z-ai/glm-5.1' : 'anthropic/claude-opus-4.7'
28+
const model = isFree ? 'moonshotai/kimi-k2.6' : 'anthropic/claude-opus-4.7'
2929

3030
return {
3131
publisher,

agents/editor/editor-lite.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { createCodeEditor } from './editor'
33
import type { AgentDefinition } from '../types/agent-definition'
44

55
const definition: AgentDefinition = {
6-
...createCodeEditor({ model: 'glm' }),
6+
...createCodeEditor({ model: 'kimi' }),
77
id: 'editor-lite',
88
}
99
export default definition

agents/editor/editor.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { publisher } from '../constants'
44
import type { AgentDefinition } from '../types/agent-definition'
55

66
export const createCodeEditor = (options: {
7-
model: 'gpt-5' | 'opus' | 'glm' | 'minimax'
7+
model: 'gpt-5' | 'opus' | 'kimi' | 'minimax'
88
}): Omit<AgentDefinition, 'id'> => {
99
const { model } = options
1010
return {
@@ -14,8 +14,8 @@ export const createCodeEditor = (options: {
1414
? 'openai/gpt-5.1'
1515
: options.model === 'minimax'
1616
? 'minimax/minimax-m2.7'
17-
: options.model === 'glm'
18-
? 'z-ai/glm-5.1'
17+
: options.model === 'kimi'
18+
? 'moonshotai/kimi-k2.6'
1919
: 'anthropic/claude-opus-4.7',
2020
...(options.model === 'opus' && {
2121
providerOptions: {
@@ -67,7 +67,7 @@ OR for new files or major rewrites:
6767
}
6868
</codebuff_tool_call>
6969
70-
${model === 'gpt-5' || model === 'glm' || model === 'minimax'
70+
${model === 'gpt-5' || model === 'kimi' || model === 'minimax'
7171
? ''
7272
: `Before you start writing your implementation, you should use <think> tags to think about the best way to implement the changes.
7373

agents/reviewer/code-reviewer-lite.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { createReviewer } from './code-reviewer'
55
const definition: SecretAgentDefinition = {
66
id: 'code-reviewer-lite',
77
publisher,
8-
...createReviewer('z-ai/glm-5.1'),
8+
...createReviewer('moonshotai/kimi-k2.6'),
99
}
1010

1111
export default definition

cli/src/components/freebuff-model-selector.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import React, { useCallback, useEffect, useMemo, useState } from 'react'
55
import { Button } from './button'
66
import {
77
FALLBACK_FREEBUFF_MODEL_ID,
8-
FREEBUFF_GLM_MODEL_ID,
8+
FREEBUFF_KIMI_MODEL_ID,
99
FREEBUFF_MODELS,
1010
getFreebuffDeploymentAvailabilityLabel,
1111
isFreebuffModelAvailable,
@@ -25,8 +25,8 @@ import {
2525
import type { KeyEvent } from '@opentui/core'
2626

2727
const FREEBUFF_MODEL_SELECTOR_MODELS = [
28-
...FREEBUFF_MODELS.filter((model) => model.id === FREEBUFF_GLM_MODEL_ID),
29-
...FREEBUFF_MODELS.filter((model) => model.id !== FREEBUFF_GLM_MODEL_ID),
28+
...FREEBUFF_MODELS.filter((model) => model.id === FREEBUFF_KIMI_MODEL_ID),
29+
...FREEBUFF_MODELS.filter((model) => model.id !== FREEBUFF_KIMI_MODEL_ID),
3030
]
3131

3232
/**

common/src/constants/free-agents.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export const FREE_MODE_AGENT_MODELS: Record<string, Set<string>> = {
2828
// Root orchestrator
2929
'base2-free': new Set([
3030
'minimax/minimax-m2.7',
31-
'z-ai/glm-5.1',
31+
'moonshotai/kimi-k2.6',
3232
]),
3333

3434
// File exploration agents
@@ -46,13 +46,13 @@ export const FREE_MODE_AGENT_MODELS: Record<string, Set<string>> = {
4646
// Editor for free mode
4747
'editor-lite': new Set([
4848
'minimax/minimax-m2.7',
49-
'z-ai/glm-5.1',
49+
'moonshotai/kimi-k2.6',
5050
]),
5151

5252
// Code reviewer for free mode
5353
'code-reviewer-lite': new Set([
5454
'minimax/minimax-m2.7',
55-
'z-ai/glm-5.1',
55+
'moonshotai/kimi-k2.6',
5656
]),
5757
}
5858

common/src/constants/freebuff-models.ts

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export interface FreebuffModelOption {
2121
* the caller's local timezone. The CLI should render
2222
* `getFreebuffDeploymentAvailabilityLabel()` instead. */
2323
export const FREEBUFF_DEPLOYMENT_HOURS_LABEL = '9am ET-5pm PT every day'
24-
export const FREEBUFF_GLM_MODEL_ID = 'z-ai/glm-5.1'
24+
export const FREEBUFF_KIMI_MODEL_ID = 'moonshotai/kimi-k2.6'
2525
export const FREEBUFF_MINIMAX_MODEL_ID = 'minimax/minimax-m2.7'
2626
const FREEBUFF_EASTERN_TIMEZONE = 'America/New_York'
2727
const FREEBUFF_PACIFIC_TIMEZONE = 'America/Los_Angeles'
@@ -47,20 +47,17 @@ export const FREEBUFF_MODELS = [
4747
availability: 'always',
4848
},
4949
{
50-
id: FREEBUFF_GLM_MODEL_ID,
51-
displayName: 'GLM 5.1',
50+
id: FREEBUFF_KIMI_MODEL_ID,
51+
displayName: 'Kimi K2.6',
5252
tagline: 'Smartest',
53-
availability: 'deployment_hours',
53+
availability: 'always',
5454
},
5555
] as const satisfies readonly FreebuffModelOption[]
5656

5757
export type FreebuffModelId = (typeof FREEBUFF_MODELS)[number]['id']
5858

59-
/** What new freebuff users see selected in the picker. May not be currently
60-
* available (GLM is closed outside deployment hours); callers that need an
61-
* always-available id for resolution / auto-fallbacks should use
62-
* FALLBACK_FREEBUFF_MODEL_ID instead. */
63-
export const DEFAULT_FREEBUFF_MODEL_ID: FreebuffModelId = FREEBUFF_GLM_MODEL_ID
59+
/** What new freebuff users see selected in the picker. */
60+
export const DEFAULT_FREEBUFF_MODEL_ID: FreebuffModelId = FREEBUFF_KIMI_MODEL_ID
6461

6562
/** Always-available fallback used when the requested model can't be served
6663
* right now (unknown id, deployment hours closed, etc.). Kept distinct from

web/src/app/api/v1/chat/completions/_post.ts

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -532,9 +532,10 @@ export async function postChatCompletions(params: {
532532
if (bodyStream) {
533533
// Streaming request — route to SiliconFlow/CanopyWave/Fireworks for supported models
534534
const useSiliconFlow = false // isSiliconFlowModel(typedBody.model)
535-
const useCanopyWave = false // isCanopyWaveModel(typedBody.model)
536-
const useFireworks = isFireworksModel(typedBody.model)
537-
const useOpenAIDirect = !useFireworks && isOpenAIDirectModel(typedBody.model)
535+
const useCanopyWave = isCanopyWaveModel(typedBody.model)
536+
const useFireworks = !useCanopyWave && isFireworksModel(typedBody.model)
537+
const useOpenAIDirect =
538+
!useCanopyWave && !useFireworks && isOpenAIDirectModel(typedBody.model)
538539
const stream = useSiliconFlow
539540
? await handleSiliconFlowStream({
540541
body: typedBody,
@@ -606,12 +607,12 @@ export async function postChatCompletions(params: {
606607
})
607608
} else {
608609
// Non-streaming request — route to SiliconFlow/CanopyWave/Fireworks for supported models
609-
// TEMPORARILY DISABLED: route through OpenRouter
610610
const model = typedBody.model
611611
const useSiliconFlow = false // isSiliconFlowModel(model)
612-
const useCanopyWave = false // isCanopyWaveModel(model)
613-
const useFireworks = isFireworksModel(model)
614-
const shouldUseOpenAIEndpoint = !useFireworks && isOpenAIDirectModel(model)
612+
const useCanopyWave = isCanopyWaveModel(model)
613+
const useFireworks = !useCanopyWave && isFireworksModel(model)
614+
const shouldUseOpenAIEndpoint =
615+
!useCanopyWave && !useFireworks && isOpenAIDirectModel(model)
615616

616617
const nonStreamRequest = useSiliconFlow
617618
? handleSiliconFlowNonStream({

web/src/app/api/v1/freebuff/session/__tests__/session.test.ts

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -158,19 +158,6 @@ describe('POST /api/v1/freebuff/session', () => {
158158
expect(body.status).toBe('queued')
159159
})
160160

161-
test('returns model_unavailable for GLM outside deployment hours', async () => {
162-
const sessionDeps = makeSessionDeps()
163-
const resp = await postFreebuffSession(
164-
makeReq('ok', { model: 'z-ai/glm-5.1' }),
165-
makeDeps(sessionDeps, 'u1'),
166-
)
167-
expect(resp.status).toBe(409)
168-
const body = await resp.json()
169-
expect(body.status).toBe('model_unavailable')
170-
expect(body.availableHours).toBe('9am ET-5pm PT every day')
171-
expect(sessionDeps.rows.size).toBe(0)
172-
})
173-
174161
// Banned bots with valid API keys were POSTing every few seconds and
175162
// inflating queueDepth between the 15s admission-tick sweeps. Rejecting at
176163
// the HTTP layer with 403 (terminal, like country_blocked) keeps them out

0 commit comments

Comments
 (0)