Skip to content

fix(prompt): stop model from emitting slash commands as replies#243

Merged
quiet-node merged 1 commit into
mainfrom
claude/laughing-wing-6ee73f
Jun 22, 2026
Merged

fix(prompt): stop model from emitting slash commands as replies#243
quiet-node merged 1 commit into
mainfrom
claude/laughing-wing-6ee73f

Conversation

@quiet-node

Copy link
Copy Markdown
Owner

Overview

Hardens the built-in system prompt so the local model never answers by emitting a slash command (e.g. /search "...") as its reply. Reported against gpt-oss 20B asking for a current net worth: the model replied with the literal text /search "Elon Musk net worth", nothing ran, and every follow-up re-emitted the same command in a loop.

Why

Slash commands in Thuki are user-input only: parseCommands runs solely inside handleSubmit (src/App.tsx), triggered by a user submit. A model-emitted /search ... never passes through it, so it is inert text rendered as a chat bubble. There is no agentic tool-call loop, so the model cannot self-invoke a command.

The prompt advertised /search and instructed the model to "tell the user to run /search". gpt-oss 20B, heavily tool-call-trained, misreads that as "invoke the tool by emitting it" (its reasoning trace literally plans to "reply with a slash command"). With no result coming back, each user nudge makes it re-reason and re-emit, producing the loop. Not a code bug: a prompt/model mismatch.

What changed

src-tauri/prompts/system_prompt.txt:

  • Acting vs Asking: new rule stating slash commands are run only by the user, the model cannot run them, and it must never emit one or pretend to invoke one. When a command would help, it tells the user in its own words to run it, then answers with whatever it can already provide.
  • Expertise and Limits: the /search guidance now asks the model to tell the user to run /search in its own words and vary the wording instead of repeating a fixed phrase.

Model-agnostic; targets the exact misread. Propagates to all non-customized installs via the existing refresh-on-load of the default prompt.

Testing

bun run test:backend passes. The change is prompt text embedded via include_str! with no Rust/TS logic added, so frontend coverage, lint, and typecheck are unaffected.

Note

Two optional follow-ups were considered and not included: a UI affordance that turns a model-emitted /search ... into a one-click run chip, and a full parse-execute-feedback tool-call loop. Both are larger and out of scope for this fix.

Signed-off-by: Logan Nguyen <lg.131.dev@gmail.com>
@quiet-node quiet-node merged commit fa08c8c into main Jun 22, 2026
3 checks passed
@quiet-node quiet-node deleted the claude/laughing-wing-6ee73f branch June 22, 2026 03:52
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.

1 participant