The best way to control Claude Code, Codex and more from any computer or phone
perf(client-runtime): stop tracing streamed thread batches (#30679)
Elliot Drel committed
Nov 5, 2026 at 23:33 UTC
66e96e52a436831b4e50cc7bd28ab7929a7ba968
1 file changed
+4
-4
packages/client-runtime/src/state/threads.ts
+4
-4
@@ -501,9 +501,8 @@ export const makeEnvironmentThreadState = Effect.fn("EnvironmentThreadState.make
501
OrchestrationV2ThreadStreamItem,
502
{ kind: "event" | "unknown-event" }
503
>;
504
- const applyEventsLocked = Effect.fn("EnvironmentThreadState.applyEventsLocked")(function* (
505
- items: ReadonlyArray<SequencedItem>,
506
- ) {
504
+ // Per-batch streaming spans add trace volume without a useful timing boundary.
505
+ const applyEventsLocked = Effect.fnUntraced(function* (items: ReadonlyArray<SequencedItem>) {
506
const appliedSequence = yield* SubscriptionRef.get(lastSequence);
507
let sequence = appliedSequence;
508
const fresh: EventItem[] = [];
@@ -662,7 +661,8 @@ export const makeEnvironmentThreadState = Effect.fn("EnvironmentThreadState.make
661
yield* applyEventsLocked([item]);
662
});
663
665
- const applyItems = Effect.fn("EnvironmentThreadState.applyItems")(function* (
664
+ // Keep this per-batch streaming path untraced for the same reason as applyEventsLocked.
665
+ const applyItems = Effect.fnUntraced(function* (
666
items: ReadonlyArray<OrchestrationV2ThreadStreamItem>,
667
) {
668
yield* applyLock.withPermits(1)(