MCPcopy Create free account
hub / github.com/apache/maka / call

Function call

packages/runtime/src/__tests__/loop-gate.test.ts:244–267  ·  view source on GitHub ↗
(
  h: Harness,
  t: MakaTool,
  args: unknown,
  turnId = 'turn-1',
  origin: 'provider' | 'code_mode' = 'provider',
)

Source from the content-addressed store, hash-verified

242
243let callSeq = 0;
244function call(
245 h: Harness,
246 t: MakaTool,
247 args: unknown,
248 turnId = 'turn-1',
249 origin: 'provider' | 'code_mode' = 'provider',
250): Promise<unknown> {
251 return h.runtime
252 .settleToolCall({
253 tool: t,
254 turnId,
255 toolCallId: `tc-${++callSeq}`,
256 input: args,
257 origin,
258 abortSignal: new AbortController().signal,
259 eventSink: {
260 push: (event) => h.pushed.push(event),
261 pushAndWaitUntilConsumed: async (event) => {
262 h.pushed.push(event);
263 },
264 },
265 })
266 .then((settlement) => settlement.result);
267}
268
269describe('loop-gate for repeated identical FAILING tool calls', () => {
270 test('keeps nested CodeMode failures out of the provider loop-gate streak', async () => {

Callers 1

loop-gate.test.tsFile · 0.70

Calls 2

settleToolCallMethod · 0.80
pushMethod · 0.65

Tested by

no test coverage detected