#1654

fix(resume): tolerate damaged metadata when listing prior runs

Opensamirhvbrwants to merge intofrom

One damaged run can currently prevent the resume picker and strix -n --resume from listing healthy sibling runs. Invalid UTF-8 escapes the existing JSON fallback, and a valid JSON object with "targets_info": 123 raises TypeError while building its summary.

Fixes #1653 by treating undecodable artifacts like the malformed JSON already handled by the summary reader, and using the existing workspace/instruction fallback when target metadata is not an array. Named resume also translates undecodable run.json into the existing actionable usage error. The patch does not rewrite artifacts or make a damaged run resumable.

Validation on 09536cf1481731c790995bd8060db19a3b75ff48, Python 3.12.14 and frozen dependencies, with an isolated HOME and dotenv loading disabled:

  • Six new summary/CLI cases fail on the unchanged base; the additional named-resume case fails before its decode-error fix. The existing tests and three malformed-shape controls pass.
  • 178 focused tests pass after the fix: run summaries, resume CLI/picker/history, target lists, exit policy, inputs, API-spec targets and report writers.
  • Ruff formatting/lint, Mypy and Bandit pass. make check-all still stops at Pyright: 940 errors versus 941 on the unchanged base, with no new diagnostics.
  • No live LLM, Docker scan, external target or full-suite run was used for this patch.

Activity

3
greptile-apps[bot]3d ago

Confidence Score: 5/5

[Medium impact] This PR appears safe to merge.

Summary

This PR keeps damaged run metadata from blocking listings of healthy sibling runs.

  • Run summaries keep listing runs when saved metadata is damaged.
  • Named resume reports unreadable saved run records as a usage error.

Reviews (1) · Last reviewed commit: "fix(resume): tolerate damaged metadata w..." · Reviewed by Greptile

samirhvbr3d ago

CI follow-up on the unchanged PR head b6ac4037:

The original run is still blocked in the pytest matrix. This also affects its unchanged base 09536cf1: main's CI reached the six-hour timeout on Python 3.12–3.14. A bounded Linux diagnostic identified a synchronous GitHub Copilot authorization wait inside the best-effort cost callback.

I kept the independent base fixes separate:

  • #1657 fixes seven budget-test failures caused by missing skills=[].
  • #1658 prevents both cost estimators from invoking provider authentication.
  • #1660 removes the current bare-Grok test's dependence on the live price catalog.
  • Existing #1577 supplies the missing telemetry settings in runner fixtures; I did not duplicate it.

The final Linux diagnostic matrix, at c0651c343e3d7a58391214a2d6b133b14f363bbe, combines those four changes with this PR. Python 3.12, 3.13 and 3.14 each complete with 2,534 passed / 3 expected xfails, with the frozen lockfile, normal catalog loading, and no skipped tests or production-signature workarounds.

That combined result is separate from this PR's own check run. This PR's code/head is unchanged, and its current base still lacks the fixes. Once the independent base fixes are integrated, its CI can be rerun against that base. The existing long-running jobs can be cancelled by a maintainer; this account has no upstream Actions write permission.