@devries-cameron20 / t3code Mirror · read-only / commits / a99faf5a62
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 21, 08:30 UTC

feat(antigravity): edit earlier messages with Edit from here (#38227)

Co-authored-by: Cursor <cursoragent@cursor.com>

Yash Singh committed Nov 17, 2026 at 10:48 UTC a99faf5a629023a5aca16fc8422553a5a4a9067f
5 files changed +45 -14
apps/server/src/orchestration-v2/NativeChildWorkQuery.test.ts
+26 -7
@@ -26,7 +26,8 @@ const childThreadId = ThreadId.make("thread-child");
26 const launch = describeAntigravitySubagentLaunches([LAUNCH]);
27
28 // A permission-prompt batch in session ROOT, plus an older batch with no launch text in `olderRun`.
29 -const records = (olderRun: string) => ({
29 +// `rootThreadSession` is where the root provider thread points now; a rollback moves it.
30 +const records = (olderRun: string, rootThreadSession: string) => ({
31 thread: {
32 id: childThreadId,
33 creationSource: "provider",
@@ -57,12 +58,24 @@ const records = (olderRun: string) => ({
58 },
59 ],
60 runs: [
60 - { id: "run-root", providerThreadId: "provider-root" },
61 - { id: "run-root-earlier", providerThreadId: "provider-root" },
62 - { id: "run-other", providerThreadId: "provider-other" },
61 + { id: "run-root", providerThreadId: "provider-root", activeAttemptId: "attempt-root" },
62 + {
63 + id: "run-root-earlier",
64 + providerThreadId: "provider-root",
65 + activeAttemptId: "attempt-root-earlier",
66 + },
67 + { id: "run-other", providerThreadId: "provider-other", activeAttemptId: null },
68 + ],
69 + attempts: [
70 + { id: "attempt-root", nativeThreadId: ROOT },
71 + { id: "attempt-root-earlier", nativeThreadId: ROOT },
72 ],
73 providerThreads: [
65 - { id: "provider-root", providerInstanceId: instanceId, nativeThreadRef: { nativeId: ROOT } },
74 + {
75 + id: "provider-root",
76 + providerInstanceId: instanceId,
77 + nativeThreadRef: { nativeId: rootThreadSession },
78 + },
79 {
80 id: "provider-other",
81 providerInstanceId: instanceId,
@@ -71,7 +84,7 @@ const records = (olderRun: string) => ({
84 ],
85 });
86
74 -const readChildren = (olderRun: string) =>
87 +const readChildren = (olderRun: string, rootThreadSession = ROOT) =>
88 Effect.gen(function* () {
89 const query = yield* NativeChildWorkQuery.NativeChildWorkQuery;
90 return (yield* query.getNativeChildWork({ threadId: childThreadId })).children;
@@ -80,7 +93,7 @@ const readChildren = (olderRun: string) =>
93 NativeChildWorkQuery.layer.pipe(
94 Layer.provide(
95 Layer.mock(ThreadManagement.ThreadManagementService)({
83 - getThreadRecords: () => Effect.succeed(records(olderRun) as never),
96 + getThreadRecords: () => Effect.succeed(records(olderRun, rootThreadSession) as never),
97 }),
98 ),
99 ),
@@ -114,6 +127,12 @@ it.layer(
127 expect(fromOtherSession.map((child) => child.conversationId)).toEqual([CHILD]);
128 // An earlier run in the same session may own the only record.
129 expect(yield* readChildren("run-root-earlier")).toEqual([]);
130 + // After a rollback, kept batches still read the session they ran in.
131 + const rolledBack = "1a7f8b0c-3c55-4c1e-9a43-5d0e2b6f9c11";
132 + expect(
133 + (yield* readChildren("run-other", rolledBack)).map((child) => child.conversationId),
134 + ).toEqual([CHILD]);
135 + expect(yield* readChildren("run-root-earlier", rolledBack)).toEqual([]);
136 }),
137 );
138 });
apps/server/src/orchestration-v2/NativeChildWorkQuery.ts
+13 -2
@@ -73,12 +73,23 @@ const make = Effect.gen(function* () {
73 ["runs", "providerThreads"],
74 { runIds: [subagent.runId, ...others.flatMap((other) => other.runId ?? [])] },
75 );
76 + const { attempts } = yield* threads.getThreadRecords(parentThreadId, ["attempts"], {
77 + attemptIds: runs.flatMap((run) => run.activeAttemptId ?? []),
78 + });
79 const providerThreadOf = (runId: string | null) => {
80 const providerThreadId = runs.find((run) => run.id === runId)?.providerThreadId;
81 return providerThreads.find((candidate) => candidate.id === providerThreadId);
82 };
83 + // Rollback moves the provider thread to a fresh session; a batch's records stay where it ran.
84 + const sessionOf = (runId: string | null) => {
85 + const attemptId = runs.find((run) => run.id === runId)?.activeAttemptId;
86 + return (
87 + attempts.find((attempt) => attempt.id === attemptId)?.nativeThreadId ??
88 + providerThreadOf(runId)?.nativeThreadRef?.nativeId
89 + );
90 + };
91 const providerThread = providerThreadOf(subagent.runId);
81 - const rootSessionId = providerThread?.nativeThreadRef?.nativeId;
92 + const rootSessionId = sessionOf(subagent.runId);
93 if (!rootSessionId || providerThread?.providerInstanceId !== subagent.providerInstanceId) {
94 return NO_CHILDREN;
95 }
@@ -94,7 +105,7 @@ const make = Effect.gen(function* () {
105 // Only batches from the same agent session can share its records.
106 siblings: others.flatMap((other) => {
107 const id = other.nativeTaskRef?.nativeId;
97 - return id && providerThreadOf(other.runId)?.nativeThreadRef?.nativeId === rootSessionId
108 + return id && sessionOf(other.runId) === rootSessionId
109 ? [{ nativeTaskId: id, title: other.title, prompt: other.prompt }]
110 : [];
111 }),
apps/server/src/provider/AntigravityProvider.test.ts
+1 -1
@@ -302,7 +302,7 @@ it.layer(layerTest)("Antigravity provider snapshots", (it) => {
302 models: [],
303 setup: { canAuthenticate: true, canInstall: true },
304 showInteractionModeToggle: false,
305 - supportsConversationRollback: false,
305 + supportsConversationRollback: true,
306 supportsTextGeneration: false,
307 });
308 expect(yield* Ref.get(harness.probeCalls)).toBe(0);
apps/server/src/provider/AntigravityProvider.ts
+1 -1
@@ -204,7 +204,7 @@ export const makeAntigravityProvider = Effect.fn("makeAntigravityProvider")(func
204 },
205 }),
206 setup: { canAuthenticate: true, canInstall: true },
207 - supportsConversationRollback: false,
207 + supportsConversationRollback: true,
208 supportsTextGeneration: false,
209 workspaceSnapshots: [],
210 } satisfies ServerProviderDraft;
docs/user/providers-antigravity.md
+4 -3
@@ -90,9 +90,10 @@ Use Antigravity's native `/plan` command for planning. Tool approvals follow [Pe
90 Questions with fixed choices still need one of the offered answers, even in
91 **Full access**.
92
93 -T3 Code keeps conversation history and file diffs, but Antigravity cannot rewind
94 -its conversation. Reverting a thread or editing and resubmitting an earlier turn
95 -is unavailable. Continue with a follow-up message or start a new thread.
93 +On web and desktop, [Edit from here](./composer.md#edit-an-earlier-prompt) works with
94 +Antigravity. Antigravity cannot rewind its own conversation, so the next turn
95 +starts a fresh Antigravity session and T3 Code sends it the kept conversation,
96 +without the turns you removed.
97
98 Manual context compaction is unavailable through Antigravity's ACP runtime, even
99 though its CLI has `/compact`. Send `/clear` when you need a fresh context.