Skip to content

fix: Slash Command Autocomplete vs. Auto-Execute Fix (#2257)#2275

Open
yunus25jmi1 wants to merge 10 commits intodocker:mainfrom
yunus25jmi1:feature/slash-command-autocomplete-fix
Open

fix: Slash Command Autocomplete vs. Auto-Execute Fix (#2257)#2275
yunus25jmi1 wants to merge 10 commits intodocker:mainfrom
yunus25jmi1:feature/slash-command-autocomplete-fix

Conversation

@yunus25jmi1
Copy link
Copy Markdown
Contributor

I have successfully implemented a root-cause fix for the issue where pressing Tab to autocomplete a slash command would immediately execute it instead of just completing the text.

Root Cause Analysis:
In pkg/tui/components/completion/completion.go, both Enter and Tab were bound to the same key binding, causing auto-submit completions (like slash commands) to execute immediately upon selection with either key.

Solution Implemented:

  • Separate Tab and Enter key bindings in completion.go.
  • Tab now autocompletes text only (AutoExecute=false).
  • Enter executes the command (AutoExecute=true).
  • Updated editor.go to handle the AutoExecute flag.
  • Added comprehensive tests in pkg/tui/components/completion/autocomplete_test.go.

Verification:

  • pkg/tui/components/completion tests: 6/6 PASS
  • pkg/tui/components/editor tests: PASS
  • Successful build of project and binary

Fixes #2257

@yunus25jmi1 yunus25jmi1 requested a review from a team as a code owner March 29, 2026 07:56
I have successfully implemented a root-cause fix for the issue where pressing Tab to autocomplete a slash command would immediately execute it instead of just completing the text.

Root Cause Analysis:
In pkg/tui/components/completion/completion.go, both Enter and Tab were bound to the same key binding, causing auto-submit completions (like slash commands) to execute immediately upon selection with either key.

Solution Implemented:
- Separate Tab and Enter key bindings in completion.go.
- Tab now autocompletes text only (AutoExecute=false).
- Enter executes the command (AutoExecute=true).
- Updated editor.go to handle the AutoExecute flag.
- Added comprehensive tests in pkg/tui/components/completion/autocomplete_test.go.

Verification:
- pkg/tui/components/completion tests: 6/6 PASS
- pkg/tui/components/editor tests: PASS
- Successful build of project and binary

Fixes docker#2257
@yunus25jmi1 yunus25jmi1 force-pushed the feature/slash-command-autocomplete-fix branch from a5614de to 68994bd Compare March 29, 2026 08:01
dgageot and others added 9 commits March 31, 2026 10:30
Signed-off-by: David Gageot <david.gageot@docker.com>
Add three new boolean provider_opts for Google models that enable
Gemini built-in tools: google_search (Google Search grounding),
google_maps (Google Maps grounding), and code_execution (server-side
code execution). When any built-in tool is used alongside function
calling, IncludeServerSideToolInvocations is automatically set.

Assisted-By: docker-agent
Add FinishReason to chat.Message and MessageUsage so API consumers can
distinguish the root agent's final response from intermediate tool-call
turns during live streaming.

- Propagate provider's explicit finish_reason through the streaming
  pipeline (stop/length via early return, tool_calls tracked and
  preserved after the stream loop)
- Infer finish_reason when the provider sends a bare EOF: tool calls
  present → tool_calls, content present → stop, nothing → null
- Validate finish_reason against actual stream output (tool_calls
  requires tool calls, stop is overridden when tool calls exist)
- Reconstruct LastMessage on session restore so FinishReason is
  available for historical sessions (scoped to parent session only)
Signed-off-by: Guillaume Tardif <guillaume.tardif@gmail.com>
Signed-off-by: Guillaume Tardif <guillaume.tardif@gmail.com>
Automated changelog update for release v1.40.0

Assisted-By: Docker Agent
Before compaction, the last ~20k tokens of messages are now kept aside
and excluded from summarization. The summary item records a
FirstKeptEntry index pointing to the first preserved message, and
GetMessages reconstructs the conversation as [summary, kept_messages...].

This allows the LLM to continue naturally after a compaction event
by retaining recent conversational context verbatim while still
compacting older history.

Signed-off-by: Djordje Lukic <djordje.lukic@docker.com>
Warning and error notifications no longer auto-dismiss after 3 seconds.
They display an [x] close button and remain visible until the user clicks
on them. Success and info notifications continue to auto-dismiss.

- Add persistent() and style() methods on notification Type
- Add render() method on notificationItem to centralize rendering
- Add HandleClick() on Manager for mouse-based dismissal
- Clamp maxWidth to prevent underflow on very narrow terminals

Fixes docker#2247

Assisted-By: docker-agent
…mpletion items

Execute-only items (e.g., 'Browse files...') with an empty Value would
fall through to the text insertion logic, removing the trigger character
and inserting a space. Add a guard to close the popup cleanly instead.

Assisted-By: docker-agent
@k33g
Copy link
Copy Markdown
Contributor

k33g commented Apr 1, 2026

@yunus25jmi1 does it fix the the call of a skill with a slash command (#1819)?

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.

[enhancement] Slash Command auto complete vs. auto execute

6 participants