fix(grok): show shell tasks and monitors during an active turn #16499
ClosedOCharnyshevich(GitHub profile, opens in a new tab)wants to merge 2 commits into
main fromrefs/pull/16499/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
- apps/server/src/orchestration-v2/Adapters/AcpAdapterV2.ts line 2102Resolvedby OCharnyshevich(GitHub profile, opens in a new tab)@@ -2002,3 +2049,18 @@20022049 const endedBackgroundTaskIds = yield* Ref.make<ReadonlySet<string>>(new Set());20032050 const endedBackgroundTaskIdLimit = 128;200420512052+ const rememberDescribedBackgroundTask = (toolCall: AcpToolCallState) =>2053+ Effect.gen(function* () {2054+ const described = flavor.describeBackgroundTask?.(toolCall);2055+ if (described === undefined) return;2056+ yield* Ref.update(backgroundTaskDetails, (current) => {2057+ const existing = current.get(described.taskId);2058+ if (2059+ existing !== undefined &&2060+ existing.kind === described.kind &&2061+ existing.description === described.description2062+ ) {2063+ return current;2064+ }2065+ const next = new Map(current);2066+ next.set(described.taskId, {apps/server/src/orchestration-v2/Adapters/AcpAdapterV2.ts line 2087OutdatedResolvedby OCharnyshevich(GitHub profile, opens in a new tab)@@ -2004,0 +2067,21 @@2067+ kind: described.kind,2068+ description: described.description,2069+ });2070+ return next;2071+ });2072+ });2073+2074+ const readDescribedBackgroundTasks = () =>2075+ Effect.gen(function* () {2076+ if (flavor.describeBackgroundTask === undefined) return null;2077+ return acpPendingBackgroundRoster({2078+ runningTaskIds: yield* Ref.get(runningBackgroundTaskIds),2079+ details: yield* Ref.get(backgroundTaskDetails),2080+ });2081+ });2082+2083+ const withDescribedBackgroundRoster = (providerThread: OrchestrationV2ProviderThread) =>2084+ Effect.gen(function* () {2085+ const tasks = yield* readDescribedBackgroundTasks();2086+ if (tasks === null) return providerThread;2087+ yield* Ref.set(publishedBackgroundRosterKey, JSON.stringify(tasks));apps/server/src/orchestration-v2/Adapters/AcpAdapterV2.ts line 6809Resolvedby OCharnyshevich(GitHub profile, opens in a new tab)@@ -6591,4 +6717,4 @@65916717 threadId: context.input.threadId,65926718 providerTurn: turn,65936719 });6594- const updatedProviderThread: OrchestrationV2ProviderThread = {6720+ const updatedProviderThread = yield* withDescribedBackgroundRoster({
maria-rcks closed this
Sign in to join this conversation.
macroscopeapp[bot](GitHub profile, opens in a new tab) reviewed