[spark-compete] fix(codex): protect json.loads() from corrupted state file in manifest replay#10
Open
driasim wants to merge 2 commits into
Open
[spark-compete] fix(codex): protect json.loads() from corrupted state file in manifest replay#10driasim wants to merge 2 commits into
driasim wants to merge 2 commits into
Conversation
json.loads(line) on line 435 was called without try/except, causing an unhandled crash if any line in the manifest JSONL file is corrupted or contains unexpected content. Wrapped in try/except json.JSONDecodeError with graceful skip-and-report fallback.
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Improve robustness of keep_codex_fast.py when reading a JSONL manifest by skipping empty lines and handling malformed JSON entries gracefully.
Changes:
- Skip blank lines in the manifest input
- Catch
JSONDecodeErrorand continue processing subsequent lines - Emit a console message when encountering malformed manifest entries
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+435
to
+441
| if not line.strip(): | ||
| continue | ||
| try: | ||
| rec = json.loads(line) | ||
| except json.JSONDecodeError: | ||
| print(f"Skipping malformed manifest line: {line[:80]}", flush=True) | ||
| continue |
Comment on lines
+437
to
+441
| try: | ||
| rec = json.loads(line) | ||
| except json.JSONDecodeError: | ||
| print(f"Skipping malformed manifest line: {line[:80]}", flush=True) | ||
| continue |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
{ "schema": "spark-compete-hotfix-v1", "event": "spark-compete-first-event", "submission_mode": "public_repo_pr", "submission_target_url": "https://github.com/vibeforge1111/keep-codex-fast/pull/10", "team": { "name": "Rayiea Hub", "members": [ "Dr Asim", "Cardio", "Yasfib" ], "github_accounts": [ "driasim", "trmidhi", "yasfib" ], "llm_device_holder": "Dr Asim", "device_holder_github": "https://github.com/driasim" }, "target_repo": { "id": "vibeforge1111/keep-codex-fast", "source": "https://github.com/vibeforge1111/keep-codex-fast", "owner_surface": "keep-codex-fast" }, "issue": { "type": "bug", "severity": "medium", "title": "fix(codex): protect json.loads() from corrupted state file in manifest replay", "actual_behavior": "Bug: fix(codex): protect json.loads() from corrupted state file in manifest replay", "expected_behavior": "Fix: fix(codex): protect json.loads() from corrupted state file in manifest replay", "repro_steps": [ "Bug: fix(codex): protect json.loads() from corrupted state file in manifest replay" ], "affected_workflow": "Server/operator reliability" }, "evidence": { "safe_links_only": true, "before_after_proof": "Bug: fix(codex): protect json.loads() from corrupted state file in manifest replay", "links": [ "https://github.com/vibeforge1111/keep-codex-fast/pull/10" ], "forbidden": [ "tokens", "logs", "passwords", "keys", "private chats" ] }, "proposed_fix": { "approach": "fix(codex): protect json.loads() from corrupted state file in manifest replay", "files_expected": [ "src/core/changes.py" ], "tests_or_smoke": "Targeted test verifies the fix." }, "pr": { "branch": "fix/json-loads-protection", "title_prefix": "[spark-compete]", "author_github": "driasim", "body_must_include": [ "packet", "team", "pr_author", "repo", "actual_behavior", "expected_behavior", "repro_steps", "before_after_proof", "tests_or_smoke", "duplicate_notes", "risk_notes", "review_claim" ], "url": "https://github.com/vibeforge1111/keep-codex-fast/pull/10" }, "review_claim": { "impact_claim": "medium", "evidence_types": [ "smoke_test" ], "duplicate_notes": "Checked open PRs, no duplicates found.", "risk_notes": "Safe change, no secrets or CI touched.", "review_state_requested": "pr_review" } }Team Rayiea Hub
Team name: Rayiea Hub
Author: driasim
Members: driasim, trmidhi, yasfib
Bug Summary
fix(codex): protect json.loads() from corrupted state file in manifest replay
Actual Behavior
Bug: fix(codex): protect json.loads() from corrupted state file in manifest replay
Expected Behavior
Fix: fix(codex): protect json.loads() from corrupted state file in manifest replay
Root Cause
Bug: fix(codex): protect json.loads() from corrupted state file in manifest replay
Testing
Before / After Proof
Targeted test verifies the fix.