Skip to content

microskills: don't report a tool as missing when python -m or uvx runs it - #139

Open
SakshamUboweja wants to merge 1 commit into
microsoft:mainfrom
SakshamUboweja:microskills-absent-tool-runners
Open

SakshamUboweja wants to merge 1 commit into
microsoft:mainfrom
SakshamUboweja:microskills-absent-tool-runners

Conversation

@SakshamUboweja

Copy link
Copy Markdown
Collaborator

What

microskills could wrongly tell the agent that a tool like mypy is missing, even when the session had run it fine another way.

Why

If mypy failed with "command not found" but python -m mypy (or uvx, pipx run) worked later in the same session, microskills didn't notice the successful run. So it still learned and injected "mypy fails here with command not found".

How

  • observe.py: python -m <tool>, uvx <tool>, uv tool run <tool> and pipx run <tool> are now recognized as running that tool.
  • envfacts.py: these launchers aren't mistaken for the tool itself, so python -m ruff working doesn't count as a fix for a failing python -m mypy.

Now the agent is told "mypy fails here; python -m mypy works", and a working run removes an earlier "missing tool" fact. The experiment presets behave exactly as before.

Tests

New cases in tests/test_generic_microskills.py cover each way of running a tool, the suggested working command, and an old fact being removed. 13 of them fail on main without this change.

A bare `mypy` that fails with command not found was learned and injected as
an absent tool even when `python -m mypy`, `uvx ruff` or `pipx run black`
worked in the same session: `python -m X` was read as the interpreter, and
uvx/pipx were not read at all, so the working run never named the tool.

In the generic (plugin) reading, `<python> -m <checker>` is now a run_build
form, and `uvx`, `uv tool run` and `pipx run` are launcher prefixes like
`npx`. The bare form then becomes a FormRepair naming the working spelling,
and a later working run retires an existing absent-tool fact. Launcher and
interpreter words no longer count as a shared tool when one build form is
checked against another. PYTHON_GIT and NODE_WEB read as before.
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