Repository navigation
feat(codex): recover correlated Goal context with Session handoff - #741
Conversation
yyjeqhc
left a comment
There was a problem hiding this comment.
Reviewed the implementation and the recovery/authority boundaries. The production path keeps the Workflow Session as the exact recovery identity, derives Goal context only from explicit caller-owned active Session correlations, preserves ambiguity, and keeps the read non-authoritative/non-mutating.
I found one CI-blocking test-fixture issue rather than a production behavior bug: hidden_handoff_state_is_non_recording_exact_recovery_read created a runtime without a Goal store while asserting the available-store/zero-Goal omission contract. Under this PR's intended semantics, a missing store correctly returns unavailable/store_unavailable. Review commit 374fb79e gives that test an empty real Goal store and adds direct coverage that the hidden session_handoff_state path used by Codex carries the exact Goal context without mutating Goal state or recording business-Session activity.
Review validation: Codex integration 50/50, tool-contracts 242/242, session_handoff* 31/31, focused hidden handoff 1/1, cargo check -p webcodex, rustfmt, and diff check all pass. No remaining code-review blocker found; new CI should verify the updated head.
Refs #631
Summary
Extend exact Workflow Session handoff recovery with optional read-only durable Goal context.
The Workflow Session remains the primary recovery identity. Goal context is projected only from an existing explicit caller-owned active Workflow Session ↔ Goal correlation; this PR does not add another selector or infer a Goal from Project, Window, title, recency, credentials, or local conversation state.
Recovery semantics
goal_context.selection_requiredplus bounded candidate identities; never auto-select one Goal and never expose one candidate's objective/plan as the default.unavailable; do not collapse uncertainty into "no Goal".goal_contextis a sibling of the existing 8 KiBhandoff_brief, so the canonical handoff brief budget andfinish_coding_task.goal_follow_upbehavior stay unchanged.Safety / authority
Goal recovery is read-only. It does not:
The hidden
session_handoff_statepath continues to reuse the canonical handoff recovery path without recording business-Session telemetry. The local Codex reader validates the bounded Goal contract before exposing it to manual or SessionStart/UserPromptSubmit recovery.Validation
webcodex-tool-contractslib suite: 242 passed;cargo check -p webcodex: pass;cargo fmt --all -- --check: pass;git diff --check: pass.No deployment, service restart, release, or runtime configuration change is included.