Skip to content

fix(runtime): mint a new approval event after restore - #737

Merged
delete-cloud merged 3 commits into
mainfrom
feat/restore-approval-new-event
Sep 3, 2026
Merged

delete-cloud merged 3 commits into
mainfrom
feat/restore-approval-new-event

Conversation

@delete-cloud

Copy link
Copy Markdown
Owner

Summary

After Phase G restore bumps projection_epoch, re-persisting ApprovalRequested with the old deterministic event id hit StateVersionConflictError.

  • Boundary event ids include :e{projection_epoch}. Same request_id / effect_id can prepare again; the EventRecord is new.
  • coding_agent daemon runtime-activation [--enable|--disable] flips local SQLite new_sessions_enabled. Default stays off. SQLite needs a daemon restart.
  • k3 review: update test_successful_turn_event_ids_are_deterministic for the new id shape. Done.
  • Codex P2s (cache epoch, default '0' on bad epoch, pass epoch on uuid chat ids) not taken: fail-fast and one load per persist are enough.

Tests

uv run pytest tests/coding_agent/test_harness_p2_wrap.py tests/coding_agent/test_harness_p2_wire_turn.py tests/cli/test_entrypoint_contract.py -q

Boundary event ids include projection epoch so the same request_id can
re-prepare the same effect after restore. Add daemon runtime-activation
to flip new-session creation without editing sqlite by hand.
Review: harness.TurnStarted/TurnSettled ids now include :e{epoch}.
Codex P2 follow-up: require projection_epoch at every _boundary_event_id
call site, load it once per persist, and include the session id when the
fact epoch is invalid. Do not cache across persists; store-level restore
can bump the epoch without SessionManager.
@delete-cloud
delete-cloud merged commit 19dbb41 into main Sep 3, 2026
1 check passed
@delete-cloud
delete-cloud deleted the feat/restore-approval-new-event branch September 3, 2026 15:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant