Skip to content

Commit cf509f8

Browse files
committed
New GLM 4.7 editor for Lite mode!
1 parent b99f7a2 commit cf509f8

File tree

3 files changed

+17
-7
lines changed

3 files changed

+17
-7
lines changed

agents/base2/base2.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ export function createBase2(
7676
isDefault && 'thinker',
7777
(isDefault || isMax) && ['opus-agent', 'gpt-5-agent'],
7878
isMax && 'thinker-best-of-n-opus',
79-
isLite && 'editor-gpt-5',
79+
isLite && 'editor-glm',
8080
isDefault && 'editor',
8181
isMax && 'editor-multi-prompt',
8282
isDefault && 'code-reviewer',
@@ -134,7 +134,7 @@ Use the spawn_agents tool to spawn specialized agents to help you complete the u
134134
${buildArray(
135135
'- Spawn context-gathering agents (file pickers, code-searcher, directory-lister, glob-matcher, and web/docs researchers) before making edits.',
136136
isLite &&
137-
'- Spawn the editor-gpt-5 agent to implement the changes after you have gathered all the context you need.',
137+
'- Spawn the editor-glm agent to implement the changes after you have gathered all the context you need.',
138138
isDefault &&
139139
'- Spawn the editor agent to implement the changes after you have gathered all the context you need.',
140140
(isDefault || isMax) &&
@@ -199,7 +199,7 @@ ${isDefault
199199
: isFast
200200
? '[ You implement the changes using the str_replace or write_file tools ]'
201201
: isLite
202-
? '[ You implement the changes using the editor-gpt-5 agent ]'
202+
? '[ You implement the changes using the editor-glm agent ]'
203203
: '[ You implement the changes using the editor-multi-prompt agent ]'
204204
}
205205
@@ -321,7 +321,7 @@ ${buildArray(
321321
(isDefault || isMax) &&
322322
`- For quick problems, briefly explain your reasoning to the user. If you need to think longer, write your thoughts within the <think> tags. Finally, for complex problems, spawn the thinker agent to help find the best solution. (gpt-5-agent is a last resort for complex problems)`,
323323
isLite &&
324-
'- IMPORTANT: You must spawn the editor-gpt-5 agent to implement the changes after you have gathered all the context you need. This agent will do the best job of implementing the changes so you must spawn it for all changes. Do not pass any prompt or params to the editor agent when spawning it. It will make its own best choices of what to do.',
324+
'- IMPORTANT: You must spawn the editor-glm agent to implement the changes after you have gathered all the context you need. This agent will do the best job of implementing the changes so you must spawn it for all changes. Do not pass any prompt or params to the editor agent when spawning it. It will make its own best choices of what to do.',
325325
isDefault &&
326326
'- IMPORTANT: You must spawn the editor agent to implement the changes after you have gathered all the context you need. This agent will do the best job of implementing the changes so you must spawn it for all non-trivial changes. Do not pass any prompt or params to the editor agent when spawning it. It will make its own best choices of what to do.',
327327
isMax &&

agents/editor/editor-glm.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { createCodeEditor } from './editor'
2+
import type { AgentDefinition } from 'types/agent-definition'
3+
4+
const definition: AgentDefinition = {
5+
...createCodeEditor({ model: 'glm' }),
6+
id: 'editor-glm',
7+
}
8+
export default definition

agents/editor/editor.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,17 @@ import { AgentDefinition, StepText } from 'types/agent-definition'
22
import { publisher } from '../constants'
33

44
export const createCodeEditor = (options: {
5-
model: 'gpt-5' | 'opus'
5+
model: 'gpt-5' | 'opus' | 'glm'
66
}): Omit<AgentDefinition, 'id'> => {
77
const { model } = options
88
return {
99
publisher,
1010
model:
1111
options.model === 'gpt-5'
1212
? 'openai/gpt-5.1'
13-
: 'anthropic/claude-opus-4.5',
13+
: options.model === 'glm'
14+
? 'z-ai/glm-4.7'
15+
: 'anthropic/claude-opus-4.5',
1416
displayName: 'Code Editor',
1517
spawnerPrompt:
1618
"Expert code editor that implements code changes based on the user's request. Do not specify an input prompt for this agent; it inherits the context of the entire conversation with the user. Make sure to read any files intended to be edited before spawning this agent as it cannot read files on its own.",
@@ -57,7 +59,7 @@ OR for new files or major rewrites:
5759
</codebuff_tool_call>
5860
5961
${
60-
model === 'gpt-5'
62+
model === 'gpt-5' || model === 'glm'
6163
? ''
6264
: `Before you start writing your implementation, you should use <think> tags to think about the best way to implement the changes.
6365

0 commit comments

Comments
 (0)