Skip to content

Detect agents started through an npm bin link (Qwen Code, Gemini CLI) - #21

Merged
HMAKT99 merged 2 commits into
mainfrom
agent-detect-bin-script
Nov 24, 2026
Merged

HMAKT99 merged 2 commits into
mainfrom
agent-detect-bin-script

Conversation

@HMAKT99

@HMAKT99 HMAKT99 commented Nov 24, 2026

Copy link
Copy Markdown
Owner

Bug: a standard global npm install or npx run of Qwen Code starts it as node /opt/homebrew/bin/qwen (or …/node_modules/.bin/qwen). That path doesn't contain @qwen-code/qwen-code, and the process name is node, so identify() matched nothing and the session never appeared. Gemini CLI and Amp installed the same way had the same problem.

Fix (crates/process-manager/src/agents.rs): when the process is a Node, Bun, Deno or Python launcher, the basename of the script it runs (the first non-flag argument) is also matched against the agent's names. The existing argument markers still work.

Verified live: with Qwen Code 0.28.4 running from its bin link, the released 0.1.10 CLI listed only the Claude Code sessions. A CLI built from this branch lists qwen-code with its project folder.

Tests: a new test identifies_agents_started_through_a_bin_link covers Qwen Code via a global install and npx, Gemini CLI behind a --no-warnings flag, OpenClaw and pip-installed Aider. It also checks that node server.js qwen and node /srv/app/index.js are not treated as agents. All 28 process-manager tests pass.

🤖 Generated with Claude Code

HMAKT99 and others added 2 commits November 24, 2026 09:09
A global npm install or npx runs an agent as `node /…/bin/qwen`. That
path doesn't contain the package name, so the argument markers missed it
and Qwen Code (and Gemini CLI, Amp) weren't recognised. For a Node, Bun,
Deno or Python launcher, the script it runs now also matches the agent's
names. Verified live: a Qwen Code 0.28.4 session started from its bin
link was missed by 0.1.10 and is now detected with its project.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Published today; cargo-deny now fails every PR. cookie comes in through
Tauri. AGASTHY doesn't use private cookies or fork, but the patched
version clears the advisory.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@HMAKT99
HMAKT99 merged commit b1a3d2c into main Nov 24, 2026
10 checks passed
@HMAKT99
HMAKT99 deleted the agent-detect-bin-script branch November 24, 2026 04:11
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.

1 participant