Skip to content

fix(bare): recover after a run stops before provider start #343

Closed

Description

@lukemaj

What Bare threads can refuse later messages after a run is stopped or fails before its provider turn starts.
Why Missed-history recovery includes T3 error and interrupt-result records, but the bare prompt boundary rejects every missed item that is not a user message.
So what Bare recovery needs a separate fix and focused regression tests; #285 will retain and link this known limit rather than redesign recovery.

Outcome

A bare thread accepts the next message after a pre-start Stop or session-open failure, without injecting T3 status text, losing undelivered user text, or repeating an earlier delivered attempt. This supports the Objective, making Promachos and Spectrum work reliably in Chromeria while preserving bare prompt isolation.

Evidence and verification limit

Found while integrating #285 / PR #300 with #289 / PR #335. This report is source-traced at main 2ba387388074ac4ee09cc256f9800cdd9ce2b520; no native reproduction is claimed. The mechanism exists on main without #285. Searches of open bare issues and all issues for the exact error, bare recovery and bare interrupted found no separate matching open issue.

  • ProviderTurnStartService selects failed/interrupted earlier runs whose active attempt has no provider turn, then reads their turn-start history.
  • ProjectionStore.getTurnStartHistory includes error and run_interrupt_result; historicalMessage retains both.
  • Before-start Stop writes run_interrupt_result with Run interrupted before provider start. Session-open failure writes an error record.
  • The bare delivery boundary rejects those records with bare history transfer unsupported: missed history is not user text. The failed retry remains eligible as missed history for the following message.
  • Restore explicit urgent interruption after Claude steer queuing #285 adds triggers in the replacement window and its truthful Message not delivered failure, but the original pre-start Stop and open-failure paths already exist.

Reproduction to establish in the fix: send to an isolated bare thread, stop before provider start, then send another message; also cover session-open failure. Never use live userdata.

Acceptance criteria

  • A persisted-event integration test reaches pre-start Stop through the real command/effect path and proves the next turn delivers the missed user text and new text with no T3 status prose.
  • A missed two-attempt run resends only text belonging to its current undelivered attempt, preserving the earlier delivered attempt without duplicating it.
  • Named additions preserve their existing native-session carrier semantics.
  • Genuine unsupported non-user history remains a specific failure unless its semantics are explicitly designed.
  • Tests await persisted events or Deferred milestones, with no sleeps.

Non-goals and blockers

No change to #285 cancellation scope, requester notes, bare provider support, launch controls or receipt policy. No implementation is included in this report. The precise recovery semantics and a failing transition test remain to be designed; no external blocker is known.

Elon record

Requirements and who asked: User #289 requires prompt isolation and supported bare providers; #285 requires urgent interruption and truthful failure. AGENTS.md Work requires filing adjacent owner defects.
Deleted: A speculative recovery patch inside #285, silent dropping of all history, and a claim of native reproduction without one.
Bottleneck: The bare missed-history boundary treats internal status records as model history; its owner must decide which records to omit and which attempt's user text to retry.
Checked myself: Read main's missed-run selection, final bare delivery guard, ProjectionStore history query, historicalMessage conversion, and before-start interrupt producer; checked matching open/all issue searches.

Activity

  1. lukemaj commented on Oct 18, 2026

    @lukemaj
    ContributorAuthor

    What Confirmed #343 on current origin/main at f27d8ee146295ed2b76d8d15d415dd7cff574df5.
    Why The bare delivery guard rejects internal status records, and run-wide recovery also includes earlier attempts.
    So what Implementing the fix in fix/343-bare-pre-start-recovery; Luna review and CI follow the PR.

    Upstream first: fetched pingdotgg/t3code main and searched its main tree, PRs for bare, and Issues for bare pre-start and session start stop. No matching bare recovery fix found. The bare boundary and its tests are fork-owned additions to upstream's turn-start service; no upstream port applies.

    Exclusive workspace: /home/luke/.t3/worktrees/chromeria/fix-343-bare-pre-start-recovery, clean starting HEAD equal to origin/main, intended PR base main.

    Requirements and who asked: #343 and the implementation brief require recovery without T3 status prose, lost undelivered text, or replaying an earlier delivered attempt; this supports reliable Promachos and Spectrum work.
    Deleted: A new recovery subsystem, provider-specific changes, and broad acceptance of unsupported history.
    Bottleneck: The existing bare prompt boundary must distinguish internal status from user text and select the undelivered attempt.
    Checked myself: Read missed-run selection, persisted history query, final bare delivery, and real restart message/node ownership. Focused failing regressions will establish the transitions.

  2. lukemaj commented on Oct 18, 2026

    @lukemaj
    ContributorAuthor

    What Implemented #343 in PR #480.
    Why Bare recovery now omits internal status records, keeps current undelivered attempt text, and avoids replaying previously delivered history.
    So what Luna review and CI, then the backlog coordinator merges.

    Branch: fix/343-bare-pre-start-recovery
    Exact head: 2b726c39813e0d8f20dcf15ef58f0b869f038d8d
    Base at task start: f27d8ee146295ed2b76d8d15d415dd7cff574df5

    Proof on Node 24.13.1:

    • node node_modules/vite-plus/bin/vp test run apps/server/src/orchestration-v2/BareLaunch.recovery.integration.test.ts apps/server/src/orchestration-v2/ProviderTurnStartService.bare.test.ts: 19 passed. Before the fix, the four new regressions failed and 15 existing cases passed. Corrected test fixtures reach the intended boundary without timeouts.
    • Persisted command/effect tests cover pre-start Stop, session-open failure, and a failed replacement after an earlier delivered attempt. Exact prompt assertions prove no status prose, no lost undelivered text, and no duplicate earlier input. Following messages also avoid replaying recovered input.
    • Existing bare tests preserve named-addition carrier semantics and rejection of genuinely unsupported non-user history.
    • node_modules/.bin/tsc-rs --noEmit -p apps/server/tsconfig.json: passed, existing Effect suggestions only.
    • Targeted vp lint on the three TypeScript files: passed with three pre-existing unused-variable warnings in the service. Scoped vp fmt --check and git diff --check passed.
    • bash scripts/fork-check.sh on the committed head: passed, 47 registered features. New test registered under bare-launch; feature map tracks fix(bare): recover after a run stops before provider start #343.

    Upstream finding: no matching fix in fetched pingdotgg/t3code main eb7b35ac32fb184ec6c8e6e9f84c7ecbba968f4a, PR and Issue searches. Bare launch is fork-owned; #15103 is a different native-session creation/resume failure.

    Pushed and opened against main. No review requested or run, no merge, version bump, deployment, restart, activation, or live-provider verification. Review and CI remain for the backlog coordinator.

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