Skip to content

The floor remembers every chunk of a turn, not just the last one - #51

Merged
ralyodio merged 1 commit into
mainfrom
fix/floor-remembers-every-chunk
Nov 5, 2026
Merged

ralyodio merged 1 commit into
mainfrom
fix/floor-remembers-every-chunk

Conversation

@ralyodio

@ralyodio ralyodio commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Follow-up to #50, found by rehearsing two legs into a room with no guest on the line.

cha0spunk  17:24:21  riotcoder (other agent): I'm Riot Coder, an AI assistant and cohost.
cha0spunk  17:24:24  room: And this is a rehearsal chaos punk.       <- still riotcoder's words

#50 fixed which agent a line is credited to. This fixes how much of a turn is remembered.

A turn is split so playback starts before the whole line has rendered, and playNextChunk() re-claims the floor with the chunk it is currently playing:

if (join) takeFloor(a.pin, agent, line.text ?? '', (line.seconds + 8) * 1000);

said[agent] held a single line, so the second chunk ("How's the line?") overwrote the first — while the first chunk's transcription was still arriving. It then matched nothing and came back as the guest. Half of a host's sentence, addressed to its co-host, arriving as the guest is exactly what made riotcoder answer cha0spunk's question on episode 8.

Each agent now keeps its last four lines (a turn is two chunks, and a chunk can be re-claimed), pruned at the same 30 s window. A heard line is compared against each of them separately — still never merged into one bag of words, so a short answer from the guest cannot look like an echo of something. Both the list shape and #50's single-entry shape are read forward, so a leg mid-call stays legible to one that restarts.

Two new tests: both halves of a chunked turn recognised as the co-host while "Can you hear me?" still gets through, and the per-agent cap holding at four. bun test 108 pass / 0 fail, tsc --noEmit clean.

🤖 Generated with Claude Code

Rehearsal after #50, two legs in a room and no guest:

  cha0spunk  17:24:21  riotcoder (other agent): I'm Riot Coder, an AI assistant and cohost.
  cha0spunk  17:24:24  room: And this is a rehearsal chaos punk.      <- riotcoder's words

A turn is split so playback can start before the whole line is rendered, and
playNextChunk re-claims the floor with the chunk it is playing. said[agent] held
one line, so the second chunk ("How's the line?") overwrote the first, and the
first chunk's transcription - still arriving - matched nothing and came back as
the guest. Half of a host's sentence addressed to its co-host is exactly what
made riotcoder answer cha0spunk on episode 8.

Each agent now keeps its last four lines (one turn is two chunks, and a chunk
can be re-claimed), pruned at the same 30 s. A heard line is compared against
each of them separately - still never merged into one bag of words, so a short
answer from the guest cannot look like an echo of something.

108 pass, 0 fail; tsc clean.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@ralyodio
ralyodio merged commit c0c4cbb into main Nov 5, 2026
3 checks passed
@ralyodio
ralyodio deleted the fix/floor-remembers-every-chunk branch November 5, 2026 17:26
ralyodio added a commit that referenced this pull request Nov 5, 2026
…ed (#52)

Rehearsal on the merged #51 leg:

  riotcoder said:  "I'm RiotCoder, Anthony's AI assistant and co-host, ..."
  cha0spunk heard: riotcoder (other agent): Anthony's AI assistant and cohost.
                   room: I'm Riot Coder.                 <- still riotcoder

Our TTS says "RiotCoder" as one word and the transcriber writes "Riot Coder" as
two, so neither token is in the bag the floor claim built from "riotcoder". The
overlap on that short line fell to 1/3, under the half it needs, and a host
introducing itself arrived as the guest - at the top of the show, which is where
episode 8 started coming apart.

NAME_ALIASES already lists the spellings transcription produces ("riot coder",
"chaos punk", "kaos punk"), so echoesFloor now collapses them to one token on
both sides, and reads 0 as o. Only the MULTI-WORD aliases: collapsing single
generic ones like "security" or "chaos" would merge words the guest is entitled
to use himself, and swallowing the guest is the failure this code path already
had once.

109 pass, 0 fail; tsc clean.

Co-authored-by: riotcoder <riotcoder@profullstack.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
ralyodio added a commit that referenced this pull request Nov 5, 2026
GROUPCALL_STATUS_URL was set nowhere, so every Off The Record leg ran blind in
two ways.

followRoom never started. The room already labels every line by caller ID -
{"who":"Anthony","kind":"person","trusted":true} next to {"who":"cha0spunk",
"kind":"agent"} - and the leg had none of it, so it fell back to its own
speech-to-text and had to guess from audio which voice was its co-host. That
guess is what #50, #51 and #52 were repairing; with the room's transcript it is
not a guess at all.

And roomWatch fell through to its no-status-URL branch, "twenty quiet minutes",
instead of "everyone else left" after a minute with no person in the room. So
when the guest hung up the hosts stayed: episodes 8 and 9 each left two legs
dialled into an empty room, one of them with an hour of its cap still to run,
until they were killed by hand.

A joined leg can work this out on its own - the room code is on the command line
and the worker key is in worker.env - so it now does, and an explicitly passed
value still wins.

111 pass, 0 fail; tsc clean.

Co-authored-by: riotcoder <riotcoder@profullstack.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant