Repository navigation
fix(antigravity): keep turns open for running commands so Stop can end them #16582
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
c52a298
7deea58
ad45816
d5f72a8
65bb7ab
c9edfe2
c0c6e1f
7787310
97b2e32
59d114c
5a411e9
0ec8b18
8d33e17
4559210
6cad610
946ba01
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,6 +6,7 @@ import { | |
| type ProviderSetupError, | ||
| } from "@t3tools/contracts"; | ||
| import type { SelfInvocation } from "@t3tools/shared/nodeRuntime"; | ||
| import * as HostProcess from "@t3tools/shared/HostProcess"; | ||
| import * as SecureRandom from "effect/crypto/SecureRandom"; | ||
| import * as Effect from "effect/Effect"; | ||
| import * as FileSystem from "effect/FileSystem"; | ||
|
|
@@ -139,13 +140,17 @@ export function makeAntigravityAcpAdapterFlavor( | |
| const makeRuntime = Effect.fn("AntigravityAdapterV2.makeRuntime")( | ||
| function* (input: AcpAdapterV2RuntimeInput) { | ||
| const scope = yield* Scope.fork(yield* Effect.scope); | ||
| const platform = yield* HostProcess.Platform; | ||
| const runtime = yield* options | ||
| .withProcess( | ||
| Scope.close(scope, Exit.void), | ||
| options.makeRuntime({ | ||
| ...input, | ||
| clientFileReads: true, | ||
| sessionSystemPromptAppend: PULL_REQUEST_LINKING_INSTRUCTIONS, | ||
| ownDetachedProcessGroup: true, | ||
| ownDescendantProcessGroups: platform === "linux", | ||
| processGroupPlatform: platform, | ||
| additionalDirectories: [options.host.paths.attachmentsDir], | ||
| }), | ||
| ) | ||
|
|
@@ -233,6 +238,14 @@ export function makeAntigravityAcpAdapterFlavor( | |
| ), | ||
| // Loading history replays tool calls; resume avoids replay. | ||
| subagentsIdleOnTurnCompletion: true, | ||
| restartRuntimeOnEveryInterrupt: true, | ||
| terminateRuntimeProcessGroupOnInterrupt: true, | ||
| // A started command can outlive end_turn. Its item stays running after the turn | ||
| // completes so Stop can still reach it; the turn itself does not wait for it. | ||
| extractBackgroundTaskId: (toolCall) => | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| toolCall.kind === "execute" && toolCall.status !== undefined && toolCall.status !== "pending" | ||
| ? toolCall.toolCallId | ||
| : undefined, | ||
| ...(options.onSessionEvent === undefined ? {} : { onSessionEvent: options.onSessionEvent }), | ||
| applyModelSelection: Effect.fn("AntigravityAdapterV2.applyModelSelection")(function* ({ | ||
| runtime, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟠 High
Adapters/AntigravityAdapterV2.ts:245Commands returned by
extractBackgroundTaskIdstay displayed as running if they finish afterend_turn: this flavor does not defer background finalization, soadapter.tsclearsactiveTurnand its null-context update path ignores ordinary command terminal updates. Stop after settlement also cannot terminalize the row because no command context is retained. Retain and project command state through its terminal update, and terminalize it on teardown.🤖 Copy this AI Prompt to have your agent fix this: