Skip to content

Stabilize mixed-history resume reconstruction#171

Merged
wwind123 merged 1 commit into
mainfrom
codex/issue-157-mixed-history-resume
May 26, 2026
Merged

Stabilize mixed-history resume reconstruction#171
wwind123 merged 1 commit into
mainfrom
codex/issue-157-mixed-history-resume

Conversation

@wwind123
Copy link
Copy Markdown
Owner

Fixes #157

Summary

  • stabilize mixed-history resume reconstruction around AGENT_LOOP_META so the active round ledger follows the latest metadata-backed subject/head state
  • fail closed with AgentLoopError when resumed reviewer dispositions do not match the reconstructed prior-item ledger
  • add mixed-history resume regressions and document the structured-response contract and legacy fallback surface

Testing

  • python3 -m pytest tests/test_agent_loop.py -k "resume_pr_round or resume_plan_round or hybrid_history or missing_reconstructed_prior_item"
  • python3 -m pytest

@wwind123
Copy link
Copy Markdown
Owner Author

Implemented the #157 plan.

PR: #171

Tests: python3 -m pytest tests/test_agent_loop.py -k "resume_pr_round or resume_plan_round or hybrid_history or missing_reconstructed_prior_item" passed; python3 -m pytest passed.

-- OpenAI Codex

@wwind123
Copy link
Copy Markdown
Owner Author

{
  "schema_version": 1,
  "kind": "pr_review",
  "state": "approved",
  "summary": "Solid stabilization of mixed-history resume reconstruction. `_select_current_round_records` correctly anchors to the most-recent record for a subject and uses prior-items signature matching to exclude stale replay ledgers. `_record_prior_item_disposition` replaces the bare dict append with a fail-closed `AgentLoopError`, directly fixing the `KeyError: item-1` crash from the issue thread. Four new regression tests cover all three failure modes called out in the issue comment (plan-first replay with wrong active item set, hybrid history preferring metadata over legacy markdown, and the KeyError-on-unknown-item crash). Documentation in README and local_agent_loop.md clearly states the three-level fallback order and the intentionally narrow remaining legacy surface. All 414 tests pass.",
  "blocking_items": [],
  "same_pr_followups": [],
  "future_followups": [],
  "prior_item_dispositions": []
}

-- Anthropic Claude

@wwind123
Copy link
Copy Markdown
Owner Author

Stabilizes mixed-history resume reconstruction by isolating current round records using a prior-item ledger signature and replaces KeyError crashes with descriptive AgentLoopErrors.

-- Google Gemini

@wwind123 wwind123 merged commit 3b2127f into main May 26, 2026
1 check passed
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.

#140 Phase 6: Stabilize mixed-history resume behavior and legacy fallback

1 participant