Repository navigation
fix(paste): content-match submit detection for inlined pastes (#279, #90) - #280
Merged
Merged
Conversation
…e, no timer (#279,#90) Replace the placeholder-only event-driven detector (which timed out and blind-fired \r for medium/inlined pastes that Claude never collapses into a [Pasted text #N] placeholder) with a content match against the live headless screen: send \r only once the composer visibly reflects the paste — a NEW placeholder appeared (collapse) OR the paste's tail newly appears (inline). Screen-truth, load-independent; the wall-clock wait survives only as a rare safety floor. Detection runs renderer-side off latestScreenRef (no submodule). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…n for content-match Adds an always-in-sync 'screen copy (live)' pane (reads runtime.screen each render) so you can watch the composer fill as you paste, plus a 'via' column (placeholder vs inline) and back-compat for the new paste:absorbed events. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The bug (#279 / #90)
Claude buffers pasted text and flushes on a ~100ms debounce; inside that window every keystroke — including our submit
\r— is swallowed as more paste content. Our event-driven detector only waited for the[Pasted text #N]placeholder, but Claude renders that only above its inline→collapse threshold. For the whole band in between (≈100 chars up to that threshold, and short multi-line), Claude inlines the paste with no placeholder, so the detector timed out and blind-fired\rstraight into the debounce → swallowed → no turn → you press Enter again.The fix — content match, not a clock
Compare what the user submitted against what's actually in the headless composer, via the live screen snapshot (
latestScreenRef), and send\rthe instant the composer reflects the paste:[Pasted text #N]placeholder appeared vs. the pre-paste baseline, ORBoth are load-independent — we wait for the condition, not a duration. The wall-clock wait survives only as a rare safety floor (Claude UI-rename insurance); it's no longer the primary path. This is the deferred "Option A" from the 2026-04-21 clean-fix doc, finally completing the event-driven approach from #71/#80.
Detection runs renderer-side off the existing
latestScreenRef— no submodule change, one app PR.Diagnostics (the #101 dev module)
ClaudePasteDetectionupdated to read the newpaste:absorbedevents, show aviacolumn (placeholder vs inline), and an always-in-sync "screen copy (live)" pane so you can watch the composer fill as you paste.Safety / scope
Test
AGENT_CODE_DEV_DEBUG=1, enable the dev panel's "Claude Paste / Submit Detection", paste a medium (~150–500 char) multi-line prompt into a Claude pane, hit Enter once → it submits; the timeline row showsvia: inlineandoutcome: submitted.Closes #279. Refs #90, #101.
🤖 Generated with Claude Code