Skip to content

bb thread log truncates silently: human view shows only the newest 20 segments, --json returns the oldest 100, no paging or 'more' indicator #1768

Closed

Description

@MGrin

Summary

[bb system] Child thread updates: messages are delivered to a parent thread correctly, but there is no reliable way to check afterwards whether a given parent ever received one. bb thread search does not match them at all, and bb thread log returns only the last 100 events by default with no paging in its human format.

That combination makes "did my orchestrator get told its worker died?" effectively unanswerable, which is how the question stays open.

Observed on bb 0.38.0, macOS 26.

The delivery itself works

Spawned two children from an active parent with --parent-self:

  • one that completes normally
  • one with a nonexistent --model, which reaches status: error

The parent received, in one batched message:

[bb system]
Child thread updates:

- @thread:thr_xfv65zmixr failed.
- @thread:thr_kiv7h2ec4a completed.

Both outcomes reported. No complaint about that part.

1. bb thread search cannot find them

$ bb thread search "Child thread updates" --json
  hits: 0

Zero — including for the parent thread that had received the message minutes earlier, and whose own bb thread log shows it 23 times. Whatever search indexes, it is not these.

2. bb thread log silently truncates

bb thread log --help documents --limit <count> as "Maximum number of events to return; json format only (default 100)". So:

  • the default human-readable output is capped at 100 events with no indication that anything was dropped, and no paging flag for that format;
  • on a long-lived orchestrator, greping the log for a notification is therefore checking a recent window while looking like it is checking history.

Concretely: three parents with 201, 147 and 3 children each return 0 matches — but each also hits the event cap, so I cannot distinguish "never delivered" from "outside the window returned". That ambiguity is the actual problem; I am not claiming those parents were not notified.

Why it matters

An orchestrator supervising workers wants to answer one question after the fact: was I told when a worker died? Today that requires being the live parent at the moment of delivery. Once the turn has passed, neither tool can answer it, and the default-capped log makes a negative result look authoritative when it is merely truncated.

Suggested fixes

  • Index [bb system] messages in bb thread search, or document that it deliberately excludes them.
  • Make truncation visible in bb thread log — print how many events were returned and whether more exist, and allow --limit/paging in the non-json formats too.
  • Optionally, a direct query: bb thread notifications <id>, or a --kind system filter on thread log.

Activity

  1. added theissue type on Aug 18, 2026
  2. added
    threads
    cli
    on Aug 18, 2026
  3. SawyerHood commented on Aug 18, 2026

    @SawyerHood
    Collaborator

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

    • Verdict: PARTIALLY REPRODUCED · root-cause confidence: high
    • Root cause (short): Search claim refuted ([bb system] child notifications ARE FTS-indexed as user_message segments via appendStoredThreadEventsInTransaction -> upsertThreadSearchSegments and found live at seq 19/144/183; only hidden threads or a phrase that never existed yield 0); log claim verified with a different mechanism: human bb thread log shows the newest 20 user-message segments and ignores timelinePage.hasOlderRows, --json returns the OLDEST 100 events (ORDER BY seq ASC LIMIT 100, so seq 144/183 were missing from a 180-event thread), and the minimal format collapses every mid-turn (steer) notification, so no default announces truncation.
    • Proposed fix: (1) In apps/cli/src/commands/thread/show.ts print a trailer when timeline.timelinePage.hasOlderRows is true and add --segments N / --all (paginate via olderCursor -> beforeAnchorSeq/beforeAnchorId; the API already supports it). (2) For --json either warn on stderr when events.length === limit (with the next --after-seq) and document that --limit returns the oldest N, or add a --tail/desc option (server change in listStoredEventRows). (3) Add bb thread notifications <id> (or thread log --system) backed by a targeted query on client/turn/requested with initiator='system' exposing the already…
    • Caveats: Live repro was redone from scratch on a fresh instance (server :22672, parent thr_kjmpu6p3i2) at 16ceb3a (worktree HEAD was a108fa7; checked out base detached); all repro/ artifacts overwritten in place, verifier's verify/ dir untouched. Batching into "Child thread updates:" is a 2 s race: in this run even the sequential bad+ok spawn batched (exactly the issue's wording), the verifier's did no…

    The report has copy-paste repro steps, screenshots where the bug is visual, code permalinks at 16ceb3a54, and repro artifacts. It was independently re-run by a second agent (see its Verification section).

    AGENT GENERATED: by Claude Opus 5

  4. added
    partial-repro
    on Aug 18, 2026
  5. changed the title [-]Child-thread notifications are unfindable after the fact: search misses them and thread log defaults to 100 events[/-] [+]bb thread log truncates silently: human view shows only the newest 20 segments, --json returns the oldest 100, no paging or 'more' indicator[/+] on Aug 18, 2026
  6. SawyerHood commented on Aug 18, 2026

    @SawyerHood
    Collaborator

    Retitled to match what reproduced (https://get-bb.github.io/reports/issues/1768.html). The search half of the report is refuted: [bb system] child-thread notifications ARE FTS-indexed as user_message segments and were found live (seq 19/144/183); only hidden threads or a phrase that never occurred give 0 hits. The log half is real, with a different mechanism than described: the human bb thread log shows the newest 20 user-message segments and ignores hasOlderRows, --json returns the OLDEST 100 events (ORDER BY seq ASC LIMIT 100), and the minimal format collapses mid-turn (steer) notifications — so nothing announces truncation. This issue now tracks that.

    AGENT GENERATED: by Claude Opus 5

  7. added
    confirmed-repro
    and removed
    partial-repro
    on Aug 18, 2026
  8. self-assigned this
    on Aug 21, 2026
  9. uje-m commented on Nov 10, 2026

    @uje-m

    Summary

    Follow-up to this closed issue: bb thread log <id> --all can still omit an accepted agent-to-agent steer inside a completed collapsed turn, even when the entire history has been paged. A deterministic fixture using the actual installed CLI returns exit 0 without the message; changing only the format to verbose exposes it. I expected --all to include all messages rather than silently omit the contents of completed turns.

    This extends the collapsed-steer part of the earlier investigation report, rather than filing a duplicate. The paging/truncation fix does not resolve this remaining case. Please consider reopening or tracking this remaining part separately.

    Versions and environment

    • bb 0.49.0, packaged from a local source fork at b6a45533105f4297d4480532b1a23aff9a5eb1d1, based on upstream 88c78686805e828dda9f8d61fd5cd29aca26c138.
    • Ubuntu 24.04.5 LTS, Linux 7.0.0-38-generic x86_64; Node on PATH v24.21.0; Python 3 fixture.
    • The reproduction below runs no provider, model, or real thread. It points the installed CLI at a disposable loopback HTTP fixture and does not mutate the running BB instance.
    • Qualification: I have not executed an unmodified latest upstream build. On current upstream main at 9cc701a2ac20fc1e719d320bb51b01bd5d368a9e, source inspection finds the same relevant CLI query and format-resolution logic. The only difference between that entire upstream show.ts and my baseline copy is unrelated archived-thread status printing.

    Steps to reproduce

    1. With bb on PATH, save this standalone fixture. It contains synthetic data only. The completed-turn response shape and includeNestedRows expansion behavior were also checked against the actual timeline API during the investigation.
    cat > /tmp/bb-log-all-repro.py <<'PY'
    import copy, http.server, json, os, subprocess, threading, urllib.parse
    
    needle = "SYNTHETIC_ACCEPTED_AGENT_MESSAGE"
    base = dict(threadId="thread-fixture", turnId="turn-fixture", sourceSeqStart=2,
                sourceSeqEnd=2, startedAt=2, createdAt=2)
    message = dict(base, id="message-fixture", kind="conversation", messageSeq=2,
                   role="user", text=needle, attachments=None, mentions=[],
                   initiator="agent", senderThreadId="sender-fixture",
                   systemMessageKind="unlabeled", systemMessageSubject=None,
                   turnRequest=dict(isGrouped=False, kind="steer", status="accepted"))
    turn = dict(base, id="turn-fixture", kind="turn", status="completed",
                summaryCount=1, completedAt=3, children=None)
    fixture = dict(rows=[turn], contextBoundarySeq=None, completedTurnDisplay="collapse",
                   activePromptMode=None, activeThinking=None, activeWorkflows=[],
                   activeBackgroundCommands=[], pendingTodos=None, extensionStates={},
                   providerCommands=None, sessionOptions=None, modelFallback=None,
                   maxSeq=3, tag="fixture", timelinePage=dict(returnedSegmentCount=1,
                   olderCursor=None, historySnapshot="fixture", olderRowsSourceSeqEnd=None))
    requests = []
    
    class Handler(http.server.BaseHTTPRequestHandler):
        def do_GET(self):
            query = urllib.parse.parse_qs(urllib.parse.urlsplit(self.path).query)
            requests.append(query)
            body = copy.deepcopy(fixture)
            if query.get("includeNestedRows") == ["true"]:
                body["rows"][0]["children"] = [message]
            data = json.dumps(body).encode()
            self.send_response(200)
            self.send_header("content-type", "application/json")
            self.send_header("content-length", str(len(data)))
            self.end_headers()
            self.wfile.write(data)
        def log_message(self, *_):
            pass
    
    server = http.server.ThreadingHTTPServer(("127.0.0.1", 0), Handler)
    worker = threading.Thread(target=server.serve_forever, daemon=True)
    worker.start()
    env = dict(os.environ, BB_SERVER_URL="http://127.0.0.1:" + str(server.server_port))
    try:
        for fmt in ["minimal", "verbose", "full"]:
            first = len(requests)
            result = subprocess.run(["bb", "thread", "log", "thread-fixture", "--all",
                                     "--format", fmt], env=env, cwd="/tmp",
                                    capture_output=True, text=True, timeout=20)
            print(json.dumps(dict(format=fmt, exit=result.returncode,
                                  containsMessage=needle in result.stdout,
                                  requests=requests[first:])))
    finally:
        server.shutdown()
        server.server_close()
        worker.join(timeout=5)
    PY
    1. Run:
    python3 /tmp/bb-log-all-repro.py

    The minimal and verbose commands are both supported. The third invocation deliberately tests an unsupported format, full, because that spelling contributed to the misleading audit; the supported minimal command reproduces the omission by itself.

    Expected vs actual

    Actual output, verbatim:

    {"format": "minimal", "exit": 0, "containsMessage": false, "requests": [{"segmentLimit": ["100"]}]}
    {"format": "verbose", "exit": 0, "containsMessage": true, "requests": [{"includeNestedRows": ["true"], "segmentLimit": ["100"]}]}
    {"format": "full", "exit": 0, "containsMessage": false, "requests": [{"segmentLimit": ["100"]}]}

    Expected: minimal --all should also report containsMessage: true. Verbose already does. Unsupported --format full should return a clear argument error listing json, minimal, and verbose, rather than exit 0 and silently behave like minimal.

    Evidence

    Observed current upstream source:

    In the original live investigation, supported single-message reads returned the supposedly absent originals. Their raw request/accepted events, SDK echoes, and Claude API request payloads with matching responses were also present. Those originals therefore do not establish a lost tell. This report is the narrower, reproduced log visibility/audit defect; it does not explain why an agent might fail to act on a delivered instruction.

    The inline fixture and captured output are the portable investigation report. Originating BB investigation thread: thr_wqwcxv7i9f (private); no private transcript contents or credentials are needed to reproduce.

    What I ruled out

    Suggested priority and effort

    Medium; complete-history audits can falsely report an accepted instruction absent. Workarounds are --all --format verbose or --message <seq> --json. No message deletion is demonstrated. A narrow candidate makes human-format --all request nested rows on every page and rejects invalid formats; its independent source reviews passed, but executable verification is still pending, so I am not presenting it as a verified upstream fix.

    Checks

    • I reproduced the installed fork and explicitly qualified the absence of an unmodified latest-upstream runtime reproduction.
    • I searched open and closed issues and am adding evidence to this existing report instead of creating a duplicate.
    • The self-contained investigation report, synthetic fixture, observed output and commit permalinks are included above.

    Beech, for Uje

    AGENT GENERATED

  10. uje-m commented on Nov 10, 2026

    @uje-m

    Verification follow-up to #1768 (comment):

    The narrow local-fork candidate is now verified on a remote Linux executor (Node24.21.0):

    • All three new incident regressions fail against the unchanged baseline CLI source, then pass against the repair.
    • Full CLI suite: 934 passed, one Windows-only skip, across76files. The22focused tests overlap that total.
    • CLI typecheck and build pass.
    • The actual built CLI against the synthetic HTTP fixture shows the accepted message for default/minimal/verbose --all; unsupported full exits1 before an HTTP read.
    • Source identity was checked before/after, and the complete execution receipt is uncapped exit0. Source review found no blocker.

    The change uses the existing includeNestedRows query for every human-format --all page and rejects unknown formats. No server/daemon wire change is needed. This verifies the local source correction, not an unmodified upstream-main build or a deployed fix. No provider/model call, production write, message resend or restart was involved. Expanded-history performance was not measured.

    The original distinction stands: this reproduces a CLI audit false negative; it does not establish that the original tells were dropped.

    Beech, for Uje

    AGENT GENERATED

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

cliconfirmed-reprothreads

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions