Skip to content

FIX: show command examples for contextual follow-ups - #58

Merged
merefield merged 1 commit into
mainfrom
fix/contextual-command-examples
Nov 27, 2026
Merged

merefield merged 1 commit into
mainfrom
fix/contextual-command-examples

Conversation

@merefield

Copy link
Copy Markdown
Owner

What changed

CLAI can route a short follow-up about a previous command’s target or options through the shell-instructions workflow. System One gets the current request and a history-available flag. The response model uses the saved conversation to produce the complete command example. Shell instructions remain display-only and get one retry if the model omits the command.

Example

After discussing tmux attach-session -t builder, clai "what is the -t for?" explains the flag. clai "what about last session?" then shows tmux attach-session for use from outside tmux. tmux prefers the most recently used unattached session when selecting by recency. tmux manual

Verification

  • Replayed both turns against the configured providers with synthetic history. The second reply displayed tmux attach-session as an example.
  • Added a regression test that reloads saved history and checks the missing-example retry and display-only handling.
  • go test -race ./..., go vet ./..., and the production duplication check passed locally.

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.

🟢 Approval recommended

No active review issues are reported for the history-aware contextual follow-up changes.

No open issues 🎉

What changed in this PR

This PR enables history-aware contextual follow-ups to produce complete, display-only shell command examples. System One receives conversation-history availability, while prompt guidance and retry handling resolve omitted command context.

Changes:

  • Added history-aware routing metadata and guidance for contextual command follow-ups.
  • Added prompts for resolving prior commands and showing revised examples without execution.
  • Added documentation and regression coverage for saved history, retries, and display-only behavior.
File Description
README.md Documents contextual command follow-ups and display-only example behavior.
internal/​systemone/​client.go Adds history availability to intent requests and expands follow-up routing criteria.
internal/​systemone/​client_test.go Verifies serialization of the history state in intent requests.
internal/​app/​prompts.go Adds shared prompt guidance for resolving contextual shell command references.
internal/​app/​command_retry_test.go Tests saved-history follow-ups, missing-command retries, and non-execution of displayed examples.
internal/​app/​app.go Passes conversation-history availability during intent routing.
internal/​app/​app_test.go Updates routing assertions for the expanded intent request.

Review effort: Lite

@merefield
merefield merged commit 24a425b into main Nov 27, 2026
8 checks passed
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