Skip to content

fix(prompt): use mode-aware setup guidance for Web UI vs TUI#68

Merged
LikiosSedo merged 1 commit intomainfrom
fix/web-ui-mode-aware-setup-guidance
Mar 10, 2026
Merged

fix(prompt): use mode-aware setup guidance for Web UI vs TUI#68
LikiosSedo merged 1 commit intomainfrom
fix/web-ui-mode-aware-setup-guidance

Conversation

@LikiosSedo
Copy link
Collaborator

Problem

The system prompt in buildSreSystemPrompt() unconditionally recommended the /setup command for all configuration tasks — but /setup is TUI-only. Web UI users were incorrectly guided to use it instead of the sidebar Settings pages, causing confusion (agent would say "use /setup" while also saying "I'm in a Web UI session").

Solution

Make all setup/configuration guidance in the system prompt mode-aware (mode === "cli" vs web/channel):

  • Environment & Configuration section: TUI → /setup command, Web → sidebar Settings → Credentials / Models
  • No-credentials guidance (credential_list returns empty): TUI → /setup → Credentials → Add, Web → Settings → Credentials page
  • Paste-credential redirect: TUI → /setup → Credentials, Web → Settings → Credentials page

Test plan

  • Start a Web UI session, ask "how to configure cluster" — should reference sidebar Settings → Credentials, no mention of /setup
  • Start a TUI session, ask the same — should reference /setup command as before
  • In Web UI with no credentials, verify credential_list empty path guides to Settings → Credentials

The system prompt unconditionally recommended `/setup` for all
configuration, but `/setup` is a TUI-only command. Web UI users
were incorrectly guided to use it instead of the sidebar
Settings → Credentials / Models pages.

Make three sections of the prompt mode-aware:
- Environment & Configuration: TUI → `/setup`, Web → sidebar Settings
- No-credentials guidance: TUI → `/setup` → Credentials, Web → Settings → Credentials
- Paste-credential redirect: same split
Copy link
Collaborator

@nightmeng nightmeng left a comment

Choose a reason for hiding this comment

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

LGTM. Clean fix for the mode-aware prompt guidance.

One minor note:

channel mode falls into the web branch — the ternary mode === "cli" ? ... : ... means channel sessions also get "sidebar Settings → Credentials" guidance. Verify this is correct for channel mode (e.g., Slack/DingTalk integrations). If channels don't have a sidebar, they might need their own guidance text. If channel sessions always go through the Web UI for setup, then the current behavior is fine.

@LikiosSedo LikiosSedo merged commit 6345563 into main Mar 10, 2026
3 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