Skip to content

fix(detect): recognize versioned Python agent wrappers - #2188

Merged
ogulcancelik merged 2 commits into
herdrdev:masterfrom
plarson:fix/versioned-python-agent-detection
Aug 6, 2026
Merged

fix(detect): recognize versioned Python agent wrappers#2188
ogulcancelik merged 2 commits into
herdrdev:masterfrom
plarson:fix/versioned-python-agent-detection

Conversation

@plarson

@plarson plarson commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

Summary

  • recognize versioned Python runtime names such as python3.12
  • inspect the wrapped script path so Nix-installed Hermes processes are identified
  • add a regression test matching the observed python3.12 .../bin/hermes process shape

Verification

  • regression test fails on unmodified master with None instead of Hermes
  • regression test passes with this patch
  • detection tests: 47 passed
  • just lint: passed
  • just ci was run locally; three unrelated live-handoff/API integration tests failed and one was reproduced unchanged on origin/master in a clean worktree

No documentation change is needed; this restores existing Hermes detection behavior for versioned Python launchers.

Copilot AI review requested due to automatic review settings August 2, 2026 04:33
@coderabbitai

coderabbitai Bot commented Aug 2, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 991a84c8-3d08-4853-b971-ce5d6628d2b3

📥 Commits

Reviewing files that changed from the base of the PR and between ecddece and 0ff54c5.

📒 Files selected for processing (1)
  • src/detect/mod.rs
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/detect/mod.rs

📝 Walkthrough

Walkthrough

Python runtime detection now recognizes executables such as python3.12. Wrapped-agent detection uses this classification to identify Hermes launched through versioned Python wrappers. A regression test covers the python3.12 case.

Changes

Python runtime detection

Layer / File(s) Summary
Recognize versioned Python runtimes
src/detect/mod.rs
is_python_runtime recognizes python and numeric dotted Python executable suffixes.
Apply detection to wrapped agents
src/detect/mod.rs
Wrapped-agent argument handling uses recognized versioned Python runtimes. A regression test covers Hermes launched through /nix/store/.../python3.12.

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main change: detecting versioned Python agent wrappers.
Description check ✅ Passed The description directly explains the detection changes, regression test, and verification results.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@kangal-bot kangal-bot added the ai-review Trigger automated AI reviews for pull requests admitted by the PR gate label Aug 2, 2026
@greptile-apps

greptile-apps Bot commented Aug 2, 2026

Copy link
Copy Markdown

Greptile Summary

This PR restores agent detection for versioned Python launchers by recognizing numeric Python runtime suffixes and inspecting the wrapped script path.

  • Adds shared recognition for names such as python3.12.
  • Applies versioned-runtime recognition during generic-process classification and argv unwrapping.
  • Adds a regression test for a Nix-installed Hermes process launched through python3.12.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
src/detect/mod.rs Extends Python runtime classification to numeric versioned names and verifies Hermes detection through a versioned Nix Python wrapper.

Reviews (3): Last reviewed commit: "Merge branch 'master' into fix/versioned..." | Re-trigger Greptile

Copilot AI 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.

Pull request overview

Improves agent-process detection so Hermes (and other wrapped agents) can be recognized when launched via versioned Python runtimes (e.g., python3.12), which is common with Nix-managed installs.

Changes:

  • Extend generic runtime detection to treat python<version> (e.g., python3.12) as a Python runtime.
  • Route versioned Python runtimes through the same “wrapped script name” parsing used for python/python3.
  • Add a regression test covering the observed python3.12 .../bin/hermes process shape.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/detect/mod.rs Outdated
@plarson
plarson force-pushed the fix/versioned-python-agent-detection branch from 763e3e5 to 05a52af Compare August 2, 2026 04:41
@coderabbitai

coderabbitai Bot commented Aug 6, 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.

@ogulcancelik
ogulcancelik merged commit fc824b9 into herdrdev:master Aug 6, 2026
7 checks passed
@kangal-bot kangal-bot removed the ai-review Trigger automated AI reviews for pull requests admitted by the PR gate label Aug 6, 2026
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.

4 participants