perf(server): ACP item ordinals no longer copy a session-wide map per item #13868
Mergedjuliusmarmingemerged 1 commit into
t3code/codex-turn-mapping fromrefs/pull/13868/headmerged by juliusmarminge View on GitHubgithub-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:M
- @@ -2077,18 +2079,4 @@207720792078- const resolveItemOrdinal = Effect.fnUntraced(function* (2079- context: ActiveAcpTurn,2080- nativeItemId: string,2081- ) {2082- const existing = (yield* Ref.get(itemOrdinals)).get(nativeItemId);2083- if (existing !== undefined) return existing;2084- const nextWithinTurn = yield* Ref.modify(nextItemOrdinalsByTurn, (current) => {2085- const next = (current.get(context.nativeTurnId) ?? 0) + 1;2086- const updated = new Map(current);2087- updated.set(context.nativeTurnId, next);2088- return [next, updated] as const;2089- });2090- const ordinal = context.input.providerTurnOrdinal * 100 + nextWithinTurn;2091- yield* Ref.update(itemOrdinals, (current) => {2092- const updated = new Map(current);2093- updated.set(nativeItemId, ordinal);2094- return updated;2080+ const resolveItemOrdinal = (context: ActiveAcpTurn, nativeItemId: string) =>2081+ Effect.sync(() => {2082+ const existing = context.itemOrdinals.get(nativeItemId);
juliusmarminge merged this52d84bd
juliusmarminge closed this
Sign in to join this conversation.
macroscopeapp[bot](GitHub profile, opens in a new tab) approved these changes