Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。
TypeScript agentai-agentai-assistantandroidclaude-codecodexelectroniosllmmacosreact-nativetypescriptwindows
fix(maker-core): 突发重复仅在续接当前连续段时评估时长上限
Dashe058c2ccb527
diff --git a/packages/maker-core/src/agents/shared/loop-guard.test.ts b/packages/maker-core/src/agents/shared/loop-guard.test.tsindex c5d560058e..fe8770a8ed 100644--- a/packages/maker-core/src/agents/shared/loop-guard.test.ts+++ b/packages/maker-core/src/agents/shared/loop-guard.test.ts@@ -839,6 +839,22 @@ describe('ToolLoopGuard pacing and final limits', () => {}expect(verdicts.filter((verdict) => verdict.kind === 'hard')).toEqual([]);});++ // codex P1(#6388):突发重复只有续接了当前连续段才评估时长上限,+ // 否则早已陈旧的连续段会被算到无关的突发调用头上。+ it('does not apply the duration cap of a stale streak to an unrelated burst result', () => {+ const { guard, advance } = clockGuard({ burstRepeatGapMs: 2_000, finalStreakMs: 20_000 });+ const verdicts: ToolLoopGuardVerdict[] = [];+ for (let tick = 0; tick < 40; tick++) {+ advance(1_000);+ // A script polls once a second (a burst after the first), with a different result each time.+ guard.onToolUse(`x-${tick}`, 'browser', { action: 'poll' });+ verdicts.push(guard.onToolResult(`x-${tick}`, `busy ${tick}`));+ // The model repeats one call four times, three seconds apart, then stops.+ if (tick % 3 === 0 && tick < 12) verdicts.push(feed(guard, `a-${tick}`, 'browser', { action: 'snapshot' }, 'same'));+ }+ expect(verdicts.filter((verdict) => verdict.kind === 'hard' && verdict.final)).toEqual([]);+ });});describe('classifyToolContractError', () => {diff --git a/packages/maker-core/src/agents/shared/loop-guard.ts b/packages/maker-core/src/agents/shared/loop-guard.tsindex c1a2ec22d2..a975c599db 100644--- a/packages/maker-core/src/agents/shared/loop-guard.ts+++ b/packages/maker-core/src/agents/shared/loop-guard.ts@@ -437,7 +437,8 @@ export class ToolLoopGuard {if (burstRepeat) {this.lastResultObservedValue = false;if (!READ_ONLY_TOOL_NAMES.has(toolUse.name)) this.stableReadWindow = [];- if (fullFingerprint === this.lastFullFingerprint) this.observeStreak(fullFingerprint, false);+ if (fullFingerprint !== this.lastFullFingerprint) return { kind: 'ok' };+ this.observeStreak(fullFingerprint, false);return this.finalVerdict(toolUse.name);}const suspect = (verdict: ToolLoopGuardVerdict, pattern: Iterable<string>): ToolLoopGuardVerdict => {