Repository navigation
fix: wrap JSON.parse in ghJson/ghJsonLines with contextual error messages - #16
Merged
steipete merged 2 commits intoApr 27, 2026
Merged
Conversation
…ages Handle malformed GitHub API responses gracefully by catching JSON.parse errors and re-throwing with the failing command context.
steipete
force-pushed
the
fix/gh-json-parse-error-handling
branch
from
April 27, 2026 04:55
93e05a2 to
e354d8c
Compare
valkyriweb
referenced
this pull request
in valkyriweb/clawsweeper
May 14, 2026
Upstream clawsweeper hardcodes forced_login_method=\"api\" because
openclaw runs with OPENAI_API_KEY. Our valkyriweb fork uses Luke ChatGPT
Max subscription via ~/.codex/auth.json (subscription mode in
setup-codex). The hardcoded \"api\" forces codex into API-key mode and
collides with the ChatGPT JWT in auth.json:
API key login is required, but ChatGPT is currently being used.
Logging out.
ForcedLoginMethod enum is {chatgpt, api}. Flipping to chatgpt for our
trial. If we ever wire this fork to a real API key, revisit and make it
env-var driven.
Refs:
- /Users/luke/Projects/oss/codex/codex-rs/protocol/src/config_types.rs
- valkyriweb/clawsweeper run 10 (#16 review hit this)
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.
Summary
JSON.parseinghJsonwith try-catch, re-throwing with command contextJSON.parseinghJsonLinesper-line with try-catch, re-throwing with parse error contextMotivation
Fixes #15
If GitHub returns malformed JSON (e.g., HTML during an outage), the error now surfaces with context rather than crashing the run with an opaque parse error.