feat(agent): verify-before-done + loop quality (1.9.8) - #23
Conversation
Stop recon/hallucination failure mode vs ns-agent: count observation turns not parallel tools, gate empty tool_calls on open tasks/unverified mutations, preserve _repeat/dialogOpened through truncation, harden DEFAULT_SYSTEM claim rules.
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
| check(name: string, args: Record<string, unknown>): RepeatVerdict { | ||
| if (!OBSERVATION_TOOLS.has(name)) { | ||
| this.observationStreak = 0; | ||
| this.observationBatches = 0; | ||
| this.waitInStreak = false; | ||
| } else if (this.observationStreak >= RepeatGuard.STUCK_BLOCK_AT && !this.waitInStreak) { | ||
| } else if (this.observationBatches >= RepeatGuard.STUCK_BLOCK_AT && !this.waitInStreak) { |
There was a problem hiding this comment.
Suggestion: check still resets observationBatches on every non-observation tool before the batch finishes, so a turn that mixes a read with a later click clears the streak mid-batch and can prevent the hard block from ever firing. Only finalizeObservationBatch should mutate batch counters; keep check limited to the identical-call fingerprint path plus the block ceiling test. [possible issue, importance: 8]
| check(name: string, args: Record<string, unknown>): RepeatVerdict { | |
| if (!OBSERVATION_TOOLS.has(name)) { | |
| this.observationStreak = 0; | |
| this.observationBatches = 0; | |
| this.waitInStreak = false; | |
| } else if (this.observationStreak >= RepeatGuard.STUCK_BLOCK_AT && !this.waitInStreak) { | |
| } else if (this.observationBatches >= RepeatGuard.STUCK_BLOCK_AT && !this.waitInStreak) { | |
| check(name: string, args: Record<string, unknown>): RepeatVerdict { | |
| if (OBSERVATION_TOOLS.has(name) && this.observationBatches >= RepeatGuard.STUCK_BLOCK_AT && !this.waitInStreak) { |
Hard observation-streak block killed legitimate get_page paging mid meta-tags run. Keep soft ACT NOW + identical-call refuse only. Clarify worker ≠ browser executor; default worker → DeepSeek Flash 0731; sync worker when orch picker still looks like a leftover default.
|
1.9.7 follow-up: removed hard |
System-role gate nudge (not user); silent clicks only clear on dialogOpened:true; exhausted nudges auto-block open tasks + UNVERIFIED closeout. Hard stuck block already removed in 1.9.7.
Addressed pr-agent / ns-agent review (1.9.8)
CI + merge next. Operator deploy = reload unpacked |
Summary
tool_callswith no proof gate; stuck streak counted each parallel read (fought batching); truncation could drop_repeat/dialogOpened.VERIFY BEFORE CLAIM, critical envelope preserved on truncate, strongerdialogOpened:falsemiss hint._memory/combo-x-agent-loop-quality.md.Test plan
npm test— 679 passednpm run build— dist manifest 1.9.6, bundle containsVERIFY BEFORE CLAIMextension/dist→ dogfood a multi-step UI task (open doing-task + early “done” prose should continue)Acceptance
repeatGuard.test.tsloop.test.ts_repeat/dialogOpenedresultShaping.test.tsdefaultSystem.test.ts