Skip to content

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

Open
plarson wants to merge 1 commit into
herdrdev:masterfrom
plarson:fix/versioned-python-agent-detection
Open

fix(detect): recognize versioned Python agent wrappers#2188
plarson wants to merge 1 commit into
herdrdev:masterfrom
plarson:fix/versioned-python-agent-detection

Conversation

@plarson

@plarson plarson commented Aug 2, 2026

Copy link
Copy Markdown

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: 580d781d-1586-4646-bb45-bebb04aa4cf2

📥 Commits

Reviewing files that changed from the base of the PR and between 763e3e5 and 05a52af.

📒 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 and concisely describes recognition of 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

The PR extends wrapped-agent detection to versioned Python executable names and adds a regression test for a Nix-installed Hermes process.

  • Adds a shared predicate for numeric, dot-separated Python runtime versions such as python3.12.
  • Uses that predicate for wrapped-script extraction and generic-runtime classification.
  • Verifies detection of Hermes from the wrapped script path.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
src/detect/mod.rs Broadens Python wrapper recognition to numeric versioned executable names and adds focused regression coverage; no eligible follow-up defect was identified.

Reviews (2): Last reviewed commit: "fix(detect): recognize versioned Python ..." | 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-review Trigger automated AI reviews for pull requests admitted by the PR gate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants