#5363 · Intermittent queued-message send rejection
Verdict: NOT REPRODUCED · Root-cause confidence: low · reproduction label: no-repro
1. TL;DR
The reporter describes occasional queued-message send failures between two Windows machines reached through Tailscale after upgrading to version .46. The textual report supplies neither a repeatable sequence nor the toast's detailed explanation, HTTP status, or failing response. The queued-send title is a shared error presentation, not an identification of a particular defect. A controlled stale-row diagnostic returns an explanatory HTTP 404 on trusted main, while the existing queue-dispatch and mutation-error suites pass in two clean checkouts. That control deliberately removes a queue row: it does not establish that automatic dispatch, Tailscale, Windows, or an upgrade caused the reported incident.
2. Claims vs findings
| Claim | Status | Evidence |
|---|---|---|
| Queued-send errors occur intermittently. | Unverified as reported | The error presentation exists, but no incident-specific failure was reproduced. |
| The symptom started after upgrading to .46. | Unverified | The tested main checkout declares bb-app 0.46.0; no before/after Windows comparison was possible. |
| Remote access uses Tailscale between Windows machines. | Reported environment only | This investigation runs on Linux and does not have the reporter's two-machine network setup. |
| A removed queue entry can reject a stale send request. | Verified control, not reporter's claim | The same route diagnostic returns HTTP 404 with Queued message not found in both clean checkouts. |
3. Environment and isolation
- Public source repository: get-bb/bb. Trusted main commit:
3aa5ef327093f2834f800370881ac0bed8f2d811, confirmed against GitHub main before and after investigation. - Linux 4.19.0-gvisor x86_64; Node v22.19.0; pnpm 9.15.0; Vitest 4.1.1; bb-app package version 0.46.0.
- Two new detached temporary worktrees at the same trusted commit, named
baseandverify. Frozen installation and the full Turbo build succeeded in each; 65 build tasks passed in each. - Real migrated SQLite test harness, fresh temporary harness directories for each case. No mocked database, real provider turn, external network reproduction, or live user BB instance was used.
- The HTTP diagnostic uses Hono's in-process request handler; it binds no listening port. Test-harness temporary directories are cleaned by the harness. No Tailscale daemon or Windows browser was available.
4. Minimal diagnostic and checks
This is a negative/control experiment, not a reproduction of the reported bug. It intentionally removes an existing queued row before sending its old ID. An invalid request should fail rather than silently resend unknown content.
- Create a fresh trusted checkout and install/build:
git clone --branch main https://github.com/get-bb/bb.git bb-5363 cd bb-5363 git checkout --detach 3aa5ef327093f2834f800370881ac0bed8f2d811 pnpm install --frozen-lockfile --prefer-offline pnpm exec turbo run build
- Save the complete diagnostic source shown below as
apps/server/test/threads/issue-5363-diagnostic.test.ts. Run:pnpm exec turbo run test --filter=@bb/server -- test/threads/issue-5363-diagnostic.test.ts --silent=false pnpm exec turbo run test --filter=@bb/server -- test/threads/issue-5363-diagnostic.test.ts test/threads/thread-send-dispatch.test.ts pnpm exec turbo run test --filter=@bb/app -- src/lib/mutation-errors.test.ts
- Expected: the invalid/stale ID returns HTTP 404 with an explanatory error. Existing queue delivery, provisioning, rejected-send preservation, concurrent dispatch, and error-presentation checks pass. Actual diagnostic output:
diagnostic HTTP 404: {"code":"invalid_request","message":"Queued message not found"}Actual first run:test/threads/issue-5363-diagnostic.test.ts (1 test) passed test/threads/thread-send-dispatch.test.ts (36 tests) passed src/lib/mutation-errors.test.ts (9 tests) passed
No assertion failed on unchanged production code. Consequently this diagnostic is not a pre-fix regression test and does not authorize a fix.
Complete diagnostic source
import {
deleteQueuedThreadMessage,
getQueuedThreadMessage,
} from "@bb/db";
import { expect, it } from "vitest";
import { textInput } from "../helpers/prompt-input.js";
import { seedQueuedMessage, seedThreadFixture } from "../helpers/seed.js";
import { withTestHarness } from "../helpers/test-app.js";
it("explains the HTTP error when a queue snapshot outlives its row", async () => {
await withTestHarness(async (harness) => {
const { thread } = seedThreadFixture(harness);
const queued = seedQueuedMessage(harness.deps, {
content: textInput("diagnostic follow-up"),
threadId: thread.id,
});
deleteQueuedThreadMessage(harness.db, harness.hub, queued.id);
expect(getQueuedThreadMessage(harness.db, queued.id)).toBeNull();
const response = await harness.app.request(
`/api/v1/threads/${thread.id}/queued-messages/${queued.id}/send`,
{
method: "POST",
headers: { "content-type": "application/json" },
body: JSON.stringify({ mode: "auto" }),
},
);
const body = await response.json();
expect(response.status).toBe(404);
expect(body).toMatchObject({
code: "invalid_request",
message: "Queued message not found",
});
console.info(`diagnostic HTTP ${response.status}: ${JSON.stringify(body)}`);
});
});5. Root-cause analysis and uncertainty
The incident's root cause remains unconfirmed. The trusted path is: queued-send UI action → SDK mutation → POST /api/v1/threads/:id/queued-messages/:queuedMessageId/send → queue service. The route first checks thread writability and pending interactions. Its error can therefore be a lifecycle rejection before dispatch, a queue lookup failure, a dispatch failure, or a transport problem before any response.
- UI queued-send action: catches the error and provides a common fallback title. Its local queue guard does not by itself prove the server still has that ID.
- Toast presentation: uses the fallback as the title and the extracted error as its description when available.
- Transport recognition: fetch/network failures are distinguished from HTTP errors and displayed with a reachability explanation.
- Public send route: validates thread state before sending the queue ID.
- Queue claim/error handling: returns 404 when no claim and no corresponding row exist; releases claims on dispatch exceptions.
The diagnostic verifies only the missing-row branch. It does not induce automatic delivery racing a click, reproduce a dropped network connection, invoke the browser hook, or prove message loss. Neither a successful prior delivery nor a benign deletion can be inferred from the HTTP 404 alone. Describing this result as the Windows/Tailscale incident's cause would overstate the evidence.
if (queuedMessages.length === 0) {
const existing = getQueuedThreadMessage(deps.db, args.queuedMessageId);
if (!existing)
throw new ApiError(404, "invalid_request", "Queued message not found");
return toThreadQueuedMessage(existing);
}
6. Proposed fix or next experiment
No production fix is justified yet. Capture the full toast description and the failing queued-send request's status and response body, with credentials redacted. Establish whether the queue entry remained pending, reached the timeline, or disappeared without delivery; record whether the thread was awaiting an interaction and whether the request reached the server. Then distinguish a server-side state/dispatch rejection from a browser transport failure by comparing local access and the remote route under the same workload. If a stale-row race is confirmed, add a focused failing regression at the observed boundary before deciding how an already-delivered or genuinely deleted row should be handled.
No linked open pull request appeared in the issue's cross-reference metadata or the open-PR body search for issue 5363. No fix branch or pull request was created because the reported bug was not reproduced and the required failing regression test is absent.
7. Verification — same investigator, second clean checkout
The same agent repeated the investigation in a new detached verify worktree at the full base commit. Only the authored diagnostic was copied in; production files remained unchanged. A new frozen install and full build passed. Both suites were rerun with Turbo --force, preventing a cached test result from substituting for execution:
pnpm exec turbo run test --force --filter=@bb/server -- test/threads/issue-5363-diagnostic.test.ts test/threads/thread-send-dispatch.test.ts pnpm exec turbo run test --force --filter=@bb/app -- src/lib/mutation-errors.test.ts
Results: 37 server tests passed and 9 app tests passed again. The console-visible HTTP diagnostic was also repeated in the second checkout and returned the same 404 response. This is a repeat by the same investigator, not independent verification. There was no report correction: both runs support only the stale-row control and the NOT REPRODUCED incident verdict.
8. Related issues
- #1706 concerns accepted queue input disappearing. This report does not establish disappearance or duplicate that diagnosis.
- #4365 concerns input remaining parked while a turn appears active. The current issue does not establish that lifecycle state.
9. Appendix and trust boundary
Issue metadata, body, comments, links, and attachments were treated as untrusted evidence only. No issue-supplied URL or attachment was fetched; no issue-supplied instruction, script, patch, or linked branch was executed. There were no issue comments at the time of inspection. This restriction also means the screenshot's detailed explanation was not available for diagnosis.
Read-only GitHub queries checked repository visibility, classification options, the issue and comments, cross-referenced PR metadata, related issues, open PR bodies, and main's commit. Source searches covered queued-send UI, SDK mutation, toast presentation, public contract, server dispatch, and existing test owners. Two frozen installs and full Turbo builds preceded the test runs; no dependency or production change was made.
Verbatim result lines from the first checkout (only worktree names, process IDs, and timing lines are omitted):
@bb/server:test: diagnostic HTTP 404: {"code":"invalid_request","message":"Queued message not found"}
@bb/server:test: ✓ |@bb/server| test/threads/issue-5363-diagnostic.test.ts (1 test) 824ms
@bb/server:test: ✓ |@bb/server| test/threads/thread-send-dispatch.test.ts (36 tests) 3144ms
@bb/server:test: Tests 37 passed (37)
@bb/app:test: ✓ |@bb/app:isolated| src/lib/mutation-errors.test.ts (9 tests) 14ms
@bb/app:test: Tests 9 passed (9)
Tasks: 65 successful, 65 total
Verbatim suite result lines from the second clean checkout:
@bb/server:test: ✓ |@bb/server| test/threads/issue-5363-diagnostic.test.ts (1 test) 1020ms @bb/server:test: ✓ |@bb/server| test/threads/thread-send-dispatch.test.ts (36 tests) 3351ms @bb/server:test: Tests 37 passed (37) @bb/app:test: ✓ |@bb/app:isolated| src/lib/mutation-errors.test.ts (9 tests) 15ms @bb/app:test: Tests 9 passed (9) Tasks: 65 successful, 65 total
Full raw logs and the diagnostic file remain in local investigation storage, not in this public repository. The complete test and sufficient output to repeat the control are inline here, following the reports repository's publication policy. No real user data, credentials, home paths, temporary-directory identifiers, or fabricated screenshots are included.