@gaunt-sloth/core 2.0.0-alpha.23 → 2.0.0-alpha.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (154) hide show
  1. package/README.md +43 -18
  2. package/dist/config/colour.d.ts +38 -0
  3. package/dist/config/colour.js +36 -0
  4. package/dist/config/colour.js.map +1 -0
  5. package/dist/config/defaults.d.ts +6 -7
  6. package/dist/config/defaults.js +4 -8
  7. package/dist/config/defaults.js.map +1 -1
  8. package/dist/config/loader.d.ts +50 -3
  9. package/dist/config/loader.js +345 -29
  10. package/dist/config/loader.js.map +1 -1
  11. package/dist/config/mouse.d.ts +50 -0
  12. package/dist/config/mouse.js +44 -0
  13. package/dist/config/mouse.js.map +1 -0
  14. package/dist/config/profiles.d.ts +68 -0
  15. package/dist/config/profiles.js +93 -0
  16. package/dist/config/profiles.js.map +1 -0
  17. package/dist/config/schema.d.ts +2441 -116
  18. package/dist/config/schema.js +930 -19
  19. package/dist/config/schema.js.map +1 -1
  20. package/dist/config/shell-policy.d.ts +466 -116
  21. package/dist/config/shell-policy.js +273 -62
  22. package/dist/config/shell-policy.js.map +1 -1
  23. package/dist/config/tool-descriptions.d.ts +165 -0
  24. package/dist/config/tool-descriptions.js +229 -0
  25. package/dist/config/tool-descriptions.js.map +1 -0
  26. package/dist/config/types.d.ts +139 -6
  27. package/dist/config/types.js.map +1 -1
  28. package/dist/config.d.ts +4 -0
  29. package/dist/config.js +4 -0
  30. package/dist/config.js.map +1 -1
  31. package/dist/core/GthAbstractAgent.d.ts +85 -2
  32. package/dist/core/GthAbstractAgent.js +194 -1
  33. package/dist/core/GthAbstractAgent.js.map +1 -1
  34. package/dist/core/GthAgentRunner.d.ts +341 -58
  35. package/dist/core/GthAgentRunner.js +857 -149
  36. package/dist/core/GthAgentRunner.js.map +1 -1
  37. package/dist/core/GthLangChainAgent.d.ts +99 -0
  38. package/dist/core/GthLangChainAgent.js +388 -3
  39. package/dist/core/GthLangChainAgent.js.map +1 -1
  40. package/dist/core/approvals/annotations.d.ts +122 -0
  41. package/dist/core/approvals/annotations.js +137 -0
  42. package/dist/core/approvals/annotations.js.map +1 -0
  43. package/dist/core/approvals/grants.d.ts +216 -0
  44. package/dist/core/approvals/grants.js +469 -0
  45. package/dist/core/approvals/grants.js.map +1 -0
  46. package/dist/core/approvals/matcher.d.ts +202 -0
  47. package/dist/core/approvals/matcher.js +267 -0
  48. package/dist/core/approvals/matcher.js.map +1 -0
  49. package/dist/core/approvals/mcpSubjects.d.ts +40 -0
  50. package/dist/core/approvals/mcpSubjects.js +99 -0
  51. package/dist/core/approvals/mcpSubjects.js.map +1 -0
  52. package/dist/core/approvals/toolAnnotationSources.d.ts +105 -0
  53. package/dist/core/approvals/toolAnnotationSources.js +277 -0
  54. package/dist/core/approvals/toolAnnotationSources.js.map +1 -0
  55. package/dist/core/approvals/toolHost.d.ts +46 -0
  56. package/dist/core/approvals/toolHost.js +108 -0
  57. package/dist/core/approvals/toolHost.js.map +1 -0
  58. package/dist/core/debugCapture.d.ts +16 -0
  59. package/dist/core/debugCapture.js.map +1 -1
  60. package/dist/core/launchBanner.d.ts +120 -0
  61. package/dist/core/launchBanner.js +399 -0
  62. package/dist/core/launchBanner.js.map +1 -0
  63. package/dist/core/plainToolIndication.js +61 -35
  64. package/dist/core/plainToolIndication.js.map +1 -1
  65. package/dist/core/refusal.d.ts +53 -0
  66. package/dist/core/refusal.js +129 -0
  67. package/dist/core/refusal.js.map +1 -0
  68. package/dist/core/shell/approvalStop.d.ts +75 -0
  69. package/dist/core/shell/approvalStop.js +108 -0
  70. package/dist/core/shell/approvalStop.js.map +1 -0
  71. package/dist/core/shell/arity.d.ts +6 -0
  72. package/dist/core/shell/arity.js +20 -6
  73. package/dist/core/shell/arity.js.map +1 -1
  74. package/dist/core/shell/denylist.d.ts +11 -0
  75. package/dist/core/shell/denylist.js +37 -0
  76. package/dist/core/shell/denylist.js.map +1 -0
  77. package/dist/core/shell/normalize.d.ts +41 -1
  78. package/dist/core/shell/normalize.js +58 -4
  79. package/dist/core/shell/normalize.js.map +1 -1
  80. package/dist/core/shell/openWorld.d.ts +138 -0
  81. package/dist/core/shell/openWorld.js +523 -0
  82. package/dist/core/shell/openWorld.js.map +1 -0
  83. package/dist/core/shell/rater.d.ts +560 -0
  84. package/dist/core/shell/rater.js +895 -0
  85. package/dist/core/shell/rater.js.map +1 -0
  86. package/dist/core/shell/raterModel.d.ts +41 -0
  87. package/dist/core/shell/raterModel.js +51 -0
  88. package/dist/core/shell/raterModel.js.map +1 -0
  89. package/dist/core/shell/rejection.d.ts +66 -0
  90. package/dist/core/shell/rejection.js +38 -0
  91. package/dist/core/shell/rejection.js.map +1 -0
  92. package/dist/core/toolCallRepair/grammar.d.ts +41 -0
  93. package/dist/core/toolCallRepair/grammar.js +116 -0
  94. package/dist/core/toolCallRepair/grammar.js.map +1 -0
  95. package/dist/core/toolCallRepair/index.d.ts +2 -0
  96. package/dist/core/toolCallRepair/index.js +7 -0
  97. package/dist/core/toolCallRepair/index.js.map +1 -0
  98. package/dist/core/toolCallRepair/payload.d.ts +36 -0
  99. package/dist/core/toolCallRepair/payload.js +341 -0
  100. package/dist/core/toolCallRepair/payload.js.map +1 -0
  101. package/dist/core/toolCallRepair/promote.d.ts +45 -0
  102. package/dist/core/toolCallRepair/promote.js +90 -0
  103. package/dist/core/toolCallRepair/promote.js.map +1 -0
  104. package/dist/core/toolDisplay.d.ts +14 -1
  105. package/dist/core/toolDisplay.js +69 -12
  106. package/dist/core/toolDisplay.js.map +1 -1
  107. package/dist/core/toolOutputChannel.d.ts +33 -6
  108. package/dist/core/toolOutputChannel.js +61 -8
  109. package/dist/core/toolOutputChannel.js.map +1 -1
  110. package/dist/core/types.d.ts +71 -9
  111. package/dist/core/types.js.map +1 -1
  112. package/dist/providers/geminiSchemaSanitizer.d.ts +6 -3
  113. package/dist/providers/geminiSchemaSanitizer.js +152 -6
  114. package/dist/providers/geminiSchemaSanitizer.js.map +1 -1
  115. package/dist/providers/modelDiscovery.d.ts +18 -4
  116. package/dist/providers/modelDiscovery.js +67 -17
  117. package/dist/providers/modelDiscovery.js.map +1 -1
  118. package/dist/providers/openai.js +34 -0
  119. package/dist/providers/openai.js.map +1 -1
  120. package/dist/runtime/askStructured.d.ts +8 -7
  121. package/dist/runtime/askStructured.js +8 -7
  122. package/dist/runtime/askStructured.js.map +1 -1
  123. package/dist/runtime/conversation.js +89 -76
  124. package/dist/runtime/conversation.js.map +1 -1
  125. package/dist/runtime/singleShot.js +71 -60
  126. package/dist/runtime/singleShot.js.map +1 -1
  127. package/dist/utils/ProgressIndicator.d.ts +21 -0
  128. package/dist/utils/ProgressIndicator.js +30 -3
  129. package/dist/utils/ProgressIndicator.js.map +1 -1
  130. package/dist/utils/consoleUtils.d.ts +30 -0
  131. package/dist/utils/consoleUtils.js +27 -2
  132. package/dist/utils/consoleUtils.js.map +1 -1
  133. package/dist/utils/crashHandler.d.ts +87 -0
  134. package/dist/utils/crashHandler.js +128 -0
  135. package/dist/utils/crashHandler.js.map +1 -0
  136. package/dist/utils/debugDump.d.ts +58 -0
  137. package/dist/utils/debugDump.js +149 -15
  138. package/dist/utils/debugDump.js.map +1 -1
  139. package/dist/utils/llmUtils.d.ts +22 -8
  140. package/dist/utils/llmUtils.js +48 -8
  141. package/dist/utils/llmUtils.js.map +1 -1
  142. package/dist/utils/redactSecrets.js +68 -20
  143. package/dist/utils/redactSecrets.js.map +1 -1
  144. package/dist/utils/systemUtils.d.ts +17 -0
  145. package/dist/utils/systemUtils.js +17 -0
  146. package/dist/utils/systemUtils.js.map +1 -1
  147. package/package.json +5 -2
  148. package/schema/gsloth-config.schema.json +1484 -466
  149. package/dist/core/shell/allowlist.d.ts +0 -75
  150. package/dist/core/shell/allowlist.js +0 -187
  151. package/dist/core/shell/allowlist.js.map +0 -1
  152. package/dist/core/shell/judge.d.ts +0 -161
  153. package/dist/core/shell/judge.js +0 -261
  154. package/dist/core/shell/judge.js.map +0 -1
@@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C1D,CAAC;IAED,KAAK,CAAC,OAAO;QACX,QAAQ,CAAC,+BAA+B,CAAC,CAAC;QAC1C,qFAAqF;QACrF,0FAA0F;QAC1F,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,eAAe,EAAE,CAAC;QAC3C,IAAI,IAAI,CAAC,KAAK,IAAI,SAAS,IAAI,IAAI,CAAC,KAAK,IAAI,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,KAAK,UAAU,EAAE,CAAC;YACtF,MAAM,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;QAC7B,CAAC;QACD,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAClB,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;QACnB,QAAQ,CAAC,iCAAiC,CAAC,CAAC;IAC9C,CAAC;CACF"}
@@ -3,6 +3,105 @@ import { GthCommand } from '#src/core/types.js';
3
3
  import { GthAbstractAgent } from '#src/core/GthAbstractAgent.js';
4
4
  import { BaseCheckpointSaver } from '@langchain/langgraph';
5
5
  export type { AgentStreamEvent } from '#src/core/types.js';
6
+ /**
7
+ * GS2-36 — default cap for the tool-error retry budget: how many status:'error' tool results may
8
+ * accrue back-to-back (no successful tool result in between) before the run is ended gracefully.
9
+ * Small on purpose: it still lets the model try a couple of genuine recovery variants (the whole
10
+ * point of feeding errors back — GS2-32 showed the model routes around a surfaced error in 1–2
11
+ * tries) while stopping a runaway self-inflicted loop long before createAgent's coarse
12
+ * recursionLimit backstop would.
13
+ */
14
+ export declare const MAX_CONSECUTIVE_TOOL_ERRORS = 5;
15
+ /**
16
+ * GS2-36 — the tool-error retry budget as a standalone, testable middleware factory (exported so the
17
+ * real thing can be unit-tested and exercised in a real `createAgent` graph, mirroring
18
+ * `createPathNamespaceCorrectionMiddleware`).
19
+ *
20
+ * Runs in `beforeModel` (like langchain's own `modelCallLimitMiddleware`): after the tools node has
21
+ * appended its result(s) and before the next model call is spent, it walks the trailing messages and
22
+ * counts CONSECUTIVE errored tool results — a `ToolMessage` with `status: 'error'` (the shape the
23
+ * shell/MCP softeners produce; GthAbstractAgent maps `status==='error' → isError`). The walk skips
24
+ * the assistant tool-call requests between rounds, and RESETS on the first successful tool result
25
+ * (progress / diagnosis) or a Human/System message (a fresh user turn). Once the count reaches the
26
+ * cap it returns `{ jumpTo: 'end', messages: [<action-oriented notice>] }`, ending the run without
27
+ * spending another model call.
28
+ *
29
+ * Scope: counts `status: 'error'` results only. The recoverable fs error STRINGS
30
+ * (`write_file`/`edit_file`/…) are `status: 'success'` by the write_file precedent, so a pure fs
31
+ * error loop is deliberately NOT capped here — it stays bounded by the coarse `recursionLimit` and is
32
+ * the remit of the loop-DETECTION node (EXT-36). Counting `status: 'error'` overall (not per-tool)
33
+ * catches both same-tool and alternating-tool error loops with one robust rule.
34
+ */
35
+ export declare function createToolErrorBudgetMiddleware(maxConsecutiveErrors?: number): import("langchain").AgentMiddleware<undefined, undefined, unknown, readonly (import("@langchain/core/tools").ServerTool | import("@langchain/core/tools").ClientTool)[], readonly []>;
36
+ /**
37
+ * EXT-36 — default number of consecutive identical `(tool, args)` calls before the tool-loop guard
38
+ * fires. Small on purpose: it must catch a genuine no-progress loop (a model re-issuing the SAME
39
+ * call verbatim) while never tripping a legitimate one-off retry (2x). Kept below GS2-36's coarser
40
+ * error cap (5) because a same-signature repeat is a stronger, more specific loop signal than "an
41
+ * error happened again".
42
+ */
43
+ export declare const DEFAULT_TOOL_LOOP_THRESHOLD = 3;
44
+ /** EXT-36 — resolved knobs for {@link createToolLoopGuardMiddleware}. */
45
+ export interface ToolLoopGuardOptions {
46
+ /** Surface a user-visible notice at threshold (NO model-input mutation). Default ON. */
47
+ warn?: boolean;
48
+ /** End the run via `jumpTo:'end'` at threshold (opt-in, active loop-breaking). Default OFF. */
49
+ halt?: boolean;
50
+ /** Consecutive identical-signature repeats that trip the guard. Default {@link DEFAULT_TOOL_LOOP_THRESHOLD}. */
51
+ threshold?: number;
52
+ }
53
+ /**
54
+ * EXT-36 — normalise the `toolLoopGuard` config union (`false | true | { warn?, halt?, threshold? }`)
55
+ * into concrete {@link ToolLoopGuardOptions}, applying the WARN-ON-by-default policy at the read site
56
+ * (mirrors how `output.header` / `debugDump.redact` default with `!== false`, NOT in DEFAULT_CONFIG,
57
+ * so the effective-config snapshot never churns).
58
+ * - `false` → both modes off (a no-op guard);
59
+ * - `true` / absent → warn on, halt off, default threshold;
60
+ * - object → per-field, with warn defaulting ON and halt defaulting OFF.
61
+ */
62
+ export declare function resolveToolLoopGuardOptions(setting: boolean | ToolLoopGuardOptions | undefined | null): ToolLoopGuardOptions;
63
+ /**
64
+ * EXT-36 — the tool-loop guardrail as a standalone, testable middleware factory. The ORTHOGONAL
65
+ * sibling of {@link createToolErrorBudgetMiddleware}: GS2-36 caps a consecutive-tool-ERROR streak;
66
+ * this catches a **repeated identical `(tool, args)` / no-progress loop** — the same call re-issued
67
+ * verbatim, whether it keeps erroring OR keeps "succeeding" with the same result (the fs-error-string
68
+ * loop GS2-36's comment explicitly leaves to EXT-36).
69
+ *
70
+ * STATELESS (the critical trap): the factory runs ONCE per session, so a closure-held counter would
71
+ * bleed across every turn. Like GS2-36 it holds NO state — each `beforeModel` recomputes the streak
72
+ * from the message tail.
73
+ *
74
+ * Detection. A signature is `(tool_name, args_hash)`. Name + args live on `AIMessage.tool_calls[]`,
75
+ * NOT on the `ToolMessage` (softener ToolMessages carry only content+tool_call_id+status), so each
76
+ * `ToolMessage` is paired to its call by `tool_call_id === AIMessage.tool_calls[].id` to recover the
77
+ * signature. The backward walk counts CONSECUTIVE ToolMessages with the SAME signature; a DIFFERENT
78
+ * signature breaks the streak (the model tried something else = progress), and a Human/System message
79
+ * is a fresh-turn boundary. Assistant messages (the tool-call requests) are skipped. Known no-op
80
+ * (safe, never a false trip): a single AIMessage issuing PARALLEL tool calls yields back-to-back
81
+ * differing signatures, which the walk reads as progress and resets.
82
+ *
83
+ * Two modes (composable):
84
+ * - WARN (default ON, provably harmless): the default path must NOT change what the model sees.
85
+ * Appending ANY message then re-invoking the model mutates its input — a *steer*, not a *warn* —
86
+ * and is provider-unsafe by default (Gemini expects a trailing user turn → crash risk; Anthropic
87
+ * treats a trailing assistant as PREFILL → the note silently becomes the opening of the model's own
88
+ * next reply, corrupt with no error; a HumanMessage after a ToolMessage is two consecutive user
89
+ * turns for Anthropic/Gemini). So WARN instead SURFACES a user-visible notice via {@link onWarn}
90
+ * and returns `undefined` — zero `state.messages` mutation, zero control-flow. Fired statelessly
91
+ * ONCE per streak at the exact crossing (`streak === threshold`): a still-looping streak on later
92
+ * turns (`streak > threshold`) does not re-surface, while an interrupted-then-resumed loop
93
+ * re-reaches `threshold` and surfaces again — no marker/`additional_kwargs` machinery needed.
94
+ * - HALT (opt-in only, active loop-breaking): at/over threshold, return
95
+ * `{ jumpTo: 'end', messages: [new AIMessage(reason)] }` — a TERMINAL notice (the model is never
96
+ * re-invoked after it, so the prefill/role hazard cannot arise; the GS2-72-proven clean-stream
97
+ * path). NEVER throws. A validated behaviour change lives behind this opt-in.
98
+ *
99
+ * @param onWarn TUI-safe user-notice sink for WARN, wired at the read site to
100
+ * `statusUpdate(StatusLevel.WARNING, …)` (routed through the agent's status callback the renderer
101
+ * consumes, never raw stdout, so it can't leak over the Ink frame). Omitted → WARN still runs but
102
+ * surfaces nothing (still zero model-input mutation).
103
+ */
104
+ export declare function createToolLoopGuardMiddleware(options?: ToolLoopGuardOptions, onWarn?: (message: string) => void): import("langchain").AgentMiddleware<undefined, undefined, unknown, readonly (import("@langchain/core/tools").ServerTool | import("@langchain/core/tools").ClientTool)[], readonly []>;
6
105
  /**
7
106
  * Lean agent: builds a standard `createAgent` (ReAct) graph. All run/stream/event
8
107
  * plumbing lives in {@link GthAbstractAgent}; this class only knows how to construct
@@ -1,3 +1,4 @@
1
+ import { resolveApprovals, resolveShellApprovalGate, SHELL_TOOL_NAME, } from '#src/config.js';
1
2
  import { StatusLevel } from '#src/core/types.js';
2
3
  import { GthAbstractAgent } from '#src/core/GthAbstractAgent.js';
3
4
  import { debugLog, debugLogObject } from '#src/utils/debugUtils.js';
@@ -7,8 +8,261 @@ import { isToolAllowed } from '#src/utils/toolMatching.js';
7
8
  import { appendOsShellNote, appendCwdNote, appendCommitCoAuthorNote, appendModelContextNote, appendMcpServerInstructionsNote, resolveModelIdentity, } from '#src/utils/systemPromptNotes.js';
8
9
  import { isShellCommandFailedError } from '#src/core/shell/ShellCommandFailedError.js';
9
10
  import { extractDebugRequestExtras } from '#src/core/debugCapture.js';
11
+ import { promoteTextEmittedToolCallMessage } from '#src/core/toolCallRepair/index.js';
10
12
  import { AIMessage, ToolMessage } from '@langchain/core/messages';
11
- import { createAgent, createMiddleware } from 'langchain';
13
+ import { createAgent, createMiddleware, humanInTheLoopMiddleware, } from 'langchain';
14
+ /**
15
+ * GS2-36 — default cap for the tool-error retry budget: how many status:'error' tool results may
16
+ * accrue back-to-back (no successful tool result in between) before the run is ended gracefully.
17
+ * Small on purpose: it still lets the model try a couple of genuine recovery variants (the whole
18
+ * point of feeding errors back — GS2-32 showed the model routes around a surfaced error in 1–2
19
+ * tries) while stopping a runaway self-inflicted loop long before createAgent's coarse
20
+ * recursionLimit backstop would.
21
+ */
22
+ export const MAX_CONSECUTIVE_TOOL_ERRORS = 5;
23
+ /**
24
+ * GS2-36 — the tool-error retry budget as a standalone, testable middleware factory (exported so the
25
+ * real thing can be unit-tested and exercised in a real `createAgent` graph, mirroring
26
+ * `createPathNamespaceCorrectionMiddleware`).
27
+ *
28
+ * Runs in `beforeModel` (like langchain's own `modelCallLimitMiddleware`): after the tools node has
29
+ * appended its result(s) and before the next model call is spent, it walks the trailing messages and
30
+ * counts CONSECUTIVE errored tool results — a `ToolMessage` with `status: 'error'` (the shape the
31
+ * shell/MCP softeners produce; GthAbstractAgent maps `status==='error' → isError`). The walk skips
32
+ * the assistant tool-call requests between rounds, and RESETS on the first successful tool result
33
+ * (progress / diagnosis) or a Human/System message (a fresh user turn). Once the count reaches the
34
+ * cap it returns `{ jumpTo: 'end', messages: [<action-oriented notice>] }`, ending the run without
35
+ * spending another model call.
36
+ *
37
+ * Scope: counts `status: 'error'` results only. The recoverable fs error STRINGS
38
+ * (`write_file`/`edit_file`/…) are `status: 'success'` by the write_file precedent, so a pure fs
39
+ * error loop is deliberately NOT capped here — it stays bounded by the coarse `recursionLimit` and is
40
+ * the remit of the loop-DETECTION node (EXT-36). Counting `status: 'error'` overall (not per-tool)
41
+ * catches both same-tool and alternating-tool error loops with one robust rule.
42
+ */
43
+ export function createToolErrorBudgetMiddleware(maxConsecutiveErrors = MAX_CONSECUTIVE_TOOL_ERRORS) {
44
+ return createMiddleware({
45
+ name: 'GthLeanToolErrorBudget',
46
+ beforeModel: {
47
+ canJumpTo: ['end'],
48
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
49
+ hook: (state) => {
50
+ const messages = Array.isArray(state?.messages) ? state.messages : [];
51
+ let consecutive = 0;
52
+ let lastErrorContent = '';
53
+ for (let i = messages.length - 1; i >= 0; i--) {
54
+ const msg = messages[i];
55
+ if (ToolMessage.isInstance(msg)) {
56
+ if (msg.status === 'error') {
57
+ consecutive++;
58
+ if (!lastErrorContent) {
59
+ lastErrorContent = typeof msg.content === 'string' ? msg.content : '';
60
+ }
61
+ }
62
+ else {
63
+ // A successful tool result — the model is making progress / diagnosing, so the
64
+ // unrecovered-error streak is broken. Stop the walk (reset).
65
+ break;
66
+ }
67
+ }
68
+ else if (AIMessage.isInstance(msg)) {
69
+ // The assistant tool-call request that produced the error above; skip and keep counting.
70
+ // GS2-72: this `continue` INTENTIONALLY also skips the budget's OWN injected terminal
71
+ // notice (itself an AIMessage). If the run re-enters beforeModel on the same thread after
72
+ // a jumpTo:'end' (a re-invoke on the same thread — e.g. the no-checkpointer degrade of
73
+ // the string path's empty-stream fallback, or a later turn that keeps erroring), skipping
74
+ // the notice lets the walk still reach the errored results and re-trip deterministically.
75
+ // Do NOT special-case the notice to reset/break here — treating it as a fresh-turn
76
+ // boundary would let the capped loop resume.
77
+ continue;
78
+ }
79
+ else {
80
+ // A Human/System message: a fresh user-turn boundary — earlier errors don't count.
81
+ break;
82
+ }
83
+ }
84
+ if (consecutive >= maxConsecutiveErrors) {
85
+ const firstLine = (lastErrorContent.split('\n')[0] ?? '').slice(0, 300);
86
+ const notice = `Stopped after ${consecutive} consecutive failed tool calls to avoid a retry loop that ` +
87
+ 'keeps spending tokens without making progress' +
88
+ (firstLine ? ` (last error: ${firstLine})` : '') +
89
+ '. Do not repeat the same call: inspect the error, then change your approach — different ' +
90
+ 'arguments, a narrower path, or a different tool — or report the blocker to the user.';
91
+ return { jumpTo: 'end', messages: [new AIMessage(notice)] };
92
+ }
93
+ return undefined;
94
+ },
95
+ },
96
+ });
97
+ }
98
+ /**
99
+ * EXT-36 — default number of consecutive identical `(tool, args)` calls before the tool-loop guard
100
+ * fires. Small on purpose: it must catch a genuine no-progress loop (a model re-issuing the SAME
101
+ * call verbatim) while never tripping a legitimate one-off retry (2x). Kept below GS2-36's coarser
102
+ * error cap (5) because a same-signature repeat is a stronger, more specific loop signal than "an
103
+ * error happened again".
104
+ */
105
+ export const DEFAULT_TOOL_LOOP_THRESHOLD = 3;
106
+ /**
107
+ * EXT-36 — normalise the `toolLoopGuard` config union (`false | true | { warn?, halt?, threshold? }`)
108
+ * into concrete {@link ToolLoopGuardOptions}, applying the WARN-ON-by-default policy at the read site
109
+ * (mirrors how `output.header` / `debugDump.redact` default with `!== false`, NOT in DEFAULT_CONFIG,
110
+ * so the effective-config snapshot never churns).
111
+ * - `false` → both modes off (a no-op guard);
112
+ * - `true` / absent → warn on, halt off, default threshold;
113
+ * - object → per-field, with warn defaulting ON and halt defaulting OFF.
114
+ */
115
+ export function resolveToolLoopGuardOptions(setting) {
116
+ if (setting === false)
117
+ return { warn: false, halt: false };
118
+ if (setting === true || setting === undefined || setting === null)
119
+ return {};
120
+ return { warn: setting.warn, halt: setting.halt, threshold: setting.threshold };
121
+ }
122
+ /**
123
+ * EXT-36 — a deterministic, key-sorted stringify so `(tool, args)` signatures are stable regardless
124
+ * of object key order. No-args (`{}`) collapses to `"{}"`, so identical no-arg repeats collide BY
125
+ * DESIGN — that is exactly the loop signal. Known limitation: args carrying a volatile value (a
126
+ * timestamp / uuid) make every call look distinct, so the guard cannot see that loop; volatile-key
127
+ * stripping is deliberately NOT attempted (over-engineering for a rare, model-authored case).
128
+ */
129
+ function stableStringify(value) {
130
+ if (value === null || typeof value !== 'object')
131
+ return JSON.stringify(value) ?? 'null';
132
+ if (Array.isArray(value))
133
+ return `[${value.map(stableStringify).join(',')}]`;
134
+ const record = value;
135
+ const keys = Object.keys(record).sort();
136
+ return `{${keys.map((k) => `${JSON.stringify(k)}:${stableStringify(record[k])}`).join(',')}}`;
137
+ }
138
+ /**
139
+ * EXT-36 — the tool-loop guardrail as a standalone, testable middleware factory. The ORTHOGONAL
140
+ * sibling of {@link createToolErrorBudgetMiddleware}: GS2-36 caps a consecutive-tool-ERROR streak;
141
+ * this catches a **repeated identical `(tool, args)` / no-progress loop** — the same call re-issued
142
+ * verbatim, whether it keeps erroring OR keeps "succeeding" with the same result (the fs-error-string
143
+ * loop GS2-36's comment explicitly leaves to EXT-36).
144
+ *
145
+ * STATELESS (the critical trap): the factory runs ONCE per session, so a closure-held counter would
146
+ * bleed across every turn. Like GS2-36 it holds NO state — each `beforeModel` recomputes the streak
147
+ * from the message tail.
148
+ *
149
+ * Detection. A signature is `(tool_name, args_hash)`. Name + args live on `AIMessage.tool_calls[]`,
150
+ * NOT on the `ToolMessage` (softener ToolMessages carry only content+tool_call_id+status), so each
151
+ * `ToolMessage` is paired to its call by `tool_call_id === AIMessage.tool_calls[].id` to recover the
152
+ * signature. The backward walk counts CONSECUTIVE ToolMessages with the SAME signature; a DIFFERENT
153
+ * signature breaks the streak (the model tried something else = progress), and a Human/System message
154
+ * is a fresh-turn boundary. Assistant messages (the tool-call requests) are skipped. Known no-op
155
+ * (safe, never a false trip): a single AIMessage issuing PARALLEL tool calls yields back-to-back
156
+ * differing signatures, which the walk reads as progress and resets.
157
+ *
158
+ * Two modes (composable):
159
+ * - WARN (default ON, provably harmless): the default path must NOT change what the model sees.
160
+ * Appending ANY message then re-invoking the model mutates its input — a *steer*, not a *warn* —
161
+ * and is provider-unsafe by default (Gemini expects a trailing user turn → crash risk; Anthropic
162
+ * treats a trailing assistant as PREFILL → the note silently becomes the opening of the model's own
163
+ * next reply, corrupt with no error; a HumanMessage after a ToolMessage is two consecutive user
164
+ * turns for Anthropic/Gemini). So WARN instead SURFACES a user-visible notice via {@link onWarn}
165
+ * and returns `undefined` — zero `state.messages` mutation, zero control-flow. Fired statelessly
166
+ * ONCE per streak at the exact crossing (`streak === threshold`): a still-looping streak on later
167
+ * turns (`streak > threshold`) does not re-surface, while an interrupted-then-resumed loop
168
+ * re-reaches `threshold` and surfaces again — no marker/`additional_kwargs` machinery needed.
169
+ * - HALT (opt-in only, active loop-breaking): at/over threshold, return
170
+ * `{ jumpTo: 'end', messages: [new AIMessage(reason)] }` — a TERMINAL notice (the model is never
171
+ * re-invoked after it, so the prefill/role hazard cannot arise; the GS2-72-proven clean-stream
172
+ * path). NEVER throws. A validated behaviour change lives behind this opt-in.
173
+ *
174
+ * @param onWarn TUI-safe user-notice sink for WARN, wired at the read site to
175
+ * `statusUpdate(StatusLevel.WARNING, …)` (routed through the agent's status callback the renderer
176
+ * consumes, never raw stdout, so it can't leak over the Ink frame). Omitted → WARN still runs but
177
+ * surfaces nothing (still zero model-input mutation).
178
+ */
179
+ export function createToolLoopGuardMiddleware(options = {}, onWarn) {
180
+ const warn = options.warn ?? true;
181
+ const halt = options.halt ?? false;
182
+ const threshold = options.threshold ?? DEFAULT_TOOL_LOOP_THRESHOLD;
183
+ return createMiddleware({
184
+ name: 'GthLeanToolLoopGuard',
185
+ beforeModel: {
186
+ canJumpTo: ['end'],
187
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
188
+ hook: (state) => {
189
+ // `false` config resolves to warn:false + halt:false — a genuine no-op (fast bail).
190
+ if (!warn && !halt)
191
+ return undefined;
192
+ const messages = Array.isArray(state?.messages) ? state.messages : [];
193
+ // Recover each tool call's signature by id — name + args are on the AIMessage, not the
194
+ // ToolMessage. One pass over all AIMessages builds the id → {sig, name} lookup.
195
+ const callById = new Map();
196
+ for (const msg of messages) {
197
+ if (AIMessage.isInstance(msg) && Array.isArray(msg.tool_calls)) {
198
+ for (const tc of msg.tool_calls) {
199
+ const id = tc?.id;
200
+ if (typeof id === 'string') {
201
+ const name = typeof tc.name === 'string' ? tc.name : '';
202
+ // TODO(OPS-34): the delimiter below is a literal NUL byte, which makes this whole
203
+ // file binary to ripgrep and ugrep - they skip it in silence, so nothing in this
204
+ // file is findable by a repo-wide search. Replace it with the \u0000 escape.
205
+ callById.set(id, { sig: `${name}${stableStringify(tc.args ?? {})}`, name });
206
+ }
207
+ }
208
+ }
209
+ }
210
+ // Walk the tail backward, counting consecutive identical signatures since the last boundary.
211
+ let streak = 0;
212
+ let currentSig;
213
+ let currentName = '';
214
+ for (let i = messages.length - 1; i >= 0; i--) {
215
+ const msg = messages[i];
216
+ if (ToolMessage.isInstance(msg)) {
217
+ const call = callById.get(msg.tool_call_id);
218
+ // No paired call → cannot prove a repeat; treat as a boundary (never a false trip).
219
+ if (!call)
220
+ break;
221
+ if (currentSig === undefined) {
222
+ currentSig = call.sig;
223
+ currentName = call.name;
224
+ streak = 1;
225
+ }
226
+ else if (call.sig === currentSig) {
227
+ streak++;
228
+ }
229
+ else {
230
+ break; // different signature = the model tried something else = progress
231
+ }
232
+ }
233
+ else if (AIMessage.isInstance(msg)) {
234
+ continue; // the tool-call request — skip and keep counting the streak
235
+ }
236
+ else {
237
+ break; // Human/System message: a fresh user turn resets everything.
238
+ }
239
+ }
240
+ if (currentSig === undefined || streak < threshold)
241
+ return undefined;
242
+ // HALT (opt-in): end the run cleanly — never a throw. Terminal, so the model is never
243
+ // re-invoked after this AIMessage (no prefill/role hazard). Takes precedence over WARN.
244
+ if (halt) {
245
+ const notice = `Stopped after ${streak} identical calls to the \`${currentName}\` tool with the same ` +
246
+ 'arguments to avoid a loop that keeps spending tokens without making progress. ' +
247
+ 'The same call cannot yield a different result: change your approach — different ' +
248
+ 'arguments, a narrower step, or a different tool — or report the blocker to the user.';
249
+ return { jumpTo: 'end', messages: [new AIMessage(notice)] };
250
+ }
251
+ // WARN (default): SURFACE a user-visible notice and DO NOT touch state.messages (return
252
+ // undefined → the model's input is byte-for-byte unchanged, so no prefill/role hazard on any
253
+ // provider). Fire once per streak at the exact crossing: `streak === threshold` is a
254
+ // stateless "fire once" — a still-looping streak (streak > threshold) stays quiet, while an
255
+ // interrupted-then-resumed loop re-reaches threshold and surfaces again.
256
+ if (warn && streak === threshold) {
257
+ onWarn?.(`Tool-loop guard: the agent has called \`${currentName}\` with the same arguments ` +
258
+ `${streak} times without new progress. It may be stuck — consider interrupting and ` +
259
+ 'refining the request.');
260
+ }
261
+ return undefined;
262
+ },
263
+ },
264
+ });
265
+ }
12
266
  /**
13
267
  * Lean agent: builds a standard `createAgent` (ReAct) graph. All run/stream/event
14
268
  * plumbing lives in {@link GthAbstractAgent}; this class only knows how to construct
@@ -92,6 +346,38 @@ export class GthLangChainAgent extends GthAbstractAgent {
92
346
  return state;
93
347
  },
94
348
  });
349
+ // EXT-35: promote a text-emitted tool call to a native tool_call so the loop doesn't stall.
350
+ // Small/local models (Gemma, lmstudio, gpt-oss) often serialise a tool call as assistant TEXT
351
+ // instead of a native `tool_call`; the ReAct router then sees no tool_calls on the last message
352
+ // and ENDS the turn ("no tool calls = done"). This afterModel hook runs ONLY when the last
353
+ // AIMessage carries no native tool_calls (the native happy path is byte-for-byte untouched):
354
+ // it parses a STANDALONE text-emitted call (bracket / <function=…> / Harmony), gated HARD by the
355
+ // bound-tool allow-list + a payload-size cap + standalone-only, and — when it promotes — returns
356
+ // the rewritten message. Preserving the original message id is load-bearing: LangGraph's
357
+ // message-state reducer merges by id, so a same-id message REPLACES the model's text message in
358
+ // graph state; the router then sees the native tool_calls and routes to the tools node, so the
359
+ // loop continues instead of concluding done. Ported from the openclaw tool-call-repair reference.
360
+ // Bound-tool names are the allow-list; an empty toolset promotes nothing (prose-safe default).
361
+ const repairToolNames = new Set(tools.map((t) => t.name).filter((name) => Boolean(name)));
362
+ const toolCallRepairMiddleware = createMiddleware({
363
+ name: 'GthMiddlewareToolCallRepair',
364
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
365
+ afterModel: (state) => {
366
+ const lastMessage = state.messages[state.messages.length - 1];
367
+ if (!AIMessage.isInstance(lastMessage))
368
+ return state;
369
+ if (lastMessage.tool_calls && lastMessage.tool_calls.length > 0)
370
+ return state;
371
+ const promoted = promoteTextEmittedToolCallMessage(lastMessage, {
372
+ allowedToolNames: repairToolNames,
373
+ });
374
+ if (!promoted)
375
+ return state;
376
+ debugLog(`Repaired a text-emitted tool call into a native tool_call: ${formatToolCalls(promoted.tool_calls ?? [])}`);
377
+ // Replace-by-id (same id) so the reducer swaps the text message rather than appending.
378
+ return { messages: [promoted] };
379
+ },
380
+ });
95
381
  // EXT-21: lean-path sibling of the deep agent's GthDeepShellExitSoftening (GthDeepAgent.ts).
96
382
  // `exec` / `ask --write` route through this lean `createAgent` graph, whose run_* shell/dev
97
383
  // tools (GthDevToolkit.executeCommand) THROW a ShellCommandFailedError on a non-zero exit or a
@@ -177,11 +463,24 @@ export class GthLangChainAgent extends GthAbstractAgent {
177
463
  name: 'GthMiddlewareDebugCapture',
178
464
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
179
465
  wrapModelCall: async (request, handler) => {
466
+ // GS2-56: stash the always-on last-model-request snapshot (extras + as-sent messages)
467
+ // UNCONDITIONALLY — before the `capture` short-circuit — so `/debug-dump` has the full
468
+ // model input even when no TUI `/debug` sink is attached (a non-TUI surface, or `/debug`
469
+ // never opened). Guarded: snapshotting must never break the run. The computed extras are
470
+ // reused for the sink below so extraction runs once.
471
+ let extras;
472
+ try {
473
+ extras = extractDebugRequestExtras(request);
474
+ this.setLastModelRequest(request.messages, extras);
475
+ }
476
+ catch {
477
+ /* the always-on snapshot must never break the run */
478
+ }
180
479
  const capture = getDebugCapture();
181
480
  if (!capture)
182
481
  return handler(request);
183
482
  try {
184
- capture.onRequest?.(request.messages, extractDebugRequestExtras(request));
483
+ capture.onRequest?.(request.messages, extras);
185
484
  }
186
485
  catch {
187
486
  /* a debug sink must never break the run */
@@ -203,18 +502,104 @@ export class GthLangChainAgent extends GthAbstractAgent {
203
502
  // two softeners is not load-bearing: they catch DISJOINT conditions (a ShellCommandFailedError
204
503
  // vs a name==='ToolException') and each rethrows what it doesn't recognize, so neither can
205
504
  // swallow the other.
505
+ // EXT-35: toolCallRepairMiddleware sits AFTER toolCallStatusMiddleware in the array. afterModel
506
+ // nodes execute in reverse array order (the later one runs first), so repair runs BEFORE the
507
+ // status middleware — a promoted call is therefore reported by the "Requested tools:" line too.
508
+ // Correctness (routing) is order-independent: the router reads final graph state after all
509
+ // afterModel nodes, and repair replaces-by-id, so the promoted tool_calls are present regardless.
510
+ // GS2-36: cap a self-inflicted tool-error loop. The shell/MCP softeners above turn a failed
511
+ // run_*/MCP call into a status:'error' ToolMessage the model observes; a model that keeps
512
+ // re-issuing the same failing call would drain tokens turn after turn. This beforeModel guard
513
+ // ends the run gracefully once MAX_CONSECUTIVE_TOOL_ERRORS such results accrue with no successful
514
+ // tool result in between — a tighter, error-specific complement to createAgent's coarse
515
+ // recursionLimit (loop DETECTION proper is the separate EXT-36). Placed after the softeners and
516
+ // before user middleware so it can't be bypassed. Lean backend only (per GS2-36 scope); the deep
517
+ // backend keeps its own recursionLimit backstop.
518
+ const toolErrorBudget = createToolErrorBudgetMiddleware();
519
+ // EXT-36: the ORTHOGONAL loop guard — repeated identical (tool, args) / no-progress detection,
520
+ // the sibling of GS2-36's error budget above. It catches the case GS2-36 explicitly leaves open:
521
+ // a model re-issuing the SAME call verbatim, whether it keeps erroring or keeps "succeeding" with
522
+ // the same result. Placed at index 3, immediately AFTER toolErrorBudget (index 2) and BEFORE user
523
+ // middleware: beforeModel hooks run in forward order with jumpTo short-circuiting, so on a
524
+ // simultaneous trip GS2-36's coarse error cap wins first and EXT-36 fires on its own
525
+ // signature-repeat threshold otherwise; keeping it outboard of user middleware means it can't be
526
+ // bypassed. WARN is on by default and SURFACES a user notice WITHOUT touching state.messages (the
527
+ // default path must never mutate the model's input — appending a message + re-invoking is a
528
+ // provider-unsafe steer, not a warn); HALT (opt-in) actively breaks the loop via a terminal
529
+ // jumpTo:'end'. Default WARN-ON is applied here at the read site (resolveToolLoopGuardOptions),
530
+ // NOT in DEFAULT_CONFIG, so the
531
+ // effective-config snapshot never churns. Lean backend only (like GS2-36); the deep array is
532
+ // untouched. `toolLoopGuard: false` resolves to a no-op guard (still installed at index 3 so the
533
+ // placement is stable).
534
+ const toolLoopGuard = createToolLoopGuardMiddleware(resolveToolLoopGuardOptions(this.config.toolLoopGuard),
535
+ // WARN surfaces through the same TUI-safe status channel every other agent notice uses
536
+ // (renderer-consumed, never raw stdout) so it can't leak over the Ink frame (TUI-C31).
537
+ (message) => statusUpdate(StatusLevel.WARNING, message));
538
+ // EXT-52: gate the opt-in run_shell_command tool behind the SAME per-command approval
539
+ // interrupt the deep backend has always wired (deepagents' `interruptOn` installs this very
540
+ // langchain `humanInTheLoopMiddleware` — see GthDeepAgent.buildDeepAgentParams). Without it,
541
+ // no interrupt ever fired on the lean (default) backend, so the runner's whole approval stack
542
+ // (`GthAgentRunner.decideToolApproval`: sessionYolo → allow-list → judge → human callback,
543
+ // fail-closed reject) was DEAD CODE on lean and shell commands ran unprompted. A matching tool
544
+ // call now suspends the graph with a HITLRequest interrupt; the runner drains it via
545
+ // getPendingToolInterrupts/streamResume (both backend-agnostic in GthAbstractAgent), so ONE
546
+ // gating code path drives both backends and the existing TUI + readline approval prompts fire
547
+ // identically on lean.
548
+ //
549
+ // The gate condition and its user-facing notices are the SHARED policy
550
+ // (`resolveShellApprovalGate`, EXT-12 semantics documented there); the two backends differ only
551
+ // in how they install the interrupt — directly as middleware here, via deepagents' `interruptOn`
552
+ // in GthDeepAgent.
553
+ const { gateShell, notice: shellGateNotice } = resolveShellApprovalGate(this.config ?? undefined, this.command);
554
+ const gatedTools = gateShell ? [SHELL_TOOL_NAME] : [];
555
+ const shellApprovalMiddleware = gateShell
556
+ ? [
557
+ humanInTheLoopMiddleware({
558
+ interruptOn: {
559
+ [SHELL_TOOL_NAME]: {
560
+ allowedDecisions: ['approve', 'reject'],
561
+ },
562
+ },
563
+ }),
564
+ ]
565
+ : [];
566
+ if (shellGateNotice) {
567
+ this.statusUpdate(shellGateNotice.level, shellGateNotice.message);
568
+ }
569
+ // EXT-58 (spec §4.5) — state the approvals posture where the model reads it: on the tool
570
+ // descriptions themselves. Every tool NOT auto-approved at the resolved rung gets the rung's
571
+ // sentence appended; every granted tool keeps its description exactly as written, because the
572
+ // ABSENCE of the sentence is what marks it free. `gatedTools` is literally the set wired into
573
+ // the interrupt above, so a description can never promise an approval this gate will not ask
574
+ // for. Applied after the allowedTools filter and before createAgent, so the model only ever
575
+ // sees the final, suffixed set.
576
+ this.registerApprovalsAwareTools(tools, {
577
+ rung: resolveApprovals(this.config ?? undefined, this.command).rung,
578
+ gatedTools,
579
+ });
580
+ // EXT-52 placement note: the HITL gate sits EARLY in the array — before user-configured
581
+ // middleware and, crucially, before toolCallRepairMiddleware — because afterModel hooks run in
582
+ // REVERSE array order (the EXT-35 rule above). The gate's afterModel therefore executes LAST,
583
+ // after EXT-35's repair has promoted a text-emitted `run_shell_command` into a native
584
+ // tool_call, so a small local model that serialises the call as text is gated too (were the
585
+ // gate appended last, like deepagents does on the deep path, it would run FIRST and a promoted
586
+ // shell call would bypass approval entirely).
206
587
  const middleware = [
207
588
  shellExitSoftening,
208
589
  mcpToolErrorSoftening,
590
+ toolErrorBudget,
591
+ toolLoopGuard,
592
+ ...shellApprovalMiddleware,
209
593
  ...configuredMiddleware,
210
594
  toolCallStatusMiddleware,
595
+ toolCallRepairMiddleware,
211
596
  debugCaptureMiddleware,
212
597
  ];
213
598
  this.headerStatus(`Loaded middleware: ${middleware.map((m) => m.name).join(', ')}`);
214
599
  // GS2-21: compose gsloth's system prompt (backstory + guidelines + per-command mode prompt +
215
600
  // system prompt) EXACTLY as GthDeepAgent does, so identity profiles and `.gsloth.*.md` are
216
601
  // honored on the lean backend too. Previously the lean agent gave the model NO system prompt
217
- // (only the deep agent composed one), so `system-prompt.md` / projectGuidelines never reached
602
+ // (only the deep agent composed one), so `system-prompt.md` / the guidelines never reached
218
603
  // the model — the robot (agent.backend: lean) behaved as if it never got its guidelines.
219
604
  // This is passed to createAgent as `systemPrompt`, which langchain applies as the agent's
220
605
  // static system message on every turn — NOT injected as a separate mid-conversation