Skip to content
Source
Sign inSign up
pingdotgg/t3code

Pi sessions are released while an extension still has background work running #24187

Closedceifa(GitHub profile, opens in a new tab) opened this issue 3 comments

Environment

  • T3 Code 0.1.2 (Linux, desktop)
  • Provider: Pi 1.4.0

Problem

Our Pi extension adds background commands: the agent starts a command, the turn ends, and when the command exits the extension wakes the agent with the result.

On T3 this doesn't work for anything longer than about 30 minutes. After the turn ends, T3 treats the Pi session as idle and releases it. The Pi process shuts down, the background command dies with it, and the thread is never told. The next message starts a new Pi process that doesn't know the job existed.

Pi exposes no way for the extension to tell T3 it still has work running, so the session can't stay alive the way it does with the Claude provider. With Claude, a running background task keeps the session up, and its completion wakes the thread.

Steps to reproduce

  1. On a Pi thread, start a background command through an extension that runs well over 30 minutes.
  2. Let the turn end and send nothing.
  3. Wait more than 30 minutes.

Expected: the session stays alive until the command finishes, and its completion wakes the thread, the same as with the Claude provider.

Actual: the Pi process is replaced, the command stops partway through, and no result ever reaches the thread.

  1. hong-tm(GitHub profile, opens in a new tab)commented

    Data point from the fast-cadence end of this gap, on T3 Code 0.1.6 (Linux desktop), Pi driven over the standard RPC provider. Our Pi setup schedules background work (file/command watches and goal continuations) that wakes the agent on its own roughly every 1-2 minutes, similar to what an extension using sendMessage(..., { triggerTurn: true }) produces.

    Two observations beyond the 30-minute idle release case:

    1. Wake adoption itself works fine: each self-started turn is picked up as a continuation and becomes a normal run. But between wakes the thread has nothing pending, so it renders as done. With wakes every ~90 seconds, one of our threads flipped working<->done 12 times in 16 minutes (runs lasting 4-78s; the session logged 9 watch notifications + 3 goal continuations in that window, matching run requestedAt 12/12). So even when the idle release never triggers, the missing "session still has work" signal still surfaces as status churn in the thread list.

    2. Each adopted wake lands as a synthetic user message plus a run entry, so high-frequency background work fills the thread history with micro-runs. Collapsing consecutive adopted wakes into one visible background phase (or at least keeping them out of the message list) would quiet that side.

    The t3:background roster in #24207 looks like it covers the display side too: between wakes the thread would sit at "Waiting on background task" instead of done, which is exactly the state we are missing.

    AI-generated by @hong-tm's agent (OmO), posted under his instruction.

  2. Note

    🤖 GPT 6.1 Sol responding on behalf of StiensWout

    A credential-free Pi 1.5 native probe confirms that an extension-owned child can remain running while RPC reports idle, not streaming, and no pending messages; a successful RPC abort does not stop that child. T3’s pending-wake guard observes a wake that has already started, not background work between wakes. Its silent pending-work retention is already bounded.

    We found no supported general Pi job-lifetime/cancellation signal from which to derive this state. #24207 offers an opt-in status convention for cooperating extensions, rather than automatic coverage of arbitrary jobs. We are not filing a fix that claims general retention from that convention or pins sessions indefinitely. A supported cooperative job-lifetime/cancellation contract is the missing prerequisite, so this issue remains unresolved.

  3. tanstack-source added labelsbug

  4. Thanks for writing this up. It asks for new behaviour rather than reporting a defect, so it does not belong in the bug tracker and I'm closing it as not planned here. Feature ideas are discussed in Discussions: please post it there.

  5. juliusmarminge closed this

Sign in to join this conversation.