Description
The interactive REPL's Tab completion does not suggest option names (--xxx), even though docs/interactive-loop.md documents that it should:
As the user types, the autocompletion system suggests available commands, contexts, and option names visible from the current scope.
Repro steps
In an interactive session:
> [nothing typed] + Tab
Matches: catalog, list, install, update, uninstall (+5)
> i + Tab
Command: install
> install + Tab
Param skillName: The skill to install
> install msaf-architect -- + Tab
[nothing useful is suggested]
Command-name completion and positional-parameter completion both work correctly. Only option/flag completion (--) produces no usable suggestion.
Expected behavior
Tab should list the options available on the resolved route (for example --help and route-specific options), the same way the external shell completion bridge (completion __complete, used for bash/zsh/fish/PowerShell/Nu) already does.
Observed behavior
No option names are suggested and no live hint is shown for -- or partial option prefixes.
A local probe on current origin/main (de6de5b) produced only a non-selectable invalid placeholder for the interactive path:
interactive candidates for: install msaf-architect --
--|Invalid|selectable=False
interactive live hint: <null>
Shell completion validation
The external shell completion path does handle option candidates.
Existing regression tests pass:
dotnet test src/Repl.IntegrationTests/Repl.IntegrationTests.csproj -c Release --filter 'FullyQualifiedName~Given_Completions'
# total: 6, failed: 0, succeeded: 6, skipped: 0
A local route-option probe also returned route and global option candidates from completion __complete:
shell candidates for: repl install msaf-architect --
--force
--help
--human
--interactive
--json
--markdown
--no-interactive
--no-logo
--output:
--output:human
--output:json
--output:markdown
--output:xml
--output:yaml
--xml
--yaml
--yml
So this appears scoped to the interactive autocomplete engine, not the shell bridge.
Technical diagnosis
The repo currently has two separate completion engines:
src/Repl.Core/ShellCompletion/ShellCompletionEngine.cs drives the external shell bridge described in docs/shell-completion.md. It implements option suggestions:
ResolveShellCompletionCandidates detects option tokens and calls AddShellOptionCandidates.
AddGlobalShellOptionCandidates and AddRouteShellOptionCandidates use static globals, output aliases/formats, custom globals, and route.OptionSchema.KnownTokens.
- Existing coverage includes
src/Repl.IntegrationTests/Given_Completions.cs for custom global option completion.
src/Repl.Core/Autocomplete/AutocompleteEngine.cs drives the interactive loop (CoreReplApp.Autocomplete.cs, Session/InteractiveSession.cs, Console/ConsoleLineReader.Autocomplete.cs). Its CollectAutocompleteSuggestionsAsync currently assembles command, context, dynamic, ambient, and ambient-continuation candidates, but has no equivalent branch that generates ---prefixed option candidates.
AutocompleteEngine.IsGlobalOptionToken exists, but today it is used for token classification/live-hint behavior, not for collecting selectable option suggestions.
There also appears to be no existing interactive autocomplete regression for option/flag candidates: Given_ConsoleLineReader_Autocomplete.cs and Given_InteractiveAutocomplete_LiveHint.cs contain no -- / option-name coverage.
Suggested direction
Share or port the option-candidate logic from ShellCompletionEngine into AutocompleteEngine, so interactive Tab completion uses the same sources of truth:
- static global options (
--help, --interactive, etc.);
- output aliases and output formats;
- custom global options;
- route-specific options from
route.OptionSchema.KnownTokens.
Add regression tests for at least:
install msaf-architect -- suggests route/global options interactively;
- partial option prefixes (for example
--fo) filter correctly;
- shell completion remains green, to keep parity between both completion paths.
Context
Reported by an external user following the shell-completion documentation who expected -- completion to work the same way inside the interactive REPL.
Description
The interactive REPL's Tab completion does not suggest option names (
--xxx), even thoughdocs/interactive-loop.mddocuments that it should:Repro steps
In an interactive session:
Command-name completion and positional-parameter completion both work correctly. Only option/flag completion (
--) produces no usable suggestion.Expected behavior
Tab should list the options available on the resolved route (for example
--helpand route-specific options), the same way the external shell completion bridge (completion __complete, used for bash/zsh/fish/PowerShell/Nu) already does.Observed behavior
No option names are suggested and no live hint is shown for
--or partial option prefixes.A local probe on current
origin/main(de6de5b) produced only a non-selectable invalid placeholder for the interactive path:Shell completion validation
The external shell completion path does handle option candidates.
Existing regression tests pass:
A local route-option probe also returned route and global option candidates from
completion __complete:So this appears scoped to the interactive autocomplete engine, not the shell bridge.
Technical diagnosis
The repo currently has two separate completion engines:
src/Repl.Core/ShellCompletion/ShellCompletionEngine.csdrives the external shell bridge described indocs/shell-completion.md. It implements option suggestions:ResolveShellCompletionCandidatesdetects option tokens and callsAddShellOptionCandidates.AddGlobalShellOptionCandidatesandAddRouteShellOptionCandidatesuse static globals, output aliases/formats, custom globals, androute.OptionSchema.KnownTokens.src/Repl.IntegrationTests/Given_Completions.csfor custom global option completion.src/Repl.Core/Autocomplete/AutocompleteEngine.csdrives the interactive loop (CoreReplApp.Autocomplete.cs,Session/InteractiveSession.cs,Console/ConsoleLineReader.Autocomplete.cs). ItsCollectAutocompleteSuggestionsAsynccurrently assembles command, context, dynamic, ambient, and ambient-continuation candidates, but has no equivalent branch that generates---prefixed option candidates.AutocompleteEngine.IsGlobalOptionTokenexists, but today it is used for token classification/live-hint behavior, not for collecting selectable option suggestions.There also appears to be no existing interactive autocomplete regression for option/flag candidates:
Given_ConsoleLineReader_Autocomplete.csandGiven_InteractiveAutocomplete_LiveHint.cscontain no--/ option-name coverage.Suggested direction
Share or port the option-candidate logic from
ShellCompletionEngineintoAutocompleteEngine, so interactive Tab completion uses the same sources of truth:--help,--interactive, etc.);route.OptionSchema.KnownTokens.Add regression tests for at least:
install msaf-architect --suggests route/global options interactively;--fo) filter correctly;Context
Reported by an external user following the shell-completion documentation who expected
--completion to work the same way inside the interactive REPL.