Skip to content

fix(side-chat): bind reply anchor to accepted turn - #2428

Merged
ymichael merged 1 commit into
mainfrom
bb/post-merge-fix-own-side-chat-anchor-by-first-acc-thr_9r3c5ib4rh
Aug 25, 2026
Merged

ymichael merged 1 commit into
mainfrom
bb/post-merge-fix-own-side-chat-anchor-by-first-acc-thr_9r3c5ib4rh

Conversation

@ymichael

Copy link
Copy Markdown
Collaborator

Human comments

What was wrong

Side-chat hidden reply context was inferred from the latest accepted request and the absence of a later turn/started, instead of being owned by the specific first accepted user turn. A rapid second send accepted before provider start could therefore receive the anchor again, while editing the completed owning turn rebuilt provider input without the anchor.

What changed

  • Treat the accepted anchor-bearing request as the owner while its thread is active, and allow retry only after the existing thread lifecycle reports an observable dispatch error.
  • Preserve the selected request's leading agent-only input when editing that exact turn, using the existing request-sequence and transaction checks.
  • Keep the fix at the shared server input boundary so direct, queued/grouped, Codex, Claude Code, Pi, built-in ACP, and custom ACP paths retain the same ownership behavior.
  • Bump HOST_DAEMON_PROTOCOL_VERSION from 169 to 170 because the meaning of server-to-daemon turn input changed even though its wire shape did not.

How you verified

  • Reproduced both route failures before production edits with real server routes and in-memory SQLite: 2/2 failed.
  • Added tracked regressions for the rapid second send and first-turn edit replacement across Codex, Claude Code, and Pi; confirmed they failed before the fix and passed after it.
  • Re-ran the real-route harness after the fix: 2/2 passed.
  • pnpm exec turbo run test --filter=@bb/server -- test/public/public-thread-fork.test.ts test/services/prompt-history.test.ts test/threads/thread-edit-message.test.ts: 71/71 passed.
  • pnpm exec turbo run test --filter=bb-plugin-side-chat: 25/25 passed.
  • pnpm exec turbo run test --filter=@bb/host-daemon-contract -- test/contract.test.ts: 37/37 passed.
  • pnpm exec turbo run typecheck --filter=@bb/server --filter=bb-plugin-side-chat --filter=@bb/host-daemon-contract: passed.
  • pnpm exec turbo run build --filter=@bb/server: passed.
  • git diff --check and git show --check: passed.

Fixes #2316

AGENT GENERATED

@ymichael
ymichael merged commit e33574e into main Aug 25, 2026
15 checks passed
@ymichael
ymichael deleted the bb/post-merge-fix-own-side-chat-anchor-by-first-acc-thr_9r3c5ib4rh branch August 25, 2026 21:15
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.

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

1 participant