Conversation
…jobs claude agents --json lists interactive sessions too, and only background sessions carry an id, so an interactive-only listing failed discovery as an unrecognized shape. Recognize the session-listing shape and return no active jobs for it. Closes #615
Contributor
Author
|
Superseded by a replacement PR with a corrected commit author. |
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
claude agents --jsonlists every session, and only background sessions carry anid. A listing that holds only interactive sessions is non-empty but yields no job ids, soparseClaudeBGActiveJobsfailed closed with "unrecognized non-empty JSON shape" and the reviewer's background job was lost.The parser now recognizes the session-listing shape (a non-empty array whose every element is an object with a
sessionId) and returns zero active jobs for it. Any other non-empty shape without ids still fails closed.Fixture files under
internal/llmadapters/testdata/carry an interactive-only listing and a mixed listing; the tests assert the first yields no jobs and the second yields only the background id.Type of Change
Checklist
make tidypassesmake lintpassesmake testpasses, exceptTestPiRPCReviewerExtensionLoadsInInstalledPi, which fails identically on unmodified main against the locally installed pi CLI (Unknown options: --no-builtin-tools, --no-approve)make buildpassesRelated Issues
Closes #615