Repository navigation
FIX: recover missing commands in action and how-to replies - #56
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
A critical path still allows external or state-changing tools to run for how_to requests before normalization, and retry responses that are not JSON can surface a parse error instead of the promised user-facing fallback.
2 open issues
What changed in this PR
This PR separates action, shell how-to, and general-question handling, adds explicit --execute support, and retries provider responses that omit commands.
Changes:
- Adds
how_tointent routing and dedicated shell-example guidance. - Adds one-time recovery for missing action or how-to commands.
- Displays how-to commands as literal, non-executable instructions and records them in history.
- Adds
--executeparsing, documentation, help text, and direct action routing.
| File | Description |
|---|---|
| README.md | Documents --execute and missing-command recovery behavior. |
| internal/systemone/client.go | Adds the how_to intent and updated routing criteria. |
| internal/systemone/client_test.go | Updates intent validation and probability tests for the new intent. |
| internal/app/syntax.go | Reuses the shared retry mechanism for syntax repair. |
| internal/app/prompts.go | Adds action, automatic-routing, and shell-instruction response guidance. |
| internal/app/context.go | Parses and validates --execute alongside --question. |
| internal/app/context_commands.go | Updates local help text for the new option. |
| internal/app/command_retry.go | Implements bounded missing-command retries and blocker handling. |
| internal/app/command_retry_test.go | Covers action retries, how-to responses, inert examples, blockers, and option validation. |
| internal/app/app.go | Integrates routing, retry handling, how-to rendering, and explicit execution flow. |
| cmd/clai/main.go | Updates CLI help to describe --execute. |
Review effort: Lite
Merged
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.


Requests such as “resolve this LoadError” or “how to uninstall this?” can produce a description with no command. Route action requests, requests for shell instructions, and general questions separately. For a missing action command or shell example, retry once and show a clear message if no command is available. Use conversation history to resolve references such as “this.”
Action proposals go through the existing syntax, risk, and approval flow. Shell how-to answers display the command as literal instructions in the response and history.
--executeselects the action route directly.--questionstays answer-only and asks for copyable Bash examples ininfowhen relevant.Local checks passed with
go test -race ./...,go vet ./..., a CLI build, and the duplication ratchet. Mocked regression cases cover the missing libvips action, the ImageMagick how-to example, and a retry that requires clarification. The how-to test confirms there is no shell execution or approval prompt even with auto-run and result sharing enabled.