fix(antigravity): keep silent turns open while native swarm workers are active #46824
Openitsthecsguy(GitHub profile, opens in a new tab)wants to merge 8 commits into
main fromrefs/pull/46824/headopened View on GitHubgithub-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched
itsthecsguy(GitHub profile, opens in a new tab) linked this to fix #45844
tanstack-source added labelsbug
- @@ -1645,0 +1734,21 @@1734+ return { bytes: stat.size, lastStepIndex: -1, hasOpenToolCall: false };1735+ }1736+ lineStart = newline + 1;1737+ }1738+ const steps = bytes1739+ .toString("utf8", lineStart)1740+ .split("\n")1741+ .flatMap((line) => {1742+ const decoded = decodeTranscriptLine(line);1743+ return Option.isSome(decoded) ? [decoded.value] : [];1744+ });1745+ const lastStepIndex = steps.at(-1)?.step_index ?? -1;1746+ let hasOpenToolCall = false;1747+ let toolResultCount = 0;1748+ for (let index = steps.length - 1; index >= 0; index -= 1) {1749+ const step = steps[index]!;1750+ if (step.type === "CHECKPOINT") continue;1751+ if (!NON_TOOL_RESULT_STEP_TYPES.has(step.type)) {1752+ toolResultCount += 1;1753+ const normalized = step.status?.trim().toUpperCase();1754+ if (normalized === "RUNNING" || normalized === "PENDING" || normalized === "IN_PROGRESS") {@@ -1645,0 +1741,21 @@1741+ .flatMap((line) => {1742+ const decoded = decodeTranscriptLine(line);1743+ return Option.isSome(decoded) ? [decoded.value] : [];1744+ });1745+ const lastStepIndex = steps.at(-1)?.step_index ?? -1;1746+ let hasOpenToolCall = false;1747+ let toolResultCount = 0;1748+ for (let index = steps.length - 1; index >= 0; index -= 1) {1749+ const step = steps[index]!;1750+ if (step.type === "CHECKPOINT") continue;1751+ if (!NON_TOOL_RESULT_STEP_TYPES.has(step.type)) {1752+ toolResultCount += 1;1753+ const normalized = step.status?.trim().toUpperCase();1754+ if (normalized === "RUNNING" || normalized === "PENDING" || normalized === "IN_PROGRESS") {1755+ hasOpenToolCall = true;1756+ }1757+ continue;1758+ }1759+ if (step.type === "PLANNER_RESPONSE") {1760+ const calls = step.tool_calls ?? [];1761+ if (calls.filter((call) => call.name !== "swarm_wait").length > toolResultCount) {
juliusmarminge added labelstakeover:in-progress
- @@ -1645,0 +1735,21 @@1735+ }1736+ lineStart = newline + 1;1737+ }1738+ const steps = bytes1739+ .toString("utf8", lineStart)1740+ .split("\n")1741+ .flatMap((line) => {1742+ const decoded = decodeTranscriptLine(line);1743+ return Option.isSome(decoded) ? [decoded.value] : [];1744+ });1745+ const lastStepIndex = steps.at(-1)?.step_index ?? -1;1746+ let hasOpenToolCall = false;1747+ let toolResultCount = 0;1748+ for (let index = steps.length - 1; index >= 0; index -= 1) {1749+ const step = steps[index]!;1750+ if (step.type === "CHECKPOINT") continue;1751+ if (!NON_TOOL_RESULT_STEP_TYPES.has(step.type)) {1752+ toolResultCount += 1;1753+ const normalized = step.status?.trim().toUpperCase();1754+ if (normalized === "RUNNING" || normalized === "PENDING" || normalized === "IN_PROGRESS") {1755+ hasOpenToolCall = true;@@ -10191,3 +10207,11 @@1019110207 },1019210208 );101931020910210+ const readPromptBackgroundActivity = Effect.fn("AcpAdapterV2.readPromptBackgroundActivity")(10211+ function* (sessionId: string) {10212+ if (flavor.readPromptBackgroundActivity === undefined) return undefined;10213+ return yield* flavor.readPromptBackgroundActivity(sessionId).pipe(10214+ Effect.catchCause((cause) =>10215+ Effect.logWarning("failed to read ACP prompt background activity", {10216+ driver,10217+ cause,@@ -10229,5 +10269,4 @@1022910269 if (yield* Deferred.isDone(context.promptWireSettled)) return "done" as const;1023010270 const now = yield* Clock.currentTimeMillis;1023110271 if (context.lastProgressAt + timeoutMillis > now) return "rearm" as const;10232- if (yield* promptInactivityPaused(context)) {10233- context.lastProgressAt = now;10272+ const paused = yield* promptInactivityPaused(context);
Pusheda18b6b3
- @@ -1645,0 +1746,21 @@1746+ const isRunning = (step: TranscriptStep) => {1747+ const status = step.status?.trim().toUpperCase();1748+ return status === "RUNNING" || status === "PENDING" || status === "IN_PROGRESS";1749+ };1750+ const resultSteps: Array<TranscriptStep> = [];1751+ let planner: TranscriptStep | undefined;1752+ for (let index = steps.length - 1; index >= 0; index -= 1) {1753+ const step = steps[index]!;1754+ if (step.type === "CHECKPOINT") continue;1755+ if (!NON_TOOL_RESULT_STEP_TYPES.has(step.type)) {1756+ resultSteps.unshift(step);1757+ continue;1758+ }1759+ if (step.type === "PLANNER_RESPONSE") planner = step;1760+ break;1761+ }1762+ // Results pair 1-to-1 with the planner's calls in order, as in the transcript projection.1763+ // A worker blocked in `swarm_wait` waits on peers, so it does not hold the deadline.1764+ const hasOpenToolCall =1765+ planner === undefined1766+ ? resultSteps.some(isRunning)
juliusmarminge added labelstakeover:blocked
juliusmarminge removed labelstakeover:in-progress
juliusmarminge added labelstakeover:in-progress
juliusmarminge removed labelstakeover:blocked
Sign in to join this conversation.
macroscopeapp[bot](GitHub profile, opens in a new tab) reviewed