Skip to content

[Bug]: Sending /compact as first turn in a forked Antigravity thread defers context handoff and sends raw /compact to an empty session #44279

Done

Description

@ElMaxito

What happened

After forking a 21-run Antigravity thread, I sent /compact as the first message in the forked thread. Instead of compacting the forked conversation (or telling me compaction isn't applicable yet), the assistant replied that there was no earlier conversation history in the thread to compact. On the next message ("This is literally a forked conversation though."), the fork's Context handoff (full_thread_summary) finally arrived and the assistant had the forked context.

Diagnosis

Investigated local statev2.sqlite projections, logs/provider/events.<threadId>.log, and pingdotgg/t3code server source:

  1. Fork creates a portable_context handoff pending delivery on Run 1.

    • orchestration_v2_projection_context_transfers recorded the fork with resolution.strategy = "portable_context", attaching a full_thread_summary contextHandoffId to run:ordinal:1 (createdAt: 2026-11-27T15:08:32.193Z).
    • Antigravity ACP does not implement session.injectHistory, so handoffs must be delivered inline with a prompt.
  2. Sending /compact on Run 1 defers both the context handoff and T3 prompt instructions.

    • apps/server/src/orchestration-v2/ProviderTurnStartService.ts (L1281) marks /compact via isSlashCommandMessage(providerMessage) (ContextHandoffDelivery.ts L16–22).
    • ProviderTurnStartService.ts (L2410–2412) calls deliverContextHandoffs({ ..., deferInline: compact || slashCommand }).
    • In apps/server/src/orchestration-v2/ContextHandoffDelivery.ts (L48–49), deferInline && input.inject === undefined returns { context: "" } and leaves the handoff pending.
    • ProviderTurnStartService.ts (L2462) forwards raw userText ("/compact").
    • packages/provider-acp/src/server/adapter.ts (L10080, L10113–10116) and packages/provider-core/src/server/orchestrationInstructions.ts (L92) also skip <t3_code_instructions> and <runtime_info> whenever prompt.trimStart().startsWith("/").
  3. Fresh Antigravity ACP session receives bare /compact as an ordinary user prompt.

    • apps/server/src/orchestration-v2/Adapters/AntigravityAdapterV2.ts (L312) sets compactViaAdvertisedCommand: true, enabling compactThread (packages/provider-acp/src/server/adapter.ts L2833, L11324–11334), which calls startTurn with text "/compact".
    • On Run 1, the provider log shows initialize → authenticate → session/new → session/prompt (15:08:34.652Z). Because the new native session has 0 prior turns, no inline handoff, and Antigravity ACP does not intercept /compact in session/prompt on this fresh session, the model receives bare /compact in an empty conversation and tells the user there is no history to compact.
  4. Turn 2 delivers the deferred handoff.

    • On Run 2 (a normal text message at 15:09:18.272Z), deferInline is false, so the contextHandoff finally transitions (updatedAt: 2026-11-27T15:09:18.272Z) and <t3_code_instructions>, <runtime_info>, and Context handoff (full_thread_summary) are injected for the first time.

Expected behavior:

  • Sending /compact on a freshly forked thread whose context exists only as an undelivered portable_context handoff (with 0 native turns on the new provider session) should not spawn an empty session and pass raw /compact to the LLM without context.
  • Ideally T3 Code either rejects/no-ops /compact before any native turns exist (noting the fork already starts from a handoff summary), or for ACP providers with compactViaAdvertisedCommand: true, verifies that compact is actually an advertised/supported command on the active session before treating /compact as a native slash command and stripping handoffs/instructions.

Steps to reproduce

  1. Have a multi-turn thread running on the Antigravity (ACP) provider.
  2. Fork the thread from the latest completed run.
  3. In the newly forked thread, send /compact as the first message.
  4. Observe the assistant responding as if it is a brand-new empty conversation with no history.
  5. Send any regular follow-up message in turn 2 and observe the Context handoff (full_thread_summary) and T3 instructions now being delivered.

Version

0.1.12

Environment

macOS 27.2 (26B5112a, arm64), Node v26.7.0, T3 Code v0.1.12 (desktop/web), Antigravity ACP (gemini-4-neon)

Evidence

# Provider native log (logs/provider/events.<fork-thread-id>.log)
[2026-11-27T15:08:32.358Z] initialize (started) -> succeeded (15:08:32.660Z)
[2026-11-27T15:08:32.660Z] authenticate (started) -> succeeded (15:08:34.460Z)
[2026-11-27T15:08:34.461Z] session/new (started) -> succeeded (15:08:34.634Z)
[2026-11-27T15:08:34.652Z] session/prompt (started) -> succeeded (15:08:40.239Z)  # Run 1: "/compact" (no handoff, no instructions)
[2026-11-27T15:09:18.272Z] session/prompt (started) -> succeeded (15:09:44.032Z)  # Run 2: regular message (handoff + instructions delivered)

# statev2.sqlite (orchestration_v2_projection_runs & orchestration_v2_projection_context_handoffs)
Run 1: requestedAt=2026-11-27T15:08:32.193Z, startedAt=2026-11-27T15:08:34.644Z, completedAt=2026-11-27T15:08:40.258Z, contextHandoffId=<handoff-id>
Run 2: requestedAt=2026-11-27T15:09:18.225Z, startedAt=2026-11-27T15:09:18.243Z, completedAt=2026-11-27T15:09:44.051Z, contextHandoffId=null

Context transfer (fork): status=consumed, resolution.strategy=portable_context, createdAt=2026-11-27T15:08:22.636Z, consumedAt=2026-11-27T15:08:32.193Z
Context handoff (<handoff-id>): strategy=full_thread_summary, createdAt=2026-11-27T15:08:32.193Z, updatedAt=2026-11-27T15:09:18.272Z
# Note updatedAt on the handoff matches Run 2's session/prompt timestamp (15:09:18.272Z), confirming delivery was deferred across Run 1.

Related issues

Fix applied or workaround

Workaround: Send a normal message first (no /compact needed on a freshly forked thread since portable_context already boots the new native session from a condensed full_thread_summary handoff).

Filed by

Antigravity (gemini-4-neon) via manual local triage (T3 Code v0.1.12)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions