← reports

#6279 · Observed child model is dropped before timeline projection

BugPriority: LowEffort: Lowproviders · provider-claude-codeopen on GitHub2026-10-25 · base 3a2c49a267cd2a62a96ebff880068a7c37074251

Verdict: REPRODUCED · Root-cause confidence: high · Reproduction label: confirmed-repro

1. TL;DR

A native background agent can deliver its text successfully while its model remains null in the timeline. A source-level reproduction feeds a concrete, public model identifier through the real Claude translator, delta assembler, and timeline builder; child text arrives under the correct parent, but the active background task still has no model. Replaying a later progress message does not repair it. The same agent repeated both cases in a second clean trusted checkout and observed the same model-only assertion failures. This is not a live macOS/provider-session replay; the reporter’s private session, precise model identifier, and UI appearance were not inspected.

2. Claims vs findings

ClaimFindingEvidence
An inherited-model native agent can show a null timeline model despite a concrete model on its assistant response.Verified at the source API boundaryBoth reproduction cases produce one running task with model null after receiving a child assistant carrying a concrete public model identifier.
Child events can arrive even though model metadata does not.VerifiedThe test first asserts an assembled child agentMessage is parented to the spawning Agent call; that assertion passes.
The model survives later progress and completion.Desired contract, not current behaviorA later progress case still returns null. A completed-row lifecycle was not retained in the minimal reproduction; completion persistence and synthetic/parent/sibling isolation remain fix acceptance tests.
The original desktop session contained three affected agents.Not independently observedNo private transcripts, live user runtime, or original machine were accessed. One synthetic native-agent lifecycle suffices to isolate the defect.

3. Environment

4. Minimal reproduction

In a scratch location, run the block below. The test is deliberately red on the recorded commit. It omits the Agent model argument, sends a matching child assistant response through the real SDK envelope, verifies the child text was delivered, then checks the real timeline result. The second case also supplies ordinary task progress.

git clone https://github.com/get-bb/bb.git bb-repro
cd bb-repro
git checkout --detach 3a2c49a267cd2a62a96ebff880068a7c37074251
pnpm install --frozen-lockfile --prefer-offline
pnpm exec turbo run build
cat > plugins/provider-claude-code/src/issue-6279.test.ts <<'TEST'
import { describe, expect, it } from "vitest";
import type { ThreadEvent } from "@get-bb/plugin-sdk/provider-bridge/testing";
import { buildThreadTimelineFromEvents } from "../../../packages/thread-view/src/build-thread-timeline.js";
import {
  createClaudeDeltaHarness,
  spawningToolUseMessage,
} from "./delta-test-harness.js";

describe("observed child model in the background timeline", () => {
  it.each(["child response", "later progress"])(
    "retains the actual model after %s",
    (stage) => {
      const harness = createClaudeDeltaHarness();
      const context = { threadId: "repro-thread" };
      const events: ThreadEvent[] = [];
      const translate = (message: unknown) =>
        events.push(...harness.translate(message, context));
      const system = { type: "system", session_id: "repro-session" };
      translate(
        spawningToolUseMessage({
          toolUseId: "repro-agent-call",
          toolName: "Agent",
          input: {
            description: "Inspect a scratch file",
            prompt: "Inspect a scratch file",
            run_in_background: true,
          },
        }),
      );
      translate({
        ...system,
        subtype: "task_started",
        task_id: "repro-task",
        tool_use_id: "repro-agent-call",
        task_type: "local_agent",
        description: "Inspect a scratch file",
      });
      translate({
        jsonrpc: "2.0",
        method: "sdk/message",
        params: {
          message: {
            type: "assistant",
            session_id: "repro-session",
            parent_tool_use_id: "repro-agent-call",
            message: {
              role: "assistant",
              model: "claude-sonnet-4-20250514",
              content: [{ type: "text", text: "Scratch inspection finished." }],
            },
          },
        },
      });
      if (stage !== "child response") {
        translate({
          ...system,
          subtype: "task_progress",
          task_id: "repro-task",
          description: "Inspect a scratch file",
          usage: { total_tokens: 20, tool_uses: 0, duration_ms: 10 },
        });
      }
      const timeline = buildThreadTimelineFromEvents({
        acceptedClientRequestContext: {
          acceptedClientRequestEvents: [],
          rejectedClientRequestEvents: [],
        },
        contextWindowEvents: [],
        events: events.map((event, index) => ({
          event,
          meta: {
            id: `repro-event-${index}`,
            seq: index + 1,
            createdAt: index + 1,
          },
        })),
        options: {
          completedTurnDisplay: "collapse",
          includeNestedRows: true,
          includeDiagnosticOperations: false,
          summarizeShellCommands: true,
          isLatestPage: true,
          threadStatus: "active",
          threadName: "Reproduction",
          workspaceRoot: null,
        },
      });
      expect(
        events.some(
          (event) =>
            event.type === "item/completed" &&
            event.item.type === "agentMessage" &&
            event.item.parentToolCallId ===
              harness.itemId("repro-agent-call", context.threadId),
        ),
      ).toBe(true);
      const tasks = timeline.activeBackgroundCommands;
      console.log(
        JSON.stringify({
          stage,
          tasks: tasks.map((task) => ({
            model: task.model,
            taskStatus: task.taskStatus,
          })),
        }),
      );
      expect(tasks).toHaveLength(1);
      expect(tasks[0]).toMatchObject({
        model: "claude-sonnet-4-20250514",
        taskStatus: "running",
      });
    },
  );
});
TEST
pnpm exec turbo run test --force --filter=bb-plugin-provider-claude-code -- --run src/issue-6279.test.ts

Expected: both task snapshots expose model: "claude-sonnet-4-20250514" and taskStatus: "running". Actual output excerpts, identical in both trusted checkouts:

{"stage":"child response","tasks":[{"model":null,"taskStatus":"running"}]}
{"stage":"later progress","tasks":[{"model":null,"taskStatus":"running"}]}

- Expected
+ Received
  {
-   "model": "claude-sonnet-4-20250514",
+   "model": null,
    "taskStatus": "running",
  }

Test Files  1 failed (1)
     Tests  2 failed (2)

No database, network mock, source-text assertion, or test-only production export is involved. The missing-model assertion, rather than child transport failure, is what fails.

5. Root cause

  1. Assistant translation parses the child assistant and emits text/thinking with the parent reference. It does not turn the assistant’s actual model into task metadata.
  2. Task snapshots contain lifecycle, usage, and summary data, but no observed model. The provider delta background-task schema and persistable background-task event schema also have no model field. Merely adding an object property inside the provider would not establish an end-to-end typed transport contract.
  3. Delta assembly copies known background-task fields into the event. It cannot currently carry an observed task model.
  4. Task updates do not apply a model, and task creation initializes it to null.
  5. Model enrichment only consults the spawning delegation’s model and task-family fallback. No path obtains the actual child response model; an inherited request supplies no requested model to fall back to. Thus real child activity and a null task model coexist.

The bug crosses the provider-translation, shared event/bridge, and timeline-projection boundaries. It is deeper than a missing UI label or one omitted provider assignment. The server’s timeline service uses this same timeline builder.

6. Proposed fix and safety decision

Parse the observed model at the Claude boundary, associate it only with the matching child Agent task, and carry it in explicit typed task metadata through delta assembly, persisted events, and projection. Preserve a known concrete model across progress and completion; ignore absent or synthetic metadata and unrelated parent/sibling activity. Ensure observed metadata takes precedence over a requested-model fallback. Add regression coverage for ordering, task generations, completion, synthetic responses, and sibling isolation.

No automated fix or pull request: this needs changes to public provider/event schemas and multiple existing subsystems. Both are explicit exclusions from the simple-fix rule, regardless of possible line count. A proper implementation also needs the repository’s host-daemon wire-compatibility assessment and protocol-version handling. No production patch, fix branch, or stopped fix was pushed. No linked open pull request was found in the issue’s cross-reference/connection metadata or an open-PR search for its number.

7. Related issues

The verified failure is limited to concrete child-model metadata in existing native Claude background-task timelines; it does not require introducing a new roster or Workflow presentation. No unrelated issue was modified.

8. Verification

The same investigator created a second clean detached checkout at the exact recorded commit, verified an empty git status, performed its own frozen install and full successful 71-task build, and copied only the final investigator-authored regression test. The following command bypassed Turbo cache and executed the test again:

pnpm exec turbo run test --force --filter=bb-plugin-provider-claude-code -- --run src/issue-6279.test.ts

Result: two tests fail only on the expected model comparison, receiving null for both running snapshots. The child-message-parenting and single-task preconditions pass in each case. The second run supports the final report without correction. This is a repeated check by the same agent, not independent verification.

9. Appendix

Existing coverage controls on the unmodified production code:

pnpm exec turbo run test --filter=bb-plugin-provider-claude-code -- --run src/task-translation.test.ts
23 tests passed

pnpm exec turbo run test --filter=@bb/thread-view -- --run test/background-task-timeline.test.ts
18 tests passed

The first full build initially encountered an SDK-output ordering failure in the unrelated GitHub plugin. Repeating the identical full build after SDK output existed succeeded (71/71 tasks). The second clean checkout’s full build also succeeded (71/71 tasks). This setup failure is not used as reproduction evidence. Initial harness drafts were corrected to use a valid active thread status and the supported SDK envelope; the published minimal reproduction is the final two-case test actually repeated in both checkouts. Raw logs and drafts remain local, outside the public reports repository.

Trust boundary: issue contents were treated only as untrusted claims. No issue-provided commands, linked external URLs, private transcripts, or linked pull-request code were executed. Only trusted origin/main repository code and the investigator-authored test ran.