Repository navigation
fix(runtime): hydrate canonical WAL before resume compaction - #816
mergify[bot] merged 6 commits into
Conversation
XuPeng-SH
left a comment
There was a problem hiding this comment.
Deep review of eb55867: no actionable code findings.
Traced shared loop entry/preparation, Server WAL hydration and rewrite-proof ownership, semantic admission, resume compaction and execution. Hydration now sees the admitted history before prefix rewriting; the existing idempotency, subagent exclusion and integrity checks remain in the canonical Server implementation. Cancellation/pause and non-executing exits retain precedence, classified WAL failures propagate without charging an iteration, and configured mock rounds (including exhausted queues) retain their bypass. The regression also verifies recovered content and the fresh user suffix reach execution after compaction.
Validation: git diff --check passed. Cargo is unavailable locally, so Rust tests were not independently rerun. GitHub Static Checks and the runtime/HTTP-contract job passed; the new feature-gated mock_llm_history_hydration_never_enters_provider_wal_gate test also passed.
CI caveat: Test Suite run 35322024859 is still red. Logs show web_agent_dynamic_spawn_inherits_edge_workspace_binding timing out waiting for tool_request, plus the services-only canonical_transition_wal_is_linear_and_recoverable_across_many_rounds timeout and deferred_settlement_does_not_consume_another_users_bounded_batch_slot assertion failure. I have not established these as regressions caused by this diff (the mock path skips the new gate, and the services-only tests do not call the changed runtime code). This approval is a code-review conclusion, not a claim that CI is green; those failures still need disposition before merge.
Merge Queue Status
This pull request spent 18 seconds in the queue, including 1 second running CI. Required conditions to merge
|
Summary
Follow-up turns with a large restored history can compact the admitted canonical prefix before the Server hydrates its provider WAL. Hydration then rejects the rewritten prefix with
provider canonical WAL durable base is absent from restored history, preventing execution.Run WAL hydration during shared round preparation, after cancellation/pause and non-executing exits, but before semantic admission and resume compaction. Keep the existing idempotent hydration implementation and integrity checks, with a no-op default for hosts without durable history. Preserve the original WAL bypass for configured
e2e-hooksmock rounds, including exhausted mock queues.Regression coverage checks both the original history presented to hydration and the recovered content plus fresh user message delivered to execution after compaction. Additional tests exercise cancellation, pause, no-round exit, classified WAL failure, and mock recovery bypass.
CI follow-up (
6ceca8f6) changes only test fixtures: the child-dispatch wait now allows 10 seconds for parent rounds plus child admission (still within the 30-second CI case budget), and the bounded settlement test gives its own eligible debt an earlier retry timestamp so unrelated shared-database backlog cannot occupy its single-row batch. Both business assertions remain enforced.A subsequent run exposed an unrelated paused-clock race in
edge_ws_e2e. Follow-up37a5b62areplaces a single scheduler yield with an explicit mock publication-drop notification before advancing another 24 virtual seconds. Production heartbeat, timeout, connection-release, and WAL semantics are unchanged.Related issue
Closes #812
The ordering defect exists on main. The exact private incident history was not replayed; approval denial and XLSX processing are not established as necessary triggers.
Change type
User and compatibility impact
Restored conversations can pass WAL validation before authorized compaction changes their prefix. No configuration, schema, model, token-budget, or API changes. The hook adds no model calls. In WAL recovery cases, semantic admission and compaction now see the recovered history; ordinary histories remain unchanged by hydration. No accuracy benchmark or live-provider comparison was performed.
Architecture and complexity delta
AgenticLoopHost/ round preparation, with Server-owned WAL hydration. Preparation returns classified errors so WAL failure retains its original kind.execute_turn.Verification
cargo test -p astra-runtime --features e2e-hooks --lib hydrat: 17 passed, including restored-history compaction, classified failures, control exits, and mock bypass. Formatting and diff checks passed.37a5b62a: Test Suite succeeded, including runtime (5912/5912), core/bridge, online core (390/390 service DB tests), online integration, and both terminal PTY platforms. Static Checks also succeeded.f415b8dc; its Git tree is identical to the tested37a5b62atree. The Mergify queue permission notice was a fork-maintainer-edit permission issue, not a test failure; no permissions were changed.6ceca8f6: lint, runtime, and core/bridge passed; selective e2e-hooks ran 120 tests, all passed. Online core was cancelled when the branch was updated with main.37a5b62a; the final run above confirms that regression now passes.37a5b62a, the exact paused-clock regression passed 50 consecutive fresh-process runs. The fulledge_ws_e2ebinary passed 26 tests; its one explicitly live-DB test was not selected. Latest-head CI lint passed.make checkcompleted lint and formatting; its broad compile-check phase was interrupted after the branch changed to prioritize validation of the new exact regression. This is not claimed as a fullmake checkpass.session_infopreamble, and one unknown-skill assertion expects a different error phrase). Inference DB coverage had 42 passed / 1 failed: the 300-round WAL case exceeded its fixture's five-minute run-owner lease and was correctly fenced (291 admissions across 299 seconds). That same pressure case passed in final CI in 10.361 seconds. These broader results are reported separately from the selected CI checks; no production guard was weakened to pass them.cargo test -p astra-runtime restored_history_is_hydrated_before_first_round_compaction --lib: 1 passed.cargo test -p astra-runtime provider_transition_wal --lib: 7 passed.cargo test -p astra-runtime crash_hydration_preserves_the_openai_cache_visible_prompt --lib: 1 passed.make lint: passed.make format-check: passed.git diff --check: passed.run_agentic_loop_with_host, mock-provider HTTP/SSE child tool dispatch, and live MatrixOne settlement recovery. No live model/provider or interactive TUI comparison was run.Final checklist