Skip to content

fix(llmadapters): accept a Claude session listing with no background jobs - #617

Merged
piekstra merged 1 commit into
mainfrom
fix/claude-bg-session-listing
Sep 22, 2026
Merged

piekstra merged 1 commit into
mainfrom
fix/claude-bg-session-listing

Conversation

@piekstra

Copy link
Copy Markdown
Contributor

Summary

claude agents --json lists every session, and only background sessions carry an id. A listing that holds only interactive sessions is non-empty but yields no job ids, so parseClaudeBGActiveJobs failed 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

  • Bug fix
  • New feature
  • Documentation update
  • Repo scaffolding / maintenance

Checklist

  • I have read the contributing guide
  • My change follows the project structure and conventions
  • make tidy passes
  • make lint passes
  • make test passes, except TestPiRPCReviewerExtensionLoadsInInstalledPi, which fails identically on unmodified main against the locally installed pi CLI (Unknown options: --no-builtin-tools, --no-approve)
  • make build passes

Related Issues

Closes #615

…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

@monit-reviewer monit-reviewer 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.

Automated PR Review

Reviewed commit: fdc52f3a9157
Profile: claude-monit-reviewer - Posting as: monit-reviewer

Summary

Reviewer Findings
go:implementation-tests 0

Reviewer Coverage

  • go:implementation-tests — complete (broad); skipped: none; constraints: none
Inspected files (4)
  • internal/llmadapters/subprocess.go
  • internal/llmadapters/subprocess_test.go
  • internal/llmadapters/testdata/claude_agents_interactive_only.json
  • internal/llmadapters/testdata/claude_agents_mixed.json

0 PR discussion threads considered. 0 summarized; 0 resolved.


Completed in 1m 22s | ~$1.18 (est.) | claude-sonnet-5 | cr 0.10.311
Field Value
Model claude-sonnet-5
Reviewers go:implementation-tests
Engine claude_cli · claude-sonnet-5
Reviewed by cr · monit-reviewer
Duration 1m 22s wall · 1m 06s compute
Cost ~$1.18 (est.)
Pricing basis anthropic-public-2026-09-02
Tokens 26 in / 4.7k out

Per-workstream usage

  • orchestrator-selection — claude-sonnet-5
    • In: 6
    • Out: 2.1k
    • Cache read: 120.7k
    • Cache create: 110.3k
    • Cost: ~$0.49 (est.)
    • Duration: 21s
  • go:implementation-tests — claude-sonnet-5
    • In: 14
    • Out: 2.3k
    • Cache read: 492.6k
    • Cache create: 112.5k
    • Cost: ~$0.57 (est.)
    • Duration: 35s
  • orchestrator-rollup — claude-sonnet-5
    • In: 6
    • Out: 365
    • Cache read: 236.3k
    • Cache create: 17.7k
    • Cost: ~$0.12 (est.)
    • Duration: 9s

@piekstra
piekstra marked this pull request as ready for review September 22, 2026 18:35
@piekstra
piekstra merged commit 798ae9f into main Sep 22, 2026
10 checks passed
@piekstra
piekstra deleted the fix/claude-bg-session-listing branch September 22, 2026 18:36
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.

Claude bg active-agent discovery fails on a session listing with only interactive sessions

2 participants