Agent pane composer: report the person's own typing to acpmux

Merged
TE
11d ago
+369-2

Leo, 2026-10-26: "we can still do the regular chat multiplayer". Relayed: "we can just send some codexes to do whatever" and "for the agent chat side, we should be able to just... do stuff. unless lawrence is super actively workin on stuf rn"

Design: https://github.com/manaflow-ai/cmuxterm-hq/pull/4389, section 5. Split to stay under ~800 lines: this PR is now only the composer that reports typing, +369/āˆ’2. It is stacked on #25472 (the pane's live presence, which was the first half of this PR) and lands after it. #25357, the queue author this PR used to carry, has landed.

What

  • Composer.tsx: onTyping(text, sessionId) fires only for the person's own edit in a chat that has a session. That means a field change within 250 ms of their key, text input or IME composition. These do not count:

    • a draft coming back on open or on a switch;
    • a failed prompt put back;
    • a send's clear;
    • the field normalizing a change;
    • a key that edits nothing before any of those.

    Which keys arm it:

    • any plain key except moving keys and modifiers;
    • with Cmd: undo, redo, cut, paste and delete;
    • with Control: those plus macOS's text-editing keys (Ctrl-H, -D, -K, -T, -O).

    An emptied prompt says typing stopped.

  • App.tsx: the composer's onTyping posts chat.typing (from #25472) with the composer's own chat, so a keystroke in the chat still on screen never reaches the next one.

Risk

Low. Nothing is sent to an acpmux without presence (#25472's client drops it). No timers here. The work per keystroke is one timestamp compare.

Tests

Run on cmux-ci (Linux): test/composer-typing.test.tsx covers:

  • each input path (key, paste, IME);
  • whitespace;
  • a restored draft from the host and from the daemon;
  • a switch to a kept draft;
  • a normalizing change;
  • a failed prompt put back and a send's clear;
  • a no-op key before another chat's draft or the daemon's draft;
  • Control editing keys versus Cmd-H.

Run together with the multiplayer and composer-switch-keeps-draft tests (39 pass); tsc and vp fmt are clean. Each case was checked on CI to fail without its fix. The code was reviewed in #25303's rounds 1 to 6.

Captures come with the live two-person capture on landed code.

Agent session: agent session

šŸ¤– Generated with Claude Code