Skip to content

fix(report): raise RuntimeError on non-object run.json (fixes #1109) - #1116

Merged
0xallam merged 1 commit into
usestrix:mainfrom
vardhans07:fix/resume-typeerror-non-object-json
Aug 20, 2026
Merged

fix(report): raise RuntimeError on non-object run.json (fixes #1109)#1116
0xallam merged 1 commit into
usestrix:mainfrom
vardhans07:fix/resume-typeerror-non-object-json

Conversation

@vardhans07

Copy link
Copy Markdown
Contributor

Summary

Fixes #1109.

  • Added type validation in read_run_record() (strix/report/writer.py) to raise RuntimeError when run.json contains a valid but non-dict JSON root (such as a list or string).
  • Updated test_read_run_record_non_object_raises in tests/test_report_writer.py to expect RuntimeError instead of TypeError, preventing uncaught exceptions during --resume runs.
image

@greptile-apps

greptile-apps Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Too many files changed for review (416 files, 100 file limit).

Bypass the limit by tagging @greptile-apps to review.

@SebTardif SebTardif left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary

The change correctly maps a parseable non-object run.json ([], string, null, bool, number) onto RuntimeError, which _load_resume_state already catches and turns into parser.error. That closes the --resume TypeError hole in issue #1109, and the other caller (ReportState.hydrate_from_run_dir) does not catch TypeError so it does not regress. Dominant risk: this reverts the exact RuntimeError -> TypeError edit from #576 that was made to satisfy pre-commit TRY004, so ruff will fail again unless there is a noqa or the catch site is widened instead.

Issue counts by severity

  • bugs: 1
  • suggestions: 1
  • nits: 1

Comment thread strix/report/writer.py Outdated
Comment thread strix/report/writer.py Outdated
Comment thread strix/report/writer.py Outdated
@vardhans07
vardhans07 force-pushed the fix/resume-typeerror-non-object-json branch 5 times, most recently from 58c8e72 to 55227f2 Compare August 19, 2026 14:38
Comment thread strix/interface/cli_args.py
@vardhans07
vardhans07 force-pushed the fix/resume-typeerror-non-object-json branch 2 times, most recently from e61c358 to d8ba61a Compare August 19, 2026 17:34
@vardhans07
vardhans07 force-pushed the fix/resume-typeerror-non-object-json branch from d8ba61a to e3fd04c Compare August 19, 2026 17:36

@SebTardif SebTardif left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Previous requested changes are addressed on e3fd04c.

  • read_run_record still raises TypeError for a non-object root (TRY004 / #576).
  • The writer.py comment and extra blank line are gone.
  • _load_resume_state catches TypeError so --resume exits through argparse.
  • test_resume_non_object_run_json_exits covers a list-root run.json.

This clears the earlier Changes requested review.

@0xallam
0xallam merged commit e152c4c into usestrix:main Aug 20, 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.

--resume crashes with TypeError on non-object run.json

3 participants