Skip to content

feat(research): smart completion detection via stop button - #7

Merged
intellegix merged 1 commit into
masterfrom
fix/smart-completion-detection
Feb 23, 2026
Merged

feat(research): smart completion detection via stop button#7
intellegix merged 1 commit into
masterfrom
fix/smart-completion-detection

Conversation

@intellegix

Copy link
Copy Markdown
Owner

Summary

  • Replace fixed 240s/360s dom_min_elapsed guards with stop button cycle detection (appear→disappear + 3s debounce) as primary signal for research/labs modes
  • Add MutationObserver injection for content stability confirmation (5s zero mutations)
  • Multi-signal orchestrator: stop button (primary) → mutation/text stability (confirming) → CSS fallback (reduced guards)
  • Error state detection after stop button disappears ("Something went wrong", "Rate limit", etc.)
  • Reduce fallback guards: 120s/150s stability, 120s/180s DOM min-elapsed (down from 240s/300s/240s/360s)
  • Vision path deprecated for research/labs completion detection (unchanged for council mode)

Expected ~65% reduction in research query time (360s → ~130s for a 2-min query).

Test plan

  • Run research_query and verify completion detected within ~15s of actual generation finishing
  • Verify logs show: "Stop button appeared" → "Stop button disappeared" → "Mutation stability confirmed"
  • Verify no false positives (text not truncated mid-sentence)
  • Verify fallback works when stop button never appears (set poll to 999999ms)
  • Verify council mode still uses vision path (unchanged)

🤖 Generated with Claude Code

…gnal

Replace fixed dom_min_elapsed guards (240s/360s) with stop button cycle
detection as primary signal for research/labs modes. Stop button
appear→disappear with 3s debounce is the most reliable indicator.

Multi-signal confirmation: MutationObserver stability (5s zero mutations)
or text stability (8s unchanged) confirms after stop button disappears.
Falls back to CSS/text-stability with reduced guards if stop button never
appears. Error state detection after stop button disappearance.

Vision path deprecated for research/labs completion detection.
Expected ~65% reduction in query time (360s→~130s for 2-min queries).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@intellegix
intellegix merged commit b895f4c into master Feb 23, 2026
@intellegix
intellegix deleted the fix/smart-completion-detection branch February 25, 2026 19:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant