feat(chat): add /detect slash command for mid-session re-detection#102
Open
michaelroy-amd wants to merge 2 commits into
Open
feat(chat): add /detect slash command for mid-session re-detection#102michaelroy-amd wants to merge 2 commits into
michaelroy-amd wants to merge 2 commits into
Conversation
Once ChatConsent::Accepted, the pre-accept 'd' gate key is unreachable (it's ordinary chat text when focused, and unbound when unfocused), so there was no way to re-run local-engine detection after the initial handshake without restarting the app. Add a `/detect [accept|save|dismiss]` slash command that reuses the existing request_detect/accept_detect_offer/save_detect_offer/ dismiss_detect_offer reducer methods. A bare `/detect` raises the same probe used at startup and echoes the result into the chat transcript (the offer y/s/n UI is never drawn once Accepted, since draw() only renders it pre-accept). `/detect accept` and `/detect save` route through the same code path as the initial accept, so a re-detect mid- session raises the chat_endpoint_rebuild edge exactly like startup does, swapping the live agent to the newly detected endpoint. Relates to EAI-7354. Signed-off-by: Michael Roy <michael.roy@amd.com>
4 tasks
… offer Two consistency refinements to the /detect slash command: - Lowercase the sub-command before matching, so `/detect ACCEPT` etc. behave like the lowercase forms — mirroring the case-insensitive parsing of the sibling `/permissions` and `/provider` commands. - Emit a short hint turn when `/detect accept` or `/detect save` is used with no pending detected endpoint (previously a silent reducer no-op), pointing the user at bare `/detect` to probe first. Relates to EAI-7354. Signed-off-by: Michael Roy <michael.roy@amd.com>
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.
Summary
/detect [accept|save|dismiss]slash command so a local chatengine can be re-detected after
ChatConsent::Accepted, without adedicated keybinding colliding with focused chat text entry.
/detectre-runs the same probe used at startup(
detect_local_chat: managed-services registry, then Lemonade:13305 / vLLM :8000 / rocm serve :11435) and echoes the result into
the chat transcript.
/detect accept//detect save//detect dismissroute throughthe existing
accept_detect_offer/save_detect_offer/dismiss_detect_offerreducer methods.Root cause
Once chat is
ChatConsent::Accepted, the pre-accept'd'gate key isunreachable: while a text field is focused a bare
dkeypress isordinary chat input, and when unfocused the global hotkey table does
not bind
'd'for the Chat tab. There was no way to react to a localengine coming online (or changing) after the initial handshake short
of restarting the app.
Fix
slash.rs: new"detect"branch dispatches to the pre-existingAppStatereducer methods used by the pre-accept offer UI, so nonew detection or endpoint-swap plumbing was introduced.
app/mod.rs:request_detect()now also echoes a "Detecting…" message into thetranscript when already
Accepted(previously this messaging onlymade sense pre-accept, driving the gate UI).
set_detect_result()echoes the found/not-found result into thetranscript when
Accepted, sincedraw()only renders theoffer y/s/n prompt pre-accept (confirmed in
ui/tabs/chat.rs) —without this the probe result would be silently discarded once
accepted.
/detect accept//detect savegoes through the sameaccept_detect_offer/save_detect_offercalls the initial pre-accept flow uses, so itraises the
chat_endpoint_rebuilddispatch edge (introduced inPR fix(dash): rebuild live chat agent when a local endpoint is accepted #81) exactly like the initial accept does, swapping the live
agent to the newly detected endpoint.
Coordination notes
app/mod.rs,slash.rs), adifferent surface than PR fix(dash): prefer a local chat server over the cloud default at startup #100 (
fix/chat-startup-local-first,which only touches the
event_loop()startup block) and thanunmerged upstream PR fix(dash): discover served model for configured chat endpoint #97 (which touches
resolve_llm_config'sfallback and the startup block). No overlapping hunks expected.
Relates to EAI-7354.
Test Plan
cargo build -p rocm-dash-tuicargo clippy -p rocm-dash-tui --all-targets --all-features(clean,-D warnings)cargo test -p rocm-dash-tui -- --test-threads=1(551 passed, 0 failed)slash_detect_probes_and_echoes_result_while_acceptedslash_detect_accept_raises_endpoint_rebuild_like_initial_acceptslash_detect_dismiss_and_unknown_subcommand