xai-org/grok-build · error

history repaired in memory but the persistence flush failed

Error message

history repaired in memory but the persistence flush failed

What it means

Error "history repaired in memory but the persistence flush failed" thrown in xai-org/grok-build.

Source

Thrown at crates/codegen/xai-grok-shell/src/session/acp_session_impl/rewind.rs:619

            .chat_state_handle
            .repair_history(dry_run, Some(turn_flag))
            .await
            .ok_or_else(|| anyhow::anyhow!("chat-state actor unavailable"))?
            .map_err(anyhow::Error::new)?;

        if report.changed() && !dry_run {
            // Flush barrier: success must mean the rewrite is on disk.
            let (flush_tx, flush_rx) = tokio::sync::oneshot::channel();
            if self
                .notifications
                .persistence_tx
                .send(PersistenceMsg::FlushAndAck {
                    respond_to: flush_tx,
                })
                .is_err()
                || !matches!(flush_rx.await, Ok(Ok(())))
            {
                anyhow::bail!("history repaired in memory but the persistence flush failed");
            }
            tracing::warn!(
                session_id = %self.session_info.id.0,
                duplicates_removed = report.duplicates_removed,
                stripped_tool_result_ids = ?report.stripped_tool_result_ids,
                synthetic_results_inserted = report.synthetic_results_inserted,
                "session history repaired"
            );
        }

        Ok(report)
    }
}

View on GitHub (pinned to bc7f02eddd)

When it happens

Trigger: Thrown at crates/codegen/xai-grok-shell/src/session/acp_session_impl/rewind.rs:619 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of xai-org/grok-build@bc7f02eddd (2026-08-31). Data as JSON: /api/errors/c9064501326130a6. Report an issue: GitHub.