Skip to content

Commit 9d99e64

Browse files
committed
style(agent-core-v2): remove inline implementation comments
1 parent db94481 commit 9d99e64

2 files changed

Lines changed: 1 addition & 25 deletions

File tree

packages/agent-core-v2/src/agent/toolDedupe/toolDedupeService.ts

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,7 @@
55
* hooks, an `onBeforeExecuteTool` veto listener (same-step duplicates are
66
* vetoed with a placeholder synthetic result), and an `onDidExecuteTool`
77
* hook to drive same-step suppression and cross-step repeat reminders, and
8-
* reports repeat telemetry through `telemetry`. Calls rejected in preflight
9-
* never reach `onBeforeExecuteTool`; the `onDidExecuteTool` hook registers
10-
* them late (`registerSkipped`) so the repeat breaker still counts them.
11-
* The mutable dedupe state
8+
* reports repeat telemetry through `telemetry`. The mutable dedupe state
129
* (`stepCalls`, `originalCallIndex`, `syntheticCallIds`, `callKeyByCallId`,
1310
* `consecutiveKey`, `consecutiveCount`, `activeTurnId`, `activeStep`) is
1411
* registered into `agentState` (`IAgentStateService`) and read/written
@@ -183,10 +180,6 @@ export class AgentToolDedupeService extends Disposable implements IAgentToolDedu
183180
}
184181
});
185182
toolExecutor.hooks.onDidExecuteTool.register('toolDedupe', async (ctx, next) => {
186-
// Calls rejected in preflight (e.g. invalid args) never reach
187-
// onBeforeExecuteTool, so register them here — otherwise the repeat
188-
// breaker cannot count them and the model can re-issue the same
189-
// invalid call indefinitely.
190183
this.registerSkipped(
191184
ctx.toolCall.id,
192185
ctx.toolCall.name,
@@ -320,20 +313,6 @@ export class AgentToolDedupeService extends Disposable implements IAgentToolDedu
320313
return { syntheticResult: null };
321314
}
322315

323-
/**
324-
* Register a call that bypassed `onBeforeExecuteTool` — e.g. args
325-
* validation rejected it in preflight, so the veto event never fired.
326-
* Must be called before `finalizeResult` for such calls, otherwise the
327-
* repeat circuit breaker never counts rejected calls and the model can
328-
* re-issue the same invalid call without ever tripping the streak.
329-
* No-op when the call was already registered through the normal
330-
* before-execute path.
331-
*
332-
* `rawArguments` is the provider's raw arguments string. Args that failed
333-
* JSON parsing were normalized to `{}` by the executor, which would key
334-
* every malformed-but-different attempt identically; those are keyed on
335-
* the raw text so only true re-issues count as repeats.
336-
*/
337316
private registerSkipped(
338317
toolCallId: string,
339318
toolName: string,

packages/agent-core-v2/src/agent/toolExecutor/toolExecutorService.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -596,9 +596,6 @@ export class AgentToolExecutorService implements IAgentToolExecutorService {
596596
result: ToolResult,
597597
options: ToolExecutorExecuteOptions,
598598
): Promise<ToolResult> {
599-
// Preflight-rejected calls run the hook too: they bypassed
600-
// `onBeforeExecuteTool`, and this is the only interception point every
601-
// call still passes through (the repeat breaker registers them here).
602599
const didCtx: ToolDidExecuteContext = {
603600
turnId: options.turnId,
604601
signal: options.signal,

0 commit comments

Comments
 (0)