Skip to content

[Bug]: Pi checkpoint rollback opens a fresh session without registering its thread, fails before RPC #26312

Closed

Description

@toRolex

Before submitting

  • I searched existing open and closed issues and did not find a duplicate of this failure path.
  • I included the observed failure, lifecycle evidence, and the limits of the isolated reproduction.

Area

apps/server — Pi adapter / checkpoint rollback session lifecycle

Steps to reproduce

Observed in an existing Pi-backed conversation with ready checkpoints and a persisted native Pi session reference:

  1. Open the existing conversation in T3 Code Nightly.
  2. Request a conversation rewind using T3's checkpoint rollback flow.
  3. The rollback opens a new adapter session and fails before invoking Pi's rollback RPCs. Repeated automatic attempts fail with the same error.

The observed logs establish the new-session-to-rollback sequence below. I have not established why the previous runtime was released, so idle expiry, restart, or a crash should not be treated as a confirmed prerequisite. These are the observed user-flow conditions, not a freshly verified, deterministic full-application reproduction recipe.

Expected behavior

When rollback opens a fresh adapter session for an existing provider thread, T3 should restore/register that thread before invoking an operation that requires it. The existing native session reference should not be lost merely because a new adapter runtime was opened.

Actual behavior

T3 shows:

CheckpointRollbackExecutionError:
The provider could not roll back this conversation. Try again; if it keeps failing, check the provider and server logs.
  caused by ProviderAdapterRollbackThreadError
    caused by ProviderAdapterProtocolError:
      pi provider protocol error: Pi session has no registered thread.

The failure is in T3's own registration guard, before Pi get_entries, fork, or get_state calls in the rollback body. It is not a Pi RPC error response.

Impact

Major degradation or frequent failure: the affected conversation cannot be rewound through this path; the observed automatic retries repeat the same registration failure.

Version or commit

T3 Code desktop Nightly 0.1.3-nightly.20261026.3726.

Environment

  • Darwin 24.6.0
  • Pi provider: @earendil-works/pi-coding-agent 1.4.0
  • Existing persisted native session file present; relevant checkpoints were ready.

Logs or stack traces

Redacted lifecycle summary from correlated spans in the actual installed application's logs:

PiAdapterV2.openSession: success (about 1.36 ms)
about 2.6 ms after openSession started:
PiAdapter.rollbackThread: failure (about 0.07 ms)
root cause: pi provider protocol error: Pi session has no registered thread.

The installed server bundle's lifecycle explains the failure:

  1. A new Pi adapter session initializes threadState = null.
  2. CheckpointRollbackService.execute opens the session and calls rollbackThread without first calling resumeThread / registering the existing provider thread.
  3. Supplying the initial native thread reference when opening the session does not itself register a Pi thread.
  4. rollbackThread immediately checks threadState; the null state produces the error above.
  5. Pi RPCs occur only after that guard. Workspace checkpoint restoration is also later in the service, after successful provider rollback.

Isolated reproduction and limitations

An isolated local fixture exercised the actual CheckpointRollbackService.execute, PiAdapter.rollbackThread, error classes, and outer error mapping extracted unchanged from the installed server bundle, using the bundle's Effect/Schema runtime. Projection storage and sessions.open were minimal fixtures; the latter returned a fresh session with the same threadState = null initial state. Identifier schemas used equivalent string fixtures.

Both the original-shaped synthetic provider-thread ID and an ordinary stable synthetic ID produced:

UI message: The provider could not roll back this conversation. Try again; if it keeps failing, check the provider and server logs.
Root cause: pi provider protocol error: Pi session has no registered thread.
resumeThreadCalls: 0
piRpcCalls: 0

Each fixture run completed in approximately 2–3 ms. This validates the pre-RPC failure path and error mapping, not a full T3/Pi E2E flow. No live conversation was rewound for this experiment, no complete server or Pi process was launched, and no successful Pi fork or fix was verified. The local extraction driver is not presented as a portable public reproduction command.

Related issues

This report concerns the earlier fresh-session registration guard, before any of those Pi rollback RPC paths can execute.

Workaround / possible investigation direction

No workaround or repair has been validated. Please consider regression coverage for opening a fresh runtime and immediately rolling back an existing Pi provider thread, and check whether the rollback service should explicitly resume/register it under the adapter contract. This is a suggested investigation direction, not a verified fix.

No original conversation content, local paths, identifiers, database, raw traces, screenshots, or server bundle are included.

Activity

  1. StiensWout commented on Nov 9, 2026

    @StiensWout
    Contributor

    Note

    🤖 GPT 6.1 Sol responding on behalf of StiensWout

    The maintainer closed our independent #33338 without merge and is retaining #26322, which fixes the same fresh-session rollback failure and includes end-to-end verification. Our PR retains the Pi adapter tests, Codex restart-rollback controls, and offline native transcript. Once a build containing the retained fix is available, could you retry rewind before sending a new turn and close this issue if it works after that fix lands?

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