Skip to content

The first line a listener types in a session is silently dropped #145

Description

@wine-fall

What it is

In a real plain-mode session the first line the listener types is silently
dropped
. It never echoes (), never reaches the steer turn, and produces no
dev-log trace. The second typed line behaves normally.

Reproduced 3/3 on 2026-08-25 against the real Claude brain, on a run with a
pre-seeded persona.md (so first-run onboarding is skipped) and lines written
to stdin after the second beat had aired plus a 3s settle:

run line 1 line 2 result
A "turn the music off please" "actually, speak Japanese from now on" only line 2 echoed and acted
B "hey, can you turn the music off? just talk tonight" nothing echoed; no effect
C "turn the music off" "turn the music off" only line 2 echoed; settings.json got musicEnabled: false

Run C is the clean isolation: identical text, only the second one lands. So it
is positional, not content- or intent-dependent.

Suspected cause, NOT verified. A pre-broadcast lineReader (src/guide.ts:143)
left pending from the boot stretch appears to consume the first queued line and
discard it. LineQueue.peek() (src/host.ts:108) memoizes one shared waiting
promise, so a stale reader's take callback can win and takeLine() the line
before the Director's own race sees it. lineReader's settled guard
(src/guide.ts:149-156) exists for exactly this class of loss, but it only
covers the case where EOF or the quit latch already resolved that read — not a
reader that is still legitimately pending when an unrelated line arrives.

What would confirm it: instrument LineQueue.take() with the caller, or assert
in a unit test that a line pushed while a pre-broadcast lineReader is pending
still reaches Director's boundary race.

Not yet investigated: whether this also affects the TUI front-end (all three
runs were --plain), and whether a TTY behaves differently from the piped stdin
used in the repro.

Spec

specs/spec01/01-core-loop.md §3.3 (typed interjections are arbitrated by the
Director) and specs/spec03/03-03-guide-harness.md §3 (the guide's serialized
reader). The contract violated: a typed line either reaches the Director or is
consumed by a reader that is actually asking something — never dropped.

Done when

  • A regression test pins it: a line pushed while a pre-broadcast reader is
    pending still reaches the Director's steer path (deterministic, fakes only).
  • A real plain-mode run shows the first typed line echoing and taking
    effect, with no second line needed.

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

    bugSomething isn't workingengEngineering work: a measured defect or a performance target

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions