Skip to content

The arrival brief after a chat moves swallows typed text, and esc does not close it #2564

Open

Description

@AbirAbbas

What happened

When a chat arrives from another paired computer, the arrival brief (Moved from <device> in <time>. Everything as you left it., with one answer, got it) holds the keyboard. Text typed while it shows does not reach the composer, and esc does not close it. The card's own comment says esc runs nothing and closes it.

Seen on macOS arm64 during a two-computer hand test of the idle hand-off branch (#2287 at 453f3b1). It appeared after a chat moved between two paired homes. The card code (internal/tui3/resumecard.go) is unchanged from app/v3 a687c92, so base should behave the same. A move by Continue here raises the same card.

Moved from ihA in 1s. Everything as you left it.
▸1 got it

Replication

Deterministic (no model).

  1. make build, then go build -o modelstub ./test/remote/stub, then start the stub on a local port.
  2. Start a local sync service: bin/codeaf relay --listen <sync service address> --store <empty folder>.
  3. Make two throwaway homes, A and B. Each sets its own HOME, CODEAF_HOME and CODEAF_PROFILE_DIR, plus CODEAF_SYNC_URL=<sync service address>, CODEAF_BASE_URL=<stub address>/api/v1 and OPENROUTER_API_KEY=stub. Each has {"model.talk":"stub/scripted","tools.approvalMode":"allow"} in $CODEAF_HOME/config.json.
  4. Pair them: run bin/codeaf pair --code --name A in A and bin/codeaf pair <code> --name B in B, compare the words, and answer y.
  5. In A, run bin/codeaf chat --no-host --model stub/scripted --one-model and send PROBE-ECHO hi. In B, open that chat from Home: press enter on A's row, then Continue here if asked.
  6. While the arrival card shows in B, type hello and press esc.
    • Today: hello is not in the composer, and the card stays.
    • Expected: esc closes the card, and typing goes to the composer (or closes the card and then types).

Field (real models). The same with any model, since the card is drawn before any model call.

Where

  • arrivedShown and offerSetup in internal/tui3/resumecard.go.
  • The answer label OfferGotIt and the line movedFrom in internal/chatlist/copy.go.

The fix

The arrival brief asks nothing, so it must not take the keyboard away:

  • esc closes it, as the file's header says;
  • printable keys close it and go to the composer;
  • 1 (got it) still closes it.

The setup variant (set up / not now) keeps its answers, and esc there means not now, as documented.

Acceptance

  • e2e: the tmux TUI suite, with two homes paired over a local sync service and the stub (keyless). After a move, with the arrival card up, send hello and esc. Assert that the composer holds hello and the card's got it line is gone.
  • e2e: the control. With the setup card (set up / not now), esc leaves nothing run, and the same facts reach the agent at its next step.
  • Unit: a key-routing test on arrivedShown's card. Esc closes it; a printable key closes it and reaches the composer.
  • The manual page that describes the arrival brief quotes esc's behaviour.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions