fix: Guard stream-json parser against non-dict JSON lines (#151) - #152
Merged
Conversation
json.loads() can return a string when Claude Code emits a JSON string literal in stream-json mode. Calling .get() on a str raised AttributeError, which killed the stdout loop and discarded all execution results. Added isinstance(raw_msg, dict) checks in all four parsing locations. Fixes #151 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This was referenced Jun 17, 2026
vybe
added a commit
that referenced
this pull request
Jun 17, 2026
* ci(deps): Dependabot auto-merge for low-risk PRs + grouping (#1243) Adds .github/workflows/dependabot-auto-merge.yml — zero-touch merge for Dependabot semver patch/minor only (all majors held). Gates on build + pytest in-workflow; a machine PAT (DEPENDABOT_AUTOMERGE_TOKEN, stored as a Dependabot secret) supplies the required approval since GITHUB_TOKEN can't, then --auto --squash (CodeQL still enforced by branch protection). dependabot.yml: group github-actions bumps into one weekly PR; cover the previously-uncovered /tests/git-sync npm dir (source of esbuild alert #152). Refs #1243 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * ci(deps): scope main PR to dependabot.yml only — drop auto-merge workflow (review #1244) Per dolho's review and the conscious decision on #1243: auto-merge is dev-only. main must NOT carry zero-touch merge machinery (a security PR to main could auto-publish trinity-cli to PyPI unattended). This PR now ships only the dependabot.yml grouping + /tests/git-sync coverage, which must live on main since Dependabot reads config from the default branch. The (dev-guarded) workflow reaches main later via the normal release, inert for main PRs. Refs #1243 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Eugene Vyborov <eugene@beingluminous.com> Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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
isinstance(raw_msg, dict)guards in all 4 stream-json parsing locations inclaude_code.pyAttributeError: 'str' object has no attribute 'get'when Claude Code emits JSON string literalsChanges
docker/base-image/agent_server/services/claude_code.py— 4 guard clauses (lines ~148, ~283, ~547, ~882)docs/memory/changelog.md— New entryTest Plan
context: forkwith a subagentFixes #151
Generated with Claude Code