Repository navigation
Description
Agent | Codex | GPT-5 (tier unavailable)
Existing issue check
- Checked existing issues for the exact durable-base error and canonical WAL recovery; no matching report was found.
Background and user impact
A user was using the Astra TUI to inspect a local Excel file and then asked Astra to upload that same file to MOI through the installed moi-cli Skill. Earlier model conversations and a moi-cli workspace list invocation had succeeded.
During the spreadsheet-reading turn, the assistant reported that pandas/openpyxl were unavailable. It used a read-only approach to inspect the XLSX archive/XML instead. The user also rejected one inline Python tool execution. The assistant produced a normal-looking explanatory response, saying that it had not retried the rejected path and would request approval before preparing an environment for further analysis.
The next ordinary user message, in the same session, was: “Can you upload this file to the MOI platform?” Instead of reasoning about the request or invoking an upload tool, Astra failed with a server-side history consistency error.
This blocks continuation of a conversation after an ordinary tool-error/approval interaction. The user receives an internal WAL diagnostic with no actionable recovery guidance. There is no evidence of data loss or a partially completed upload.
Environment
- Local macOS/Apple Silicon client and local Astra server, backed by MatrixOne.
- Native-login development setup with the
moi-cliSkill and modeldeepseek-v4-flash. - The running server's
/healthreportsbuild_git_sha: faee95b8dcc3688d27805241d0c60e5dbd092f3f,database: connected, andinteraction_api_major: 3. - This was a real interactive incident. An isolated, deterministic minimal reproduction has not yet been established.
- No claim that this is fixed by an existing PR or that the login integration caused it.
Actual behavior
The TUI displays:
> Can you upload this file to the MOI platform?
2.1s total · 0 tokens
Error · [contract_violation] [contract_violation]
provider canonical WAL durable base is absent from restored history
The repeated [contract_violation] prefix is the visible error formatting. The underlying failure is a server-side durable-history check, not an error response from the MOI upload API.
Observed sequence
- Use the same Astra session for several successful interactions, including a MOI workspace listing.
- Ask Astra to inspect a local XLSX file in an environment without the relevant Python spreadsheet dependencies.
- Encounter tool failures and reject one inline Python execution; let the assistant produce its explanatory response.
- In the same session, ask it to upload the file to MOI.
- The new turn fails with the error above before executing any tool.
These are the incident steps, not a claim that every XLSX file or every rejected tool call deterministically triggers the bug. File contents, user identifiers, local paths, and credentials have intentionally been omitted.
Server evidence
Sanitized facts from the local server log and session audit, on 2026-09-18 (UTC):
| Time | Observation |
|---|---|
| 04:25:22 | Previous turn recorded interruption_recorded with kind=execution_incomplete, has_checkpoint=true, resumable=true, and resume_action=continue_immediately. |
| 04:25:22 | Previous turn evaluation recorded run_status=paused, five completed tool calls, and unresolved classified tool failures. The interruption detail included persistent unresolved tool outcome after bounded reconciliation; coverage=failure_reference_missing. |
| 04:25:36 | The next /chat/stream request opened an HTTP 200 stream, then terminated with an SSE run_error: domain_error_code=contract_violation, retryable=false, and the durable-base error above. HTTP 200 here does not mean the run succeeded. |
| 04:25:36 | The failed turn evaluation recorded run_status=failed, tool_call_count=0, and tool_execution_count=0. |
The primary provider execution path encounters the recovery check before model resolution/provider request admission. An auxiliary turn-intent preflight was also logged, so the TUI's zero-token display should not be treated as proof that no auxiliary request of any kind was attempted.
The requested file upload never reached tool execution in this turn. Installing pandas, re-authenticating, or granting more model credit does not address this specific failure boundary.
Expected behavior
- A recoverable prior turn, including tool failures or denied approval, must leave a coherent durable history for the next turn.
- A user must be able to send a normal follow-up request without the session failing its own history invariant.
- Recovery must preserve completed tool evidence and the new user message without blindly replaying already executed side effects.
- If continuation genuinely cannot proceed, return an actionable user-facing recovery state while retaining detailed diagnostics in controlled logs.
- Keep the history-integrity check fail-closed; do not mask the mismatch by dropping history, bypassing validation, or silently starting a replacement session.
Located failure boundary
crates/runtime/src/server/server_loop_host.rs:
hydrate_provider_canonical_transitionsloads the provider canonical transition receipts and uses the admittedprovider_canonical_wal_base.hydrate_provider_canonical_transition_receiptschecks that the restored message list contains the admitted durable prefix:
if messages.len() < durable_count
|| canonical_conversation_root(&messages[..durable_count])
!= durable_base.canonical.root_hash
{
// ContractViolation:
// provider canonical WAL durable base is absent from restored history
}This proves that either the restored history is shorter than the admitted prefix or its prefix hash differs. The current diagnostic does not identify which condition failed or which transformation introduced the divergence.
Related ownership/call sites to investigate:
crates/runtime/src/server/run/lifecycle/mod.rs: initialize the WAL base fromadmission.prior_messagesand assemble/restore loop history.crates/runtime/src/turn/agentic_loop/host.rs:initialize_provider_canonical_wal_baseand canonical rewrite proof ownership.crates/runtime/src/turn/agentic_loop/lifecycle.rs: pre-turn history preparation and context compaction.crates/runtime/src/server/server_loop_host.rs: the one-time hydration gate inexecute_turn.
What is confirmed vs. still unknown
Confirmed: the incident crossed from an incomplete/paused prior turn into a new turn that failed the server's durable-history prefix check; no upload tool ran in the failed turn.
Not yet established: whether the divergence was introduced during prior-turn persistence, history restoration, message rewriting/compaction, or ordering between those steps. The preceding approval denial is context, not a proven root cause. The exact introducing commit and whether this depends on the native-login branch are also unverified.
The existing recovery-related PRs #792, #803, #808, and #810 were inspected. None was verified to fix this incident; similarity of PR titles or recovery terminology is not sufficient evidence of coverage.
Suggested investigation and regression coverage
- Capture safe structural diagnostics at admission and hydration: message counts, prefix roots, and the phase where they diverge, without logging raw conversation content or credentials.
- Build a deterministic fixture for the incomplete-turn → next-user-turn sequence, including failed and denied tools.
- Verify durable history, its WAL base, and any authorized rewrite stay consistent through restoration and pre-provider preparation.
- Verify the next turn reaches normal execution exactly once, without replaying completed tool side effects.
- Preserve rejection of genuinely corrupted or mismatched history.
- Provide actionable failure guidance instead of exposing only the raw internal invariant message.
Priority suggestion: high, because an ordinary follow-up request is blocked for the affected session. Breadth and reproducibility across other sessions remain unknown.
This issue records the incident and investigation only. No fix, history deletion, or replay of the upload has been performed.
Activity
fix(runtime): hydrate canonical WAL before resume compaction (#816)