fix(server): bound Codex subagent progress events #5682
ClosedAndrey170170(GitHub profile, opens in a new tab)wants to merge 4 commits into
main fromrefs/pull/5682/headopened View on GitHubgithub-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:L
- @@ -47,9 +60,18 @@60+ const flushRequestedKeys = new Set(state.flushRequestedKeys);61+ flushRequestedKeys.delete(key);62+ return [null, { ...state, activeKeys, flushRequestedKeys }] as const;4763 }48644965 const latestByKey = new Map(state.latestByKey);5066 latestByKey.delete(key);51- return [nextValue, { ...state, latestByKey }] as const;67+ return [68+ {69+ value: nextValue,70+ flush: state.flushRequestedKeys.has(key),71+ },72+ { ...state, latestByKey },73+ ] as const;5274 }).pipe(Effect.tx),5375 ),54- Effect.flatMap((nextValue) =>55- nextValue === null ? Effect.void : processKey(key, nextValue),76+ Effect.flatMap((next) =>77+ next === null ? Effect.void : processKey(key, next.value, next.flush),
- @@ -141,0 +185,21 @@185+ activeKeys.add(key);186+ return [187+ { value },188+ {189+ ...state,190+ latestByKey,191+ queuedKeys,192+ activeKeys,193+ flushRequestedKeys,194+ },195+ ] as const;196+ }).pipe(197+ Effect.tx,198+ Effect.flatMap((item) =>199+ item === null200+ ? Effect.void201+ : processKey(key, item.value, true).pipe(202+ Effect.catchCause(() => cleanupFailedKey(key)),203+ ),204+ ),205+ Effect.andThen(drainKey(key)),@@ -92,4 +116,4 @@92116 activeKeys.add(key);9311794118 return [95- { key, value } as const,119+ { key, value, flush: state.flushRequestedKeys.has(key) } as const,
- apps/server/src/provider/Layers/CodexSessionRuntime.ts line 74OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -60,3 +62,13 @@6062 "does not exist",6163 ];626465+export const emitCodexCollabProgressBatch = Effect.fn("emitCodexCollabProgressBatch")(function* <66+ A,67+ E,68+ R,69+>(emission: Effect.Effect<A, E, R>, flush: boolean): Effect.fn.Return<A, E, R> {70+ // Leading-edge emission keeps a newly active child responsive. The71+ // cooldown follows the batch so updates arriving during it collapse into72+ // the next latest-state snapshot instead of delaying the first one.73+ const result = yield* emission;74+ if (!flush) {
t3dotgg(GitHub profile, opens in a new tab) closed this
Sign in to join this conversation.


Important
Review skipped#
Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
.coderabbit.yamlfile in this repository. To trigger a single review, invoke the@coderabbitai reviewcommand.⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID:
5cbe578b-4cd0-4c2a-9d64-5d3be26673c7You can disable this status message by setting the
reviews.review_statustofalsein the CodeRabbit configuration file.Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
❤️ Share