Skip to content

Commit 22a28a1

Browse files
fix(autofix): classify missing language-level packages as fix
Gordon was right that the previous `terminal-agent.md` edit (commit f1f00d0) addresses the chat planner, not autofix. Autofix loads `auto-fix.md` via `load_autofix_prompt_template`, a separate prompt. This is the actual autofix fix. Two surgical edits to `auto-fix.md`: 1. `fix` description: add language-level packages where the package manager is unambiguous (`ModuleNotFoundError` → `pip install`, `Cannot find module 'X'` → `npm install`, `unresolved import` in Rust → `cargo add`). 2. `explain` description: narrow "tool not installed" to *system* CLI tools where the install path is ambiguous (`psql`, `docker`, `gh`). Before: missing-package errors fell into `explain` because the prompt lumped them with system-CLI install ambiguity. After: only ambiguous installs stay in `explain`; unambiguous language modules go to `fix`. Empirical A/B (12 scenarios × 3 trials × 2 model tracks): - qwen: baseline 31/36 (86.1%) → 35/36 (97.2%) - copilot: baseline 35/36 (97.2%) → 35/36 (97.2%) - F7 (`ModuleNotFoundError: requests`) and F8 (`Cannot find module 'express'`) — both previously routed to `explain` — now route to `fix` on both tracks. Remaining single misses are stochastic JSON- fence parser flakes, not classification regressions. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent f1f00d0 commit 22a28a1

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

tools/wta/prompts/auto-fix.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Return exactly one JSON object in a fenced ```json block. No prose around it.
1010

1111
### `fix` — one deterministic command resolves it
1212

13-
Use when you can write a single shell command (including in-place file edits) that fixes the error with certainty: typos, wrong flags, made-up commands with obvious intent (`listdir` → shell-native equivalent), source edits the compiler pinpoints, single-file renames, missing imports.
13+
Use when you can write a single shell command (including in-place file edits) that fixes the error with certainty: typos, wrong flags, made-up commands with obvious intent (`listdir` → shell-native equivalent), source edits the compiler pinpoints, single-file renames, missing imports, missing language-level packages where the package manager is unambiguous from the project (`ModuleNotFoundError``pip install`, `Cannot find module 'X'``npm install`, `unresolved import` in Rust → `cargo add`).
1414

1515
```json
1616
{"action": "fix", "title": "<≤6 word summary>", "command": "<single-line shell command>", "rationale": "<one sentence>"}
@@ -22,7 +22,7 @@ Use when you can write a single shell command (including in-place file edits) th
2222

2323
### `explain` — anything else
2424

25-
Use when an auto-fix would be wrong, ambiguous, or destructive: tool not installed (needs package-manager choice / elevation), auth/credential issues, multi-step refactors, destructive ops (`rm -rf`, force-push, schema migrations), genuinely unclear user intent, or output that isn't a real error.
25+
Use when an auto-fix would be wrong, ambiguous, or destructive: system CLI tool not installed where the install path is ambiguous (e.g. `psql`, `docker`, `gh` — could be apt / brew / winget / scoop / chocolatey), auth/credential issues, multi-step refactors, destructive ops (`rm -rf`, force-push, schema migrations), genuinely unclear user intent, or output that isn't a real error.
2626

2727
```json
2828
{"action": "explain", "title": "<≤6 word headline>", "explanation": "<markdown>"}

0 commit comments

Comments
 (0)