diagnose-scroll-wheel

Diagnose: scroll wheel input regression — what was being sent before vs now, byte-level

Metadata

Statusdone
Assignedagent-1171
Agent identityf51439356729d112a6c404803d88015d5b44832c6c584c62b96732b63c2b0c7e
Created2026-04-29T19:40:42.962228238+00:00
Started2026-04-29T19:41:11.539922514+00:00
Completed2026-04-29T20:01:54.085853006+00:00
Tagspriority-high,research,bug,tui,input, eval-scheduled
Eval score0.88
└ blocking impact0.90
└ completeness0.95
└ constraint fidelity0.70
└ coordination overhead0.90
└ correctness0.92
└ downstream usability0.85
└ efficiency0.85
└ intent fidelity0.65
└ style adherence0.90

Description

Description

The fix-mouse-wheel-2 task was filed with a speculative root cause. User's reflection 2026-04-29: 'so was scroll wheel sending some scroll character before? that seemed to work... dunno whats up. this was a big goof and needs testing to pin down.'

User is correctly pointing out that we're guessing about the before/after byte semantics. Time to capture actual data.

Goal

Produce a byte-level comparison of what the TUI is doing with mouse wheel events:

  • BEFORE today's input changes (commit before fix-mouse-wheel / implement-tui-scroll)
  • AFTER today's input changes (HEAD)

Identify the EXACT regression: what changed in event interception, translation, or forwarding.

Investigation steps

1. Capture pre-regression behavior

Check out the commit just before fix-mouse-wheel (8ddeb9e42) — i.e., its parent. Build that binary. Run wg tui, open a claude chat (we know wheel scroll worked there pre-regression), capture:

  • Byte stream sent to the claude PTY child stdin during a scroll-wheel up event
  • Byte stream sent to the claude PTY child stdin during a scroll-wheel down event
  • Whether the outer scroll offset advanced
  • Tool: strace -p <claude-child-pid> -e write OR run claude via a wrapper that logs stdin

For codex (broken pre-regression, also broken post): same capture.

2. Capture post-regression behavior

HEAD binary. Same chat-tab repro. Same captures. Compare byte streams.

3. Identify event-routing pathway

For each commit involved (fix-mouse-wheel and implement-tui-scroll):

  • What wheel-event handler was added or modified?
  • What is the order of: outer-pane intercept vs PTY-child forward?
  • Is there any wheel→key translation in the new code? If so, where does the translated key event go?

4. Cross-check with claude's 'arrow keys' detection

Claude's warning fires when it sees specific input patterns. Identify what byte sequences trigger it. Confirm those are what our TUI is sending post-regression.

5. Consider the 'never worked but seemed to' angle

User noted PgUp/PgDn 'never worked' but scroll wheel WAS working. So the working pre-regression path was definitely about mouse-event handling, not keyboard. Confirm the working path was either:

  • Wheel events being passed THROUGH to the inner app (claude / codex render scroll natively in their alt-screen / line buffers when in scroll-receptive modes)
  • Wheel events being captured by the OUTER ratatui pane and consumed for outer scroll
  • Some hybrid (e.g., claude consumed wheel events natively, codex didn't, which matches the user's 'claude worked, codex didn't' report)

Deliverable

A wg log entry posted to this task with:

  1. Byte-level captures (pre vs post) for both claude and codex chats
  2. The exact code change that introduced the regression (file + line + commit)
  3. The pre-regression mechanism explained (was it pass-through? outer intercept? something hybrid?)
  4. Concrete fix proposal with rationale, suitable for a follow-up implementation task

The deliverable is the LOG ENTRY, not a code change. No source modifications.

Validation

  • Pre-regression byte stream captured for claude wheel scroll
  • Pre-regression byte stream captured for codex wheel scroll
  • Post-regression byte stream captured for both
  • Diff between pre and post identified at the commit/file level
  • Pre-regression mechanism explained (with file:line citation)
  • Concrete fix proposal that will pass the smoke scenario in fix-mouse-wheel-2
  • No source modifications — diagnose only

Process note

fix-mouse-wheel-2 is currently filed with a speculative scope. After this diagnose lands, either:

  • Update fix-mouse-wheel-2's description with the confirmed root cause + concrete fix, OR
  • Abandon fix-mouse-wheel-2 and file a new fix task with the verified diagnostic as its dependency

Either path beats shipping a 'fix' based on guesses.

Depends on

Required by

Log