Skip to content

FIX: recover missing commands in action and how-to replies - #56

Merged
merefield merged 3 commits into
mainfrom
fix/commandless-action-replies
Nov 25, 2026
Merged

merefield merged 3 commits into
mainfrom
fix/commandless-action-replies

Conversation

@merefield

@merefield merefield commented Nov 25, 2026 •

Copy link
Copy Markdown
Owner

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. --execute selects the action route directly. --question stays answer-only and asks for copyable Bash examples in info when 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.

@merefield merefield changed the title FIX: recover action replies that omit the command FIX: recover missing commands in action and how-to replies Nov 25, 2026
@merefield
merefield requested a lite review from Copilot November 25, 2026 11:13

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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_to intent 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 --execute parsing, 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

Comment thread internal/app/app.go Resolved
Comment thread internal/app/command_retry.go Resolved
@merefield
merefield merged commit bd761eb into main Nov 25, 2026
7 checks passed
@merefield merefield mentioned this pull request Nov 25, 2026
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.

2 participants