Repository navigation
fix: match agent names only on the program's identity, not paths or arguments - #1299
Merged
Merged
Conversation
…rguments caller_from_process_name substring-matched agent names anywhere in an ancestor's command line, so a macOS username in `login -pf <user>`, a home folder, a project folder or a model id in an argument tagged runs as that agent (cody 60 users/wk, mostly not Cody; qwen_code partly from `--model qwen...` arguments). Substring arms now see only argv0 and, for interpreters/launchers, the program operand; home paths keep only tooling segments (hidden dirs, node_modules packages, basename). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
caller_from_process_namesubstring-matches agent names (cody,copilot,gemini,qwen,cursor,codex, ...) anywhere in each ancestor's full command line. That includes text that says nothing about which program is running:login -pf <username>andsshd: <user>@pts/0sit above every shell, so the username is matched./Users/cody/...,~/code/copilot-dashboard/server.js).--model qwen3-coder, flags, unrelated paths.Data (warehouse, Oct 8–14)
cody: 60 users/wk (43 macOS, 17 Linux). Only 3 have a cody-like email, and 28 of the 60 are also taggedqwen_code, a rare slug at 109 users/wk total. Their other callers include hermes/openclaw residues. That points to argument and path text, not Sourcegraph Cody.Change
Substring arms now match only the program's identity surface:
node,python*,bun,deno,npx,npm/pnpm/yarn exec|dlx,uv run,pipx run, shells), the first operand, i.e. the script or module that actually runs.~/.nvm/...,~/.hermes/...),node_modulespackage names (with scope), and the basename. The username segment is always dropped./opt,/usr/local,/Applications/X.app) are kept whole.Exact-basename arms are unchanged.
Effect
This reclassifies some users from a named agent to
agent_unknown(ortty:*) when the only evidence was path or argument text. A trade-off: agents run from a plain, non-hidden checkout under home (e.g.node ~/src/openclaw/gateway.js) lose the path match. Installed agents (global npm, nvm, brew,~/.local, app bundles,/opt) still match.Tests
New negative cases:
login -pf cody, sshd, home dirs on macOS/Linux/Windows,copilot-dashboardandcursor-cloneproject folders, agent names in arguments. New positive cases: nvm/npm-global/localnode_modulesinstalls,python -m aider,npx/npm exec/uv run. All 54 telemetry tests pass; clippy has the same 61 warnings as master.Do not merge without review: this reclassifies users.
🤖 Generated with Claude Code