Skip to content

Commit c066cba

Browse files
committed
fix: fix typecheck errors in session resume test and add changeset
- Add missing type: 'function' to ToolCall objects in test - Fix LoopToolCallEvent shape (use stepUuid instead of parentUuid, add uuid/turnId/step/args) - Add changeset for agent-core and kimi-code patch bumps
1 parent b3fb9e7 commit c066cba

2 files changed

Lines changed: 13 additions & 4 deletions

File tree

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
"@moonshot-ai/agent-core": patch
3+
"@moonshot-ai/kimi-code": patch
4+
5+
---
6+
7+
Fix session resume failing with 400 error when previous turn was interrupted mid-tool-call.

packages/agent-core/test/agent/context.test.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -783,7 +783,7 @@ describe('Agent context notification projection', () => {
783783
{
784784
role: 'assistant',
785785
content: [{ type: 'text', text: 'I will run a tool' }],
786-
toolCalls: [{ id: 'call_1', name: 'Bash', arguments: '{}' }],
786+
toolCalls: [{ type: 'function', id: 'call_1', name: 'Bash', arguments: '{}' }],
787787
},
788788
// No tool result for call_1 — session was killed.
789789
];
@@ -799,7 +799,7 @@ describe('Agent context notification projection', () => {
799799
{
800800
role: 'assistant',
801801
content: [{ type: 'text', text: 'I will run a tool' }],
802-
toolCalls: [{ id: 'call_1', name: 'Bash', arguments: '{}' }],
802+
toolCalls: [{ type: 'function', id: 'call_1', name: 'Bash', arguments: '{}' }],
803803
},
804804
{
805805
role: 'tool',
@@ -828,11 +828,13 @@ describe('Agent context notification projection', () => {
828828
type: 'context.append_loop_event',
829829
event: {
830830
type: 'tool.call',
831-
parentUuid: 'step-orphan',
831+
uuid: 'tool-orphan',
832832
stepUuid: 'step-orphan',
833+
turnId: '',
834+
step: 1,
833835
toolCallId: 'orphan_call',
834836
name: 'Bash',
835-
arguments: '{}',
837+
args: {},
836838
},
837839
});
838840

0 commit comments

Comments
 (0)