Skip to content

fix: stop treating claude background shells as working - #3468

Merged
ogulcancelik merged 1 commit into
herdrdev:masterfrom
akbash-bot:akbash/3414-idle-with-background-shell
Sep 2, 2026
Merged

ogulcancelik merged 1 commit into
herdrdev:masterfrom
akbash-bot:akbash/3414-idle-with-background-shell

Conversation

@akbash-bot

Copy link
Copy Markdown
Collaborator

Issue

Claude Code can return to an empty prompt while a long-lived background shell remains. Herdr keeps the pane working instead of showing that Claude is idle.

Problem

The background shell indicator counted as working evidence on its own. It outranked the empty prompt even after the foreground turn ended.

How did we fix it?

Herdr now treats a background shell as context rather than proof that Claude is working. An empty prompt can report idle, while live-turn indicators still report working and permission prompts still report blocked.

Verification

The captured idle-prompt case failed as Working before the change and passes as Idle afterward. All 13 focused Claude detection tests, lint, Windows lint, and maintenance checks pass. Full just check reached 3,514 passing tests but remains blocked by an unrelated root-permission test and a live-handoff timeout on this VPS.

refs #3414

@coderabbitai

ghost commented Aug 31, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Team

Run ID: 8bda53ec-e3ca-4cf3-ab7b-ca4320198fd1

📥 Commits

Reviewing files that changed from the base of the PR and between da49cb8 and 7120903.

📒 Files selected for processing (3)
  • distribution/agent-detection/claude.toml
  • src/detect/manifest/tests.rs
  • src/detect/manifests/claude.toml
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/detect/manifest/tests.rs
  • src/detect/manifests/claude.toml

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

Claude detection metadata is updated to version 2026.08.31.1. The background_shell_working rule is removed from both Claude manifests. Four tests cover idle prompts, idle fallback, live turns, and bash permission prompts when a background shell indicator is present.

Suggested reviewers: ogulcancelik

Merge Risk: ⚪ Minimal · up to 71209

Background shells no longer mark an otherwise idle Claude pane as working, while live turns and permission prompts retain their existing states. No actionable merge-blocking risk remains beyond normal checks.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: Claude background shells no longer cause an incorrect working status.
Description check ✅ Passed The description directly explains the Claude detection issue, the fix, and the verification results. It is related to the changeset.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 1 files. (2 skipped: 2 …
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 1 files. (2 skipped: 2 unsupported.)


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@kangal-bot

ghost commented Aug 31, 2026

Copy link
Copy Markdown
Collaborator

@coderabbitai review
@greptileai

@coderabbitai

ghost commented Aug 31, 2026 •

Copy link
Copy Markdown

@kangal-bot I will review the changes in #3468.

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@greptile-apps

ghost commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR updates Claude state detection so a background shell is treated as context rather than independent evidence of foreground work.

  • Removes the background_shell_working rule from both bundled manifest copies.
  • Preserves live-turn and permission-prompt precedence.
  • Adds focused coverage for idle prompts, idle fallback, active turns, and blockers with background shells.

Confidence Score: 5/5

The PR appears safe to merge because no blocking failure remains.

No blocking failure remains.

Important Files Changed

Filename Overview
distribution/agent-detection/claude.toml Updates the distributed Claude manifest version and removes background-shell-only working evidence.
src/detect/manifests/claude.toml Keeps the bundled Claude manifest aligned with the distributed definition.
src/detect/manifest/tests.rs Adds regression coverage for idle, active, and blocked Claude states when a background shell remains.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    S[Claude terminal signals] --> L{Live turn indicator?}
    L -->|Yes| W[Working]
    L -->|No| B{Permission blocker?}
    B -->|Yes| K[Blocked]
    B -->|No| P{Visible empty prompt?}
    P -->|Yes| I[Idle]
    P -->|No| F[Known-agent idle fallback]
    H[Background shell indicator] -. Context only .-> L
Loading

Reviews (2): Last reviewed commit: "fix: stop treating claude background she..." | Re-trigger Greptile

@ogulcancelik
ogulcancelik force-pushed the akbash/3414-idle-with-background-shell branch from 3ef782e to 7120903 Compare September 2, 2026 14:29
@ogulcancelik

ghost commented Sep 2, 2026

Copy link
Copy Markdown
Collaborator

@coderabbitai review
@greptileai

@coderabbitai

ghost commented Sep 2, 2026 •

Copy link
Copy Markdown

@ogulcancelik I will review the changes in #3468.

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai

ghost commented Sep 2, 2026

Copy link
Copy Markdown

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

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.

3 participants