Skip to content
Source
Sign inSign up
pingdotgg/t3code

perf(server): Claude item ordinals no longer copy a session-wide map per item #13864

Mergedjuliusmarmingemerged 1 commit intot3code/codex-turn-mapping fromrefs/pull/13864/headmerged by juliusmarminge View on GitHub

Showing 1 changed file with 14 additions and 24 deletions.

x
0 of 1 viewed, 1 left
14 additions and 24 deletionsapps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.tsModified
View file
@@ -2479,6 +2479,10 @@
readonly providerTurnId: OrchestrationV2ProviderTurn["id"];
readonly providerTurnOrdinal: number;
readonly startedAt: DateTime.Utc;
+ // Item ordinals allocated in this turn. Later turns never look items up
+ // here: a subagent resumed from another turn keeps its ordinal on the
+ // session subagent registry.
+ readonly itemOrdinals: Map<string, number>;
readonly assistant: {
fallbackText: string;
fallbackNativeItemId: string;
@@ -2788,8 +2792,6 @@
const steeredTurns = yield* Ref.make(new Set<OrchestrationV2ProviderTurn["id"]>());
const queryContext = yield* Ref.make<ClaudeLiveQueryContext | null>(null);
const openedNativeThreads = yield* Ref.make(new Set<string>());
- const itemOrdinals = yield* Ref.make(new Map<string, number>());
- const nextItemOrdinalsByTurn = yield* Ref.make(new Map<string, number>());
const latestPlanByKind = yield* Ref.make(new Map<string, OrchestrationV2PlanArtifact>());
const planIdsByNativeItem = yield* Ref.make(
new Map<string, OrchestrationV2PlanArtifact["id"]>(),
@@ -3284,29 +3286,16 @@
- const resolveItemOrdinal = Effect.fnUntraced(function* (
- context: ActiveClaudeTurnContext,
- nativeItemId: string,
- ) {