Adds a subagent_text replay fixture recorded against the real Claude
Agent SDK (CLI 2.1.220): a background subagent that narrates, reads a
file, and answers — the exact frame sequence (task_started, ptu-tagged
narration text, ptu-tagged Read, ptu-tagged final text,
task_notification with the same summary) observed in the production
session that motivated the routing fix. The full-orchestrator replay
asserts the parent thread carries only the parent's own assistant
message while the child thread carries exactly the streamed narration
and final answer in stream order with no duplicated notification
result. Verified to fail against the pre-fix adapter with three parent
assistant messages, reproducing the reported transcript bleed.
Recording on the current CLI surfaced two gaps: replay rejected
stream_event frames (now part of the recorded diet) and TaskOutput was
missing from the known native tool table.
Only background subagents forward ptu-tagged assistant text into the
parent stream — foreground subagents return text via the Agent
tool_result — which is why the pre-existing foreground subagent fixture
never exercised this path.
Co-Authored-By: Claude Fable 5 <[email protected]>
The Claude Agent SDK forwards subagent assistant messages into the
parent query stream tagged with parent_tool_use_id. The adapter already
honored that attribution for tool uses (ensureToolCallStarted) but the
assistant-text path ignored it, so every streamed subagent narration and
final answer projected as parent-thread assistant prose — interleaved
across concurrent subagents and duplicating the summary the child
thread receives via task_notification.
Assistant text now resolves the same subagentsByToolUseId registry and
lands in the subagent's child thread. The child-thread result message
becomes a fallback for streams that were never forwarded: once a
subagent has streamed text since (re)open, the task_notification
summary no longer re-emits as a duplicate child message (the parent
subagent card still carries task.result). Attributed text whose
registry lookup misses is dropped with a warning instead of leaking
into the parent transcript.
Subagent text dedupes against a per-subagent set rather than the parent
turn's emittedNativeItemIds, which gates the parent fallback-text
emission and must not be suppressed by subagent traffic.
Co-Authored-By: Claude Fable 5 <[email protected]>
Effect service conventions: ThreadManagementThreadNotSendableError
carried an Archived/NoSteerableRun reason union and switched on
reason._tag inside the message getter. Modelled as two error classes
(ThreadManagementThreadArchivedError, ThreadManagementNoSteerableRunError);
both still map to the MCP thread_not_sendable failure code.
Co-Authored-By: Claude Fable 5 <[email protected]>
The turn item materialized when a queued run is promoted was emitted
with inputIntent "turn_start", but the deterministic replay driver (and
the recorded queued_turn fixtures) expect "queued_turn" — the mismatch
stalled replay before the queued run could start, leaving run 1 waiting
and run 2 queued forever in all five queued_turn fixtures.
Co-Authored-By: Claude Fable 5 <[email protected]>
Follow-ups from the main merge:
- Migration numbering: main's 035_ProjectionThreadTitleRegeneration is
released and keeps its id; this branch's unreleased v2 migrations shift
to 036-044 instead (a released migration can never be renumbered).
- thread.metadata.update accepts regenerateTitle: true arms an in-flight
titleRegeneration marker on the thread payload (requestId + startedAt),
a landing title or explicit false clears it. The marker projects onto
thread shells and through the client-runtime shell model, so the
sidebar's Regenerating state works unchanged.
- New ThreadTitleRegenerationService worker reacts to armed markers on
the live domain-event stream (so ws, MCP, and mobile dispatches all
behave the same): builds a newest-first conversation digest from the
v2 projection (8k-char budget, retained attachments — ported from the
v1 reactor), generates via TextGeneration, and lands the title with a
follow-up metadata update. Failures clear the marker and log.
- The server advertises threadTitleRegeneration again, and the client
updateThreadMetadata dispatches regenerateTitle-only updates.
Co-Authored-By: Claude Fable 5 <[email protected]>
A renderer performance trace showed the minimap strips as a standing
source of main-thread frame work: each strip transitioned
background-color (paint) and width (layout), and both fire constantly —
scrolling or streaming flips a band of in-view states at once, and the
hover fisheye animates several widths at a time — so any interaction
kept a 60fps style/layout/paint pipeline running.
The strip now animates only compositor-friendly properties: width tiers
are scale-x on a fixed-width box, and the in-view highlight is a bright
overlay faded with opacity. The scroll handler also skips no-op
data-in-view attribute writes, which previously re-dirtied style state
for every strip on every scroll tick.
Co-Authored-By: Claude Fable 5 <[email protected]>
Live profiling of the built app (debugger pause inside the hot sqlite
call) showed AgentAwarenessRelay.publishThread grinding at ~8 full shell
snapshots per second after boot. Two causes:
- streamDomainEvents was eventSink.stream() with no cursor, which
replays every stored event from genesis before going live — so each
boot fed the relay the entire event history as fresh activity, and it
queued a publish per activity-relevant event for hours. It now tails
from the current high-water mark; the relay's startup snapshot publish
already covers initial state, and the sink subscribes before reading
the cursor so no live event is lost.
- publishThreadUnsafe materialized the full shell snapshot to find one
thread; it now uses getThreadShell (archived/deleted map to the
tombstone path exactly as the active-list lookup did).
Co-Authored-By: Claude Fable 5 <[email protected]>
- Disable LegendList end-maintenance that could snap after user scrolling
- Cancel stale imperative scrolls and release settled turn anchors
- Stabilize handoff run data to avoid per-event timeline rerenders