Skip to content

New turns can stall the server on long threads with a queued retry #7473

Closed

Description

@Danielalnajjar

Summary

On our self-hosted BB 0.49.0 server (two unrelated local patches; this query is unchanged from upstream), new prompts to a thread with 10,539 accepted turns and one queued provider retry froze the whole server three times in 14 minutes. BB's own slow-query log recorded the hasAcceptedQueuedRetryInput statement at 207 s, 208 s and 232 s, each inside the send path's immediate write transaction and almost entirely CPU time; a 10-second CPU sample during the second run showed the server's main thread inside that statement for every sample, so HTTP and WebSocket requests waited until it finished. I expected sending a prompt not to freeze the whole server; the synthetic benchmark below reproduces the query cost on a fresh in-memory database without any private data.

Versions and environment

  • Incident: self-hosted BB 0.49.0, desktop app (/Applications/bb.app in the CPU sample), macOS 27.0.1, ARM64. Two unrelated local patches were present; this query is unchanged from upstream. Exact incident build commit and embedded Node version were not recorded in the supplied evidence.
  • The affected thread used claude-code; its incident-time CLI version was not recorded. The synthetic fixture uses the provider ID codex but starts no provider or CLI, makes no network requests, and needs no credentials or copied user database.
  • Synthetic measurements: November 10, 2026, macOS 27.0.1, 18 logical CPUs, Node 22.19.0, pnpm 9.15.0, better-sqlite3 12.11.1 / SQLite 3.53.2, Drizzle 0.45.4; source commit 7c1353d80729983b86ea1555d18b42407f320406, with the inline query patch applied for the after side. These are database timings, not current-main or HTTP/UI latency measurements.
  • Upstream source checked November 12, 2026: main at 7794941da1b6e2baf017e5f7ab65b5f223fcaf54 retains the same acceptance check. Unverified on current main as a full-server reproduction: the supplied timing runs used the earlier source commit above; no fresh full-server or benchmark run on current main was performed for this report.

Steps to reproduce

Closest faithful reproduction: the query and its exported transaction/API path, using a migrated in-memory SQLite database, not a recreated live server freeze.

  1. Use a disposable get-bb/bb source checkout at the tested base commit and install its normal project dependencies through pnpm:

    git checkout --detach 7c1353d80729983b86ea1555d18b42407f320406
    pnpm install --frozen-lockfile
  2. Save query.patch and benchmark.mjs from the inline files below at the repository root. The harness captures the patched query and substitutes frozen original SQL for the before side, so both sides run against identical data in one process. Do not skip git apply query.patch: without it, the harness captures the original query for both sides and measures it against itself.

  3. Apply the patch and run the harness:

    git apply query.patch
    node --conditions=source --import tsx ./benchmark.mjs micro
    node --conditions=source --import tsx ./benchmark.mjs path
    node --conditions=source --import tsx ./benchmark.mjs large

    Each harness command can be bounded with timeout 110 on Linux or gtimeout 110 on macOS. The micro and path modes create 2,000 request events containing 2,562,000 bytes of request JSON, 1,999 accepted inputs, and one queued retry for the remaining unaccepted request. large uses 10,000 request events and 9,999 accepted inputs and runs only the replacement query/path; the original query was not run at that size.

micro times the acceptance query. path times the exported supersede API in an immediate transaction, including outcome checks and rollback so each run starts from the same state. Both queries must return no accepted input; inside the transaction the retry must remain stored with waitingOn set to superseded.

What did not reproduce it: no unsuccessful full-server reproduction attempt is documented in the supplied evidence. No provider comparison or fresh live data-directory test was recorded; this report does not claim either as a negative result. Functional checks also cover the no-queued-retry case (see Evidence), but that is not a separate latency measurement.

All reproduction files are inline; no separate uploads are required.

query.patch
diff --git a/packages/db/src/data/queued-thread-messages.ts b/packages/db/src/data/queued-thread-messages.ts
index b0d2484fc9..37f2165d21 100644
--- a/packages/db/src/data/queued-thread-messages.ts
+++ b/packages/db/src/data/queued-thread-messages.ts
@@ -1221,15 +1221,17 @@ function hasAcceptedQueuedRetryInput(
         and(
           eq(accepted.threadId, retry.threadId),
           eq(accepted.type, "turn/input/accepted"),
-          exists(
+          inArray(
+            sql`json_extract(${accepted.data}, '$.clientRequestId')`,
             db
-              .select({ sequence: chainRequest.sequence })
+              .select({
+                requestId: sql`json_extract(${chainRequest.data}, '$.requestId')`,
+              })
               .from(chainRequest)
               .where(
                 and(
                   eq(chainRequest.threadId, retry.threadId),
                   eq(chainRequest.type, "client/turn/requested"),
-                  sql`json_extract(${chainRequest.data}, '$.requestId') = json_extract(${accepted.data}, '$.clientRequestId')`,
                   or(
                     sql`json_extract(${chainRequest.data}, '$.requestId') = ${retry.retryOfTurnRequestId}`,
                     sql`json_extract(${chainRequest.data}, '$.retryOfRequestId') = ${retry.retryOfTurnRequestId}`,
benchmark.mjs
import assert from 'node:assert/strict';
import { performance } from 'node:perf_hooks';
import { cpus, loadavg } from 'node:os';
import { pathToFileURL } from 'node:url';
import { writeFileSync } from 'node:fs';
const repo = process.cwd();
const load = p => import(pathToFileURL(`${repo}/${p}`).href);
const { createMigratedConnection } = await load('packages/db/src/testing.ts');
const { noopNotifier } = await load('packages/db/src/notifier.ts');
const { upsertHost } = await load('packages/db/src/data/hosts.ts');
const { createProject } = await load('packages/db/src/data/projects.ts');
const { createThread } = await load('packages/db/src/data/threads.ts');
const { createQueuedThreadMessage, getQueuedThreadMessage, supersedeQueuedRetriesInTransaction } = await load('packages/db/src/data/queued-thread-messages.ts');
const { encodeClientTurnRequestIdNumber } = await load('packages/domain/src/protocol-ids.ts');
const id = value => encodeClientTurnRequestIdNumber({value});
const oldSql = `select accepted.sequence from events accepted where accepted.thread_id=? and accepted.type=? and exists (select request.sequence from events request where request.thread_id=? and request.type=? and json_extract(request.data,'$.requestId')=json_extract(accepted.data,'$.clientRequestId') and (json_extract(request.data,'$.requestId')=? or json_extract(request.data,'$.retryOfRequestId')=?)) limit ?`;
function fixture(turns) {
  const db = createMigratedConnection();
  const host = upsertHost(db, noopNotifier, { name: 'retry-benchmark' });
  const { project } = createProject(db, noopNotifier, {name:'synthetic',source:{type:'local_path',hostId:host.id,path:'/tmp/retry-benchmark'}});
  const thread = createThread(db, noopNotifier, { projectId: project.id, providerId: 'codex' });
  const insert = db.$client.prepare(`insert into events (id,thread_id,scope_kind,turn_id,sequence,type,data,created_at) values (?,?,?,?,?,?,?,0)`);
  let requestBytes = 0;
  db.$client.transaction(() => {
    for (let i=1;i<=turns;i++) {
      const data = JSON.stringify({requestId:id(i),input:[{type:'text',text:'x'.repeat(1200),mentions:[]}]});
      requestBytes += Buffer.byteLength(data);
      insert.run(`request-${i}`,thread.id,'thread',null,i*2-1,'client/turn/requested',data);
      if (i<turns) insert.run(`accepted-${i}`,thread.id,'turn',`turn-${i}`,i*2,'turn/input/accepted',JSON.stringify({clientRequestId:id(i)}));
    }
  })();
  const retry = createQueuedThreadMessage(db,noopNotifier,{threadId:thread.id,content:[],model:'gpt-5',reasoningLevel:'medium',permissionMode:'full',serviceTier:'default',waitingOn:null,sendAt:null,payload:{kind:'retry',retryOfTurnRequestId:id(turns),attempt:2,reason:'Rate limited'},systemNotice:null});
  const prepare = db.$client.prepare.bind(db.$client);
  const rollback = {};
  let captured;
  let side = 'capture';
  db.$client.prepare = source => {
    const isCheck = source.includes('from "events" "retry_chain_accepted"');
    const stmt = prepare(isCheck && side==='before' ? oldSql : source);
    if (isCheck && side==='capture') {
      const get = stmt.get.bind(stmt);
      stmt.get = (...params) => { captured = {sql:source,params}; return get(...params); };
    }
    return stmt;
  };
  function path(which) {
    side = which;
    try {
      db.transaction(tx => {
        assert.equal(supersedeQueuedRetriesInTransaction(tx,{threadId:thread.id,retryOfTurnRequestId:null}),1);
        assert.equal(getQueuedThreadMessage(tx,retry.id).waitingOn,JSON.stringify({kind:'superseded'}));
        throw rollback;
      },{behavior:'immediate'});
    } catch (error) { if(error!==rollback) throw error; }
    assert.equal(getQueuedThreadMessage(db,retry.id).waitingOn,null);
  }
  path('capture');
  assert.ok(captured);
  const before = prepare(oldSql), after = prepare(captured.sql);
  function micro(which) { assert.equal((which==='before'?before:after).get(...captured.params),undefined); }
  return {db,turns,requestBytes,path,micro,sql:captured.sql,params:captured.params,oldSql};
}
function timed(fn) { const cpu=process.cpuUsage(), t=performance.now(); fn(); const ms=performance.now()-t; const usage=process.cpuUsage(cpu); return {ms,cpuMs:(usage.user+usage.system)/1000}; }
function summary(runs) { const a=runs.map(x=>x.ms).sort((a,b)=>a-b); return {medianMs:a[Math.floor(a.length/2)],rangeMs:[a[0],a.at(-1)],runs}; }
const mode = process.argv[2] ?? 'micro';
const turns = mode==='large'?10000:2000;
const f=fixture(turns);
try {
  const meta={mode,turns,requestBytes:f.requestBytes,sqlite:f.db.$client.prepare('select sqlite_version() version').get().version,node:process.version,load:loadavg(),logicalCpus:cpus().length};
  if(mode==='plan') {
    console.log(JSON.stringify({...meta,before:f.db.$client.prepare('EXPLAIN QUERY PLAN '+oldSql).all(...f.params),after:f.db.$client.prepare('EXPLAIN QUERY PLAN '+f.sql).all(...f.params)},null,2));
  } else if(mode==='profile') {
    f.micro('before'); f.micro('after');
    console.log(JSON.stringify({...meta,failures:0,profileOnly:true}));
  } else if(mode==='large') {
    f.micro('after'); f.path('after');
    const micro=Array.from({length:5},()=>timed(()=>f.micro('after')));
    const path=Array.from({length:5},()=>timed(()=>f.path('after')));
    console.log(JSON.stringify({...meta,micro:summary(micro),path:summary(path),failures:0},null,2));
  } else {
    const run=mode==='path'?f.path:f.micro;
    run('before');run('after');
    const runs={before:[],after:[]};
    for(let pair=0;pair<5;pair++) for(const side of (pair%2?['after','before']:['before','after'])) runs[side].push(timed(()=>run(side)));
    console.log(JSON.stringify({...meta,before:summary(runs.before),after:summary(runs.after),failures:0},null,2));
  }
} finally { f.db.$client.close(); }

Expected vs actual

Actual, observed live: the following are the three verbatim Slow DB query lines from ~/.bb/logs/server.129.log, ending at 00:13:54, 00:18:10, and 00:24:22 PT on November 10, 2026. The logger already replaces SQL literals with ?; these entries contain no prompt text, thread titles, home-directory paths, or bound values.

{"level":30,"time":1794298434864,"component":"server","bindingArgumentCount":7,"durationMs":207377.5,"cpuDurationMs":200292.2,"operation":"get","sql":"select \"sequence\" from \"events\" \"retry_chain_accepted\" where (\"retry_chain_accepted\".\"thread_id\" = ? and \"retry_chain_accepted\".\"type\" = ? and exists (select \"sequence\" from \"events\" \"retry_chain_request\" where (\"retry_chain_request\".\"thread_id\" = ? and \"retry_chain_request\".\"type\" = ? and json_extract(\"retry_chain_request\".\"data\", '?') = json_extract(\"retry_chain_accepted\".\"data\", '?') and (json_extract(\"retry_chain_request\".\"data\", '?') = ? or json_extract(\"retry_chain_request\".\"data\", '?') = ?)))) limit ?","thresholdMs":100,"msg":"Slow DB query"}
{"level":30,"time":1794298690459,"component":"server","bindingArgumentCount":7,"durationMs":208241.7,"cpuDurationMs":197308.6,"operation":"get","sql":"select \"sequence\" from \"events\" \"retry_chain_accepted\" where (\"retry_chain_accepted\".\"thread_id\" = ? and \"retry_chain_accepted\".\"type\" = ? and exists (select \"sequence\" from \"events\" \"retry_chain_request\" where (\"retry_chain_request\".\"thread_id\" = ? and \"retry_chain_request\".\"type\" = ? and json_extract(\"retry_chain_request\".\"data\", '?') = json_extract(\"retry_chain_accepted\".\"data\", '?') and (json_extract(\"retry_chain_request\".\"data\", '?') = ? or json_extract(\"retry_chain_request\".\"data\", '?') = ?)))) limit ?","thresholdMs":100,"msg":"Slow DB query"}
{"level":30,"time":1794299062144,"component":"server","bindingArgumentCount":7,"durationMs":231502.5,"cpuDurationMs":217978.4,"operation":"get","sql":"select \"sequence\" from \"events\" \"retry_chain_accepted\" where (\"retry_chain_accepted\".\"thread_id\" = ? and \"retry_chain_accepted\".\"type\" = ? and exists (select \"sequence\" from \"events\" \"retry_chain_request\" where (\"retry_chain_request\".\"thread_id\" = ? and \"retry_chain_request\".\"type\" = ? and json_extract(\"retry_chain_request\".\"data\", '?') = json_extract(\"retry_chain_accepted\".\"data\", '?') and (json_extract(\"retry_chain_request\".\"data\", '?') = ? or json_extract(\"retry_chain_request\".\"data\", '?') = ?)))) limit ?","thresholdMs":100,"msg":"Slow DB query"}

Actual, synthetic: complete benchmark output, copied verbatim from the existing report. before is the frozen original SQL and after is the replacement SQL on identical rows; large is replacement-only.

micro.json
{
  "mode": "micro",
  "turns": 2000,
  "requestBytes": 2562000,
  "sqlite": "3.53.2",
  "node": "v22.19.0",
  "load": [
    2.17626953125,
    3.20703125,
    5.10302734375
  ],
  "logicalCpus": 18,
  "before": {
    "medianMs": 2138.263959000001,
    "rangeMs": [
      2119.262084,
      2280.791292
    ],
    "runs": [
      {
        "ms": 2128.1962080000003,
        "cpuMs": 2126.676
      },
      {
        "ms": 2119.262084,
        "cpuMs": 2117.353
      },
      {
        "ms": 2138.263959000001,
        "cpuMs": 2145.219
      },
      {
        "ms": 2164.3389590000006,
        "cpuMs": 2164.051
      },
      {
        "ms": 2280.791292,
        "cpuMs": 2246.61
      }
    ]
  },
  "after": {
    "medianMs": 1.5669170000001031,
    "rangeMs": [
      1.5357500000000073,
      1.6283340000009048
    ],
    "runs": [
      {
        "ms": 1.5669170000001031,
        "cpuMs": 1.57
      },
      {
        "ms": 1.5357500000000073,
        "cpuMs": 1.537
      },
      {
        "ms": 1.6283340000009048,
        "cpuMs": 1.633
      },
      {
        "ms": 1.5551250000007713,
        "cpuMs": 1.557
      },
      {
        "ms": 1.623583000000508,
        "cpuMs": 1.627
      }
    ]
  },
  "failures": 0
}
path.json
{
  "mode": "path",
  "turns": 2000,
  "requestBytes": 2562000,
  "sqlite": "3.53.2",
  "node": "v22.19.0",
  "load": [
    2.0751953125,
    3.13134765625,
    5.04248046875
  ],
  "logicalCpus": 18,
  "before": {
    "medianMs": 2163.513209,
    "rangeMs": [
      2142.2402920000004,
      2174.007791
    ],
    "runs": [
      {
        "ms": 2163.513209,
        "cpuMs": 2161.758
      },
      {
        "ms": 2170.3265839999995,
        "cpuMs": 2170.841
      },
      {
        "ms": 2174.007791,
        "cpuMs": 2192.131
      },
      {
        "ms": 2159.016334,
        "cpuMs": 2160.239
      },
      {
        "ms": 2142.2402920000004,
        "cpuMs": 2143.273
      }
    ]
  },
  "after": {
    "medianMs": 2.5096250000005966,
    "rangeMs": [
      2.3572079999994457,
      2.681749999999738
    ],
    "runs": [
      {
        "ms": 2.5096250000005966,
        "cpuMs": 2.511
      },
      {
        "ms": 2.519459000000097,
        "cpuMs": 2.524
      },
      {
        "ms": 2.681749999999738,
        "cpuMs": 5.241
      },
      {
        "ms": 2.4359999999996944,
        "cpuMs": 3.568
      },
      {
        "ms": 2.3572079999994457,
        "cpuMs": 2.351
      }
    ]
  },
  "failures": 0
}
large.json
{
  "mode": "large",
  "turns": 10000,
  "requestBytes": 12810000,
  "sqlite": "3.53.2",
  "node": "v22.19.0",
  "load": [
    2.125,
    3.09130859375,
    4.994140625
  ],
  "logicalCpus": 18,
  "micro": {
    "medianMs": 8.073999999999955,
    "rangeMs": [
      7.815124999999966,
      8.184875000000034
    ],
    "runs": [
      {
        "ms": 8.184875000000034,
        "cpuMs": 8.66
      },
      {
        "ms": 8.17304200000001,
        "cpuMs": 8.159
      },
      {
        "ms": 8.073999999999955,
        "cpuMs": 8.078
      },
      {
        "ms": 7.988165999999978,
        "cpuMs": 7.984
      },
      {
        "ms": 7.815124999999966,
        "cpuMs": 7.815
      }
    ]
  },
  "path": {
    "medianMs": 9.119082999999932,
    "rangeMs": [
      8.955040999999937,
      9.45900000000006
    ],
    "runs": [
      {
        "ms": 9.235042000000021,
        "cpuMs": 9.232
      },
      {
        "ms": 8.955040999999937,
        "cpuMs": 8.948
      },
      {
        "ms": 9.103000000000065,
        "cpuMs": 9.097
      },
      {
        "ms": 9.119082999999932,
        "cpuMs": 9.114
      },
      {
        "ms": 9.45900000000006,
        "cpuMs": 13.02
      }
    ]
  },
  "failures": 0
}

Expected: sending a new prompt should not block unrelated HTTP and WebSocket requests for the duration of an acceptance-history scan. The acceptance check should avoid repeating the request-history scan for every accepted input, while keeping the same query result and queue state: no accepted input for this fixture and the unaccepted retry retained as superseded inside the transaction.

Evidence

Observed facts and measurement method. The live logs above time the acceptance statement, not a complete HTTP request. durationMs records wall time and cpuDurationMs records executing-thread CPU time. The original private investigation (thr_m5frcbr4p2) is not publicly linkable; its relevant report, synthetic reproduction, raw timing output, and code permalinks are included here instead.

The 10-second /usr/bin/sample capture began at 00:14:48 PT on November 10, 2026. All 6,500 main-thread samples were under better-sqlite3 Statement.get → sqlite3_step; the three V8 GC helper threads were idle. Relevant verbatim stack lines, with unrelated frames omitted:

    6500 Thread_74487797   DispatchQueue_1: com.apple.main-thread  (serial)
    +                                                                       6500 TypeSafeCallback<Statement, &Statement::JS_get(Napi::CallbackInfo const&)>(napi_env__*, napi_callback_info__*)  (in darwin-arm64.node) + 772  [0x109ec4960]
    +                                                                         6500 sqlite3_step  (in darwin-arm64.node) + 660  [0x109d458ac]

Synthetic timing summaries from the raw outputs above:

Acceptance query: 2,138.264 ms → 1.567 ms median, with five warmed runs per side in alternating before/after order. Ranges were 2,119.262–2,280.791 ms before and 1.536–1.628 ms after.

The supersede transaction/API path measured 2,163.513 ms → 2.510 ms median (ranges 2,142.240–2,174.008 and 2.357–2.682 ms). The original query accounts for nearly all of that path's time. Process CPU time was close to wall time, consistent with synchronous SQLite CPU work.

At 10,000 request events and 9,999 accepted inputs, the replacement query measured 8.074 ms median (7.815–8.185 ms); the transaction/API path measured 9.119 ms (8.955–9.459 ms), five warmed runs each. The original query was not run at 10,000 events. All recorded runs had zero assertion failures or mismatched outcomes.

The harness uses performance.now() around each synchronous call and process.cpuUsage() for process CPU time. Each before/after mode warms both sides, then alternates their order across five measured pairs; the raw JSON includes every run, the median, range, and failure count. The transaction/path timer includes assertions and rollback; it is not full HTTP/UI latency. These are historical measurements, not reruns for this template rewrite.

Suspected cause, supported by source inspection and the synthetic reproduction.

hasAcceptedQueuedRetryInput scans turn/input/accepted events. For each candidate accepted event, its EXISTS subquery searches client/turn/requested events and extracts request IDs from their JSON again. With many accepted inputs and an unaccepted queued retry, this repeats request-history work without finding a match.

The check runs only when there is an eligible overtaken retry: claimed and already-superseded retries are excluded.

The caller, supersedeQueuedRetriesInTransaction, runs this check while processing a new turn request inside the send path's immediate write transaction. The SQLite call is synchronous, so it also blocks the server's JavaScript thread until it completes.

Proposed fix: PR #7474 implements the query rewrite below. The historical checks described here belong to the tested source commit, not a refreshed current-main verification.

Keep the outer accepted-event filters and LIMIT 1. Replace the correlated EXISTS with membership in an uncorrelated request-ID subquery:

json_extract(accepted.data, '$.clientRequestId') IN (
  SELECT json_extract(request.data, '$.requestId')
  FROM events AS request
  WHERE request.thread_id = :thread
    AND request.type = 'client/turn/requested'
    AND (json_extract(request.data, '$.requestId') = :root
      OR json_extract(request.data, '$.retryOfRequestId') = :root)
)

This lets SQLite collect the root/direct-retry request IDs without repeating the request scan for each accepted event. It preserves the existing direct-retry predicate, not recursive ancestry. In this positive WHERE filter, missing/null IDs and duplicates do not change which accepted events match. No schema, index, cache, or queue-state change is needed.

The query rewrite was checked against the original SQL on the same rows, with independently specified queue outcomes for accepted and unaccepted roots, direct retries, deeper descendants, duplicate/null/missing IDs, thread isolation, and no queued retry. At the tested source, 140 existing tests passed across packages/db/test/query-plans.test.ts, packages/db/test/data/queued-thread-messages.test.ts, packages/db/test/data/queued-message-waits.test.ts, and apps/server/test/threads/turn-failed-retry.test.ts. One additional local SQL-parity test covered the cases above (141 total); it is not included in the production-only diff under Steps to reproduce. DB typecheck and type-aware lint also passed. These checks were not refreshed against current main.

On SQLite 3.53.2, the original query plan uses events_thread_type_sequence_idx on both scans and labels the inner operation SEARCH request EXISTS, without CORRELATED. Checking only for that word or for index use would miss this repeated work. The harness's plan mode prints both plans.

What you ruled out

  • Still present in source on main at 7794941da1b6e2baf017e5f7ab65b5f223fcaf54; full-server behavior and benchmark timings were not retested there.
  • Not dependent on private data, providers, network, or credentials in the synthetic reproduction: the harness generates an in-memory migrated database and invokes the database API directly.
  • Not GC in the sampled freeze: all main-thread samples were inside the SQLite statement and the V8 GC helper threads were idle.
  • Not an unconditional cost of every send: the check runs only for an eligible overtaken retry; claimed and already-superseded retries are excluded.
  • Not an exact duplicate of #6835: that report covers broader synchronous-SQLite event-loop stalls; this one isolates the queued-retry acceptance query.
  • Not #6786/#6787: those addressed a different send-admission history scan; this acceptance check remains unchanged.
  • PR #7474 proposes a fix for this exact acceptance check, using the membership rewrite described above.
  • Not the five other event-query optimizations in #7288: this acceptance check remains unchanged. #6727 introduced retry supersession, rather than fixing this performance problem.

Suggested priority and effort (optional)

Not assessed. The observed impact is a whole-server freeze while the query runs; the supplied evidence does not establish the total affected-user count, data or work loss, or a measured workaround.

Checks

  • I reproduced this on the latest release or on main, or I say above that I could not.
  • I searched open and closed issues for the same problem.
  • If an agent wrote this, the body ends with > AGENT GENERATED. The investigation ran in a private bb thread (thr_m5frcbr4p2) that cannot be linked, so this issue carries its report in full instead: the benchmark harness, the timing output, the log excerpts and the code permalinks above.

AGENT GENERATED

Activity

  1. added theissue type on Nov 12, 2026
  2. added
    threads
    confirmed-repro
    on Nov 12, 2026
  3. bb-slop-cop commented on Nov 12, 2026

    @bb-slop-cop
    Contributor

    🚨 SLOP COP 🚨 · new-issue-autopilot

    • Classification: Bug · High priority · Low effort. Applied threads, perf, and confirmed-repro; no existing classifications were replaced.
    • Verdict: REPRODUCED · Root-cause confidence: high. Reproduction and root-cause report.
    • Root cause: The correlated acceptance lookup repeatedly JSON-scans request history during synchronous retry supersession inside the new-request write transaction.
    • Evidence: A newly authored regression on trusted main stalls for 7.62 seconds, then 7.61 seconds in a second clean checkout. The final repaired run takes 9.26 ms with correct queue outcomes. This does not verify the historical 207-second production incident.
    • Fix: Ready, unmerged PR #7474. Two files, 240 changed text lines; regression fails before and passes after. All 148 relevant tests, database typecheck, type-aware lint, and diff checks pass.
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-reproperfthreads

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions