@@ -5,9 +5,7 @@ import editor, { createCodeEditor } from '../editor/editor'
55import type { AgentState , ToolCall } from '../types/agent-definition'
66
77describe ( 'editor agent' , ( ) => {
8- const createMockAgentState = (
9- messageHistory : any [ ] = [ ] ,
10- ) : AgentState => ( {
8+ const createMockAgentState = ( messageHistory : any [ ] = [ ] ) : AgentState => ( {
119 agentId : 'editor-test' ,
1210 runId : 'test-run' ,
1311 parentId : undefined ,
@@ -67,6 +65,11 @@ describe('editor agent', () => {
6765 expect ( glmEditor . model ) . toBe ( 'z-ai/glm-5.1' )
6866 } )
6967
68+ test ( 'creates kimi editor' , ( ) => {
69+ const kimiEditor = createCodeEditor ( { model : 'kimi' } )
70+ expect ( kimiEditor . model ) . toBe ( 'moonshotai/kimi-k2.6' )
71+ } )
72+
7073 test ( 'creates minimax editor' , ( ) => {
7174 const minimaxEditor = createCodeEditor ( { model : 'minimax' } )
7275 expect ( minimaxEditor . model ) . toBe ( 'minimax/minimax-m2.7' )
@@ -84,6 +87,12 @@ describe('editor agent', () => {
8487 expect ( glmEditor . instructionsPrompt ) . not . toContain ( '</think>' )
8588 } )
8689
90+ test ( 'kimi editor does not include think tags in instructions' , ( ) => {
91+ const kimiEditor = createCodeEditor ( { model : 'kimi' } )
92+ expect ( kimiEditor . instructionsPrompt ) . not . toContain ( '<think>' )
93+ expect ( kimiEditor . instructionsPrompt ) . not . toContain ( '</think>' )
94+ } )
95+
8796 test ( 'minimax editor does not include think tags in instructions' , ( ) => {
8897 const minimaxEditor = createCodeEditor ( { model : 'minimax' } )
8998 expect ( minimaxEditor . instructionsPrompt ) . not . toContain ( '<think>' )
@@ -171,10 +180,10 @@ describe('editor agent', () => {
171180 ]
172181 const mockAgentState = createMockAgentState ( initialMessages )
173182 const mockLogger = {
174- debug : ( ) => { } ,
175- info : ( ) => { } ,
176- warn : ( ) => { } ,
177- error : ( ) => { } ,
183+ debug : ( ) => { } ,
184+ info : ( ) => { } ,
185+ warn : ( ) => { } ,
186+ error : ( ) => { } ,
178187 }
179188
180189 const generator = editor . handleSteps ! ( {
@@ -194,10 +203,10 @@ describe('editor agent', () => {
194203 ]
195204 const mockAgentState = createMockAgentState ( initialMessages )
196205 const mockLogger = {
197- debug : ( ) => { } ,
198- info : ( ) => { } ,
199- warn : ( ) => { } ,
200- error : ( ) => { } ,
206+ debug : ( ) => { } ,
207+ info : ( ) => { } ,
208+ warn : ( ) => { } ,
209+ error : ( ) => { } ,
201210 }
202211
203212 const generator = editor . handleSteps ! ( {
@@ -238,10 +247,10 @@ describe('editor agent', () => {
238247 ]
239248 const mockAgentState = createMockAgentState ( initialMessages )
240249 const mockLogger = {
241- debug : ( ) => { } ,
242- info : ( ) => { } ,
243- warn : ( ) => { } ,
244- error : ( ) => { } ,
250+ debug : ( ) => { } ,
251+ info : ( ) => { } ,
252+ warn : ( ) => { } ,
253+ error : ( ) => { } ,
245254 }
246255
247256 const generator = editor . handleSteps ! ( {
@@ -271,7 +280,9 @@ describe('editor agent', () => {
271280 input : { output : { messages : any [ ] } }
272281 }
273282 expect ( toolCall . input . output . messages ) . toHaveLength ( 3 )
274- expect ( toolCall . input . output . messages [ 0 ] . content [ 0 ] . text ) . toBe ( 'Message 2' )
283+ expect ( toolCall . input . output . messages [ 0 ] . content [ 0 ] . text ) . toBe (
284+ 'Message 2' ,
285+ )
275286 } )
276287
277288 test ( 'handleSteps can be serialized for sandbox execution' , ( ) => {
@@ -289,10 +300,10 @@ describe('editor agent', () => {
289300 const initialMessages : any [ ] = [ ]
290301 const mockAgentState = createMockAgentState ( initialMessages )
291302 const mockLogger = {
292- debug : ( ) => { } ,
293- info : ( ) => { } ,
294- warn : ( ) => { } ,
295- error : ( ) => { } ,
303+ debug : ( ) => { } ,
304+ info : ( ) => { } ,
305+ warn : ( ) => { } ,
306+ error : ( ) => { } ,
296307 }
297308
298309 const generator = editor . handleSteps ! ( {
@@ -303,7 +314,9 @@ describe('editor agent', () => {
303314
304315 generator . next ( )
305316
306- const newMessages = [ { role : 'assistant' , content : [ { type : 'text' , text : 'Done' } ] } ]
317+ const newMessages = [
318+ { role : 'assistant' , content : [ { type : 'text' , text : 'Done' } ] } ,
319+ ]
307320 const updatedState = createMockAgentState ( newMessages )
308321
309322 const result = generator . next ( {
@@ -316,7 +329,9 @@ describe('editor agent', () => {
316329 toolName : 'set_output' ,
317330 input : {
318331 output : {
319- messages : [ { role : 'assistant' , content : [ { type : 'text' , text : 'Done' } ] } ] ,
332+ messages : [
333+ { role : 'assistant' , content : [ { type : 'text' , text : 'Done' } ] } ,
334+ ] ,
320335 } ,
321336 } ,
322337 includeToolCall : false ,
@@ -326,10 +341,10 @@ describe('editor agent', () => {
326341 test ( 'works with empty initial message history' , ( ) => {
327342 const mockAgentState = createMockAgentState ( [ ] )
328343 const mockLogger = {
329- debug : ( ) => { } ,
330- info : ( ) => { } ,
331- warn : ( ) => { } ,
332- error : ( ) => { } ,
344+ debug : ( ) => { } ,
345+ info : ( ) => { } ,
346+ warn : ( ) => { } ,
347+ error : ( ) => { } ,
333348 }
334349
335350 const generator = editor . handleSteps ! ( {
@@ -341,7 +356,10 @@ describe('editor agent', () => {
341356 generator . next ( )
342357
343358 const newMessages = [
344- { role : 'assistant' , content : [ { type : 'text' , text : 'First response' } ] } ,
359+ {
360+ role : 'assistant' ,
361+ content : [ { type : 'text' , text : 'First response' } ] ,
362+ } ,
345363 ]
346364 const updatedState = createMockAgentState ( newMessages )
347365
0 commit comments