MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / runTwoStepLoop

Function runTwoStepLoop

packages/kosong/test/e2e/toolchain-bridges.test.ts:60–77  ·  view source on GitHub ↗
(toolset: SimpleToolset, provider: ChatProvider)

Source from the content-addressed store, hash-verified

58}
59
60async function runTwoStepLoop(toolset: SimpleToolset, provider: ChatProvider) {
61 const history: Message[] = [
62 { role: 'user', content: [{ type: 'text', text: 'run the tool chain' }], toolCalls: [] },
63 ];
64
65 const first = await step(provider, '', toolset, history);
66 history.push(first.message);
67
68 const toolResults = await first.toolResults();
69 for (const toolResult of toolResults) {
70 history.push(createToolMessage(toolResult.toolCallId, toolResult.returnValue.output));
71 }
72
73 const second = await step(provider, '', toolset, history);
74 history.push(second.message);
75
76 return { first, second, toolResults, history };
77}
78
79describe('e2e: kosong toolchain bridges', () => {
80 it('typed-tool -> SimpleToolset -> step dispatches nested Zod args and completes the loop', async () => {

Callers 1

Calls 4

stepFunction · 0.90
createToolMessageFunction · 0.90
toolResultsMethod · 0.65
pushMethod · 0.45

Tested by

no test coverage detected