Skip to content

Side-chat reply anchor is persisted but omitted from the first provider turn #2316

Description

@kongenpei

Summary

"Reply in side chat" displays the selected source message under "Replying to", but the explicit agent-only reply anchor is omitted from the first provider turn. The forked provider session inherits conversation history, but it does not receive the text that identifies which earlier message the user selected.

Versions and environment

  • bb from source at 7e10ea4b3742f3d14bde086c2963118238fec3ab, current origin/main
  • bb CLI 0.39.0
  • macOS 26.3, Node v24.6.0
  • Codex CLI 0.149.0
  • Local reused-workspace fork

Steps to reproduce

  1. Create an idle fork through POST /api/v1/threads/fork with an agentContextSeed containing Replying to the selected earlier message and workspace: "reuse".
  2. Complete the queued zero-input thread.start, returning a provider thread id.
  3. Send the first user message to the fork through POST /api/v1/threads/:id/send with Explain that quoted message.
  4. Inspect the queued turn.submit.input sent to the host daemon.

Minimal regression assertion run on main:

expect(firstTurn.command.input).toEqual([seed, firstReply]);

Expected vs actual

Expected turn.submit.input:
[
  {
    "type": "text",
    "text": "Replying to the selected earlier message",
    "mentions": [],
    "visibility": "agent-only"
  },
  {
    "type": "text",
    "text": "Explain that quoted message",
    "mentions": []
  }
]

Actual turn.submit.input:
[
  {
    "type": "text",
    "text": "Explain that quoted message",
    "mentions": []
  }
]

Vitest reports:

AssertionError: expected [ { type: 'text', …(2) } ] to deeply equal [ { type: 'text', …(3) }, …(1) ]

Evidence and root cause

The side-chat plugin builds an agentContextSeed for an earlier-message anchor and passes it to threads.fork: plugins/side-chat/server.ts.

The server combines that seed into the fork's persisted input, but for a seed-only idle fork it separately sets providerInput: []: apps/server/src/services/threads/thread-fork.ts.

Provisioning persists args.input in client/turn/requested, while args.providerInput ?? args.input becomes the daemon-facing input. The explicit empty providerInput therefore removes the seed from the zero-turn provider fork: apps/server/src/services/threads/thread-provisioning.ts.

The first subsequent send builds turn.submit from only the new request input. It does not recover the persisted seed: apps/server/src/services/threads/thread-send.ts.

The current test covers only persistence plus the intentionally empty initial provider input; it does not exercise the first user turn: apps/server/test/public/public-thread-fork.test.ts.

Investigation thread: thr_93njf8in3x.

What was ruled out

  • Still reproduces on current origin/main at 7e10ea4b3742f3d14bde086c2963118238fec3ab.
  • The panel UI does retain and render the anchor; the loss occurs between persisted fork input and provider input.
  • Searches across open and closed issues for side-chat seed, reply anchor, and reply context found no duplicate.

AGENT GENERATED

Activity

  1. added
    threads
    side-chat
    on Aug 23, 2026
  2. added theissue type on Aug 23, 2026
  3. SawyerHood commented on Aug 24, 2026

    @SawyerHood
    Collaborator

    ---Auto-Generated---

    Reproduction & root-cause report: https://get-bb.github.io/reports/issues/2316.html

    • Verdict: REPRODUCED · root-cause confidence: high
    • Root cause (short): A seed-only idle fork persists the agent-only reply seed in its thread-start client/turn/requested event but hands the daemon providerInput [] (intentional no-input-no-turn), and neither the direct first send nor the queued auto-send (both via prepareTurnSubmitCommandPayload) ever reads that persisted seed back, so the model never receives it.
    • Proposed fix: In apps/server/src/services/threads/thread-commands.ts prepareTurnSubmitCommandPayload (the choke point for both the direct first send and the queued-message auto-send), when target.mode === "start" and input is non-empty, look up the thread's own agent-initiated thread-start client/turn/requested row; if all its inputs are visibility "agent-only" and no turn/started event exists after it, prepend those inputs to input (and to inputGroups[0]). Prototype diff at /tmp/bb-reports/issues/2316/repro/proposed-fix.diff: repro test passes, apps/server test/threads + test/public pass (57 files / 597 te…
    • Caveats: The user-visible wrong answer (BANANA instead of APPLE) is model behaviour and was demonstrated once per fork, not statistically; the definitive evidence is the failing server test and the bridge wire recordings. For point forks (replying to an assistant message that has a completed turn) the seed is equally dropped but the cloned session already ends at that message, so the model often guesses ri…

    The report is self-contained: copy-paste repro steps with the test or script inline, expected vs actual output, screenshots where the bug is visual, and code permalinks at the base commit. It was independently re-executed by a second agent (see its Verification section).

    AGENT GENERATED: by Claude Code

  4. added
    confirmed-repro
    on Aug 24, 2026
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

    confirmed-reproside-chatthreads

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions