Validate planner model names and run CLI planners without tools
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 48/100
Research direction
Read fm9/ai_settings.py and fm9/planner.py to trace where saved model names are accepted and passed to the Claude and Grok CLI commands. Add tests for save-time and call-time validation, including the listed shell characters, and tests that pin each CLI backend’s exact arguments. Done means invalid names are refused with a clear message and each CLI invocation disables tools, without changing backend selection or API backends.
Written by the indexing model from the issue text.
Description
Found while reviewing #303. These predate that PR and apply to the existing command-line planner backends (Claude CLI, Grok CLI), so they are fixed app-wide here rather than in a contributor PR.
1. The saved model name reaches the command line unchecked.
fm9/ai_settings.py stores whatever text the AI settings form sends as the model, and fm9/planner.py passes it after --model. On Windows, when shutil.which() resolves an npm-installed CLI to a .cmd wrapper, subprocess runs it through cmd.exe, where &, | and similar characters in that argument are not neutralised by shell=False. A model name such as x&calc would then run a second command. The settings route is local-only since #291, so this needs access to the machine, but it should still be closed.
Fix: validate model names on save and again before use against a strict pattern (letters, digits, ., -, _, :, /, bounded length), and refuse anything else with a clear message.
2. CLI planners are not restricted to answering.
The Claude CLI is run with -p and no tool restriction, so it may use its read-only tools (file reads, search) on the player's machine during planning. A planning request, or reference text pasted into one, could steer it to read local files into the model context. The planner only needs a text answer.
Fix: run each CLI backend with tools disabled (or the narrowest documented equivalent for that CLI), and cover each with a test that pins the exact arguments.
Acceptance
- Model names outside the allowed pattern are refused on save and at call time, with tests including
&,|,^,%, quotes and newlines. - Each CLI backend's argument list includes its tool restriction, pinned by tests.
- No change to which backend is chosen or to API-based backends.
- Dominant language
- Python
- Stars
- 7
- Forks
- 3
- Avg merge
- 4h 26m
- Merged PRs (30d)
- 48
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from monzta1/ToneCommand
-
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
monzta1/ToneCommand#268 ·
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
monzta1/ToneCommand#269 ·
Maintainers usually reply within 1 day
-
bug device
Difficulty 4/5 3-5 days Newbie friendliness 12/100
monzta1/ToneCommand#250 · 1 comment ·
Maintainers usually reply within 1 day
-
bug device
Difficulty 4/5 3-5 days Newbie friendliness 18/100
monzta1/ToneCommand#241 · 2 comments ·
Maintainers usually reply within 1 day
-
device enhancement epic
Difficulty 5/5 Over a week Newbie friendliness 12/100
monzta1/ToneCommand#239 ·
Maintainers usually reply within 1 day
All issues in monzta1/ToneCommand
Similar issues
-
follow-up needs-triage S3: minor
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
manaflow-ai/cmux#36856 · 1 comment ·
Maintainers usually reply within 1 day
-
documentation good first issue help wanted
Difficulty 1/5 1-3 hours Newbie friendliness 90/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 73/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Shell framework build fails at "copy the shader libraries": the iOS shader libraries are now one file b-<chain>.imgPossibly taken @xiaofeng-han claimed this today. Openbuild ios
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day