You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
test('removes spawn_agent_inline call for context-pruner from last assistant message',()=>{
50
+
test('removes spawn_agent_inline call for context-pruner and following messages',()=>{
51
51
constmessages=[
52
52
createMessage('user','Hello'),
53
53
createMessage('assistant','I will spawn the context-pruner agent.\n\n<codebuff_tool_call>\n{\n "cb_tool_name": "spawn_agent_inline",\n "agent_type": "context-pruner"\n}\n</codebuff_tool_call>'),
test('does not remove last message if it does not contain context-pruner spawn call',()=>{
65
+
test('does not remove messages if assistant message does not contain context-pruner spawn call',()=>{
64
66
constmessages=[
65
67
createMessage('user','Hello'),
66
68
createMessage('assistant','Regular response without spawn call'),
69
+
createMessage('user','Follow up'),
70
+
]
71
+
72
+
constresults=runHandleSteps(messages)
73
+
expect(results).toHaveLength(1)
74
+
expect(results[0].input.messages).toHaveLength(3)
75
+
})
76
+
77
+
test('handles context-pruner spawn call without enough following messages',()=>{
78
+
constmessages=[
79
+
createMessage('user','Hello'),
80
+
createMessage('assistant','I will spawn the context-pruner agent.\n\n<codebuff_tool_call>\n{\n "cb_tool_name": "spawn_agent_inline",\n "agent_type": "context-pruner"\n}\n</codebuff_tool_call>'),
0 commit comments