pi-temporal is an experiment that runs the Pi coding agent on a fleet of Temporal Workers so an agent session can survive a host failure without changing Pi’s session format. Each Pi session is treated as a Workflow and each unit of work in a turn is an Activity: runModelCall, runToolCall, and sealStep. The transcript in the shared session file is the single source of truth; Activities reconstruct state from that file, Workers snapshot project directories into Git bundles beside the session, and a new Worker can apply missed bundles and continue. A chaos demo repeatedly kills the active Worker; turns continue on other Workers and interrupted tool calls are recorded as “outcome unknown” rather than being retried blindly. Before invoking a tool the system writes a claim (.jsonl.pending/), so retries that find a result return it, while retries that find only a claim report uncertainty to the model, which inspects the current state and decides whether to redo the work.
Recovery depends on a few strict rules: the transcript is the only conversation state, sealStep is the sole writer of a step’s tool results to preserve order, claims precede tool execution, and a lease/write guard prevents a Worker that lost ownership from appending late results. Attempts may time out without proving a Worker stopped, so the system closes abandoned steps and relies on the claim/guard mechanism to avoid duplicate effects. The experiment shows Pi Durable’s programming model fits durable-execution goals, while Temporal supplies cross-machine failover; the team retrofitted Pi with a small fork and provides an experimental Temporal Agent Harness as a starting point.
Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.