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

Method recordLoopGateOutcome

packages/runtime/src/tool-runtime.ts:795–807  ·  view source on GitHub ↗

* Record the terminal outcome of one tool call for the loop-gate. A success (or * any call with a different signature) resets the streak; a failure with the * same signature as the last failure extends it. Called once per call at every * exit — the pre-impl guards call it explicitly before

(signature: string, failed: boolean)

Source from the content-addressed store, hash-verified

793 * threshold and every further identical repeat keeps being blocked.
794 */
795 private recordLoopGateOutcome(signature: string, failed: boolean): void {
796 if (!failed) {
797 this.lastFailedToolCallSignature = undefined;
798 this.failedToolCallStreak = 0;
799 return;
800 }
801 if (signature === this.lastFailedToolCallSignature) {
802 this.failedToolCallStreak += 1;
803 } else {
804 this.lastFailedToolCallSignature = signature;
805 this.failedToolCallStreak = 1;
806 }
807 }
808
809 async writeSyntheticToolResult(
810 toolUseId: string,

Callers 1

executeToolMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected