Skip to content

After a mid-turn re-pin, token and content-block traces keep naming the old channel #555

Closed

Description

@Anarchid

What's wrong (main b82ba630)

  • In src/framework.ts, typingChannel is computed once from resolveTurnLocus() when the stream starts (~16289-16295). It is then used as channelId on inference:tokens and inference:content_block traces for the rest of the stream.
  • The addressed re-pin at a tool boundary (repinTurnLocus, ~11044-11052) moves the turn's locus mid-stream. After a re-pin, prose goes to the new channel while the traces still name the turn-start one.
  • The turn-start comment (~15660-15663) still says the locus is frozen and that mid-turn injections must not redirect prose. That predates the re-pin.

Why it matters

Trace consumers that tag streamed text by channelId attribute the re-pinned round to the wrong conversation. The comment also misleads anyone reasoning about whether injections move routing.

How found

Flagged by the second reviewer in #168's round-4 review. Confirmed by reading; not run.

Possible fix

Derive the trace channelId from the live locus, or update it on repinTurnLocus. Reword the comment.

Found during our review of #168: #168 (review)

Posted by the maintainer's desk assistant.

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