Skip to content

fix(voice/phone): system-prompt anti-hallucination guards (closes #1102) - #1107

Closed
liususan091219 wants to merge 1 commit into
sonichi:mainfrom
liususan091219:fix/voice-system-prompt-hallucination-guards
Closed

liususan091219 wants to merge 1 commit into
sonichi:mainfrom
liususan091219:fix/voice-system-prompt-hallucination-guards

Conversation

@liususan091219

Copy link
Copy Markdown
Collaborator

Summary

Adds 4 explicit anti-hallucination rules to the owner-tier system prompt in both discord-voice and phone-conversation buildAgent(). Pairs with #1103 (now MERGEABLE) — that PR strengthened when to call work; this PR strengthens what not to say between/around work calls.

The 4 rules

  1. NEVER narrate a tool call not actually made. Catches "I'm opening the repository" / "Let me check the screen" phantom narration — today's discord-voice: tighten system prompt against tool-narration and capability hallucinations #1102-flagged class A hallucination.
  2. NEVER invent capabilities. Tool scope is what the work-tool description says, period. Catches "za warudo enables co-presentation navigation" — class B from today's audit.
  3. Project-specific questions ALWAYS call work. Built-in knowledge does not include this codebase. Catches "za warudo is from JoJo's Bizarre Adventure" answered as-if-it's-the-codebase-meaning — class C.
  4. Between work calls, don't fill silence with synthesized built-in-knowledge prose. Catches the "while waiting on work result, agent confabulates a paragraph" pattern Susan observed in sqlite earlier (msg-id 1508502999088107731, sqlite ep012-recording lines 11-23 of the script).

Why a separate PR from #1103

Issue #1102 has two halves:

Half (A) lands the model in work more reliably; half (B) keeps it from confabulating in the gaps. Both are needed — work-routing alone doesn't fix mid-turn hallucination.

voice-agent.ts unchanged

src/voice-agent.ts already has equivalent guards (lines 713-719 — "NEVER pretend you called a tool", "ALWAYS delegate to work for missing context"). This PR brings the two skills/ voice surfaces to parity.

Test plan

  • npx tsc --noEmit -p . clean
  • Live test on Susan's voice channel after merge. The specific hallucinations seen earlier today (sqlite ep012-recording lines 11-23: "I'm searching the Sutando repository", "za warudo enables co-presentation") should not reproduce.

Closes

— Lucy (Mac Studio bot)

Adds 4 explicit anti-hallucination rules to the owner-tier system prompt
in both discord-voice and phone-conversation `buildAgent()`:

1. NEVER narrate a tool call not actually made (catches "I'm opening
   the repository" / "Let me check the screen" phantom narration —
   today's #1102-flagged class A hallucination).
2. NEVER invent capabilities. Tool scope is what the work-tool
   description says, period. (Catches "za warudo enables co-presentation
   navigation" — class B from today's audit.)
3. Project-specific questions ALWAYS call work. Built-in knowledge does
   not include this codebase. (Catches "za warudo is from JoJo's Bizarre
   Adventure" answered as-if-it's-the-codebase-meaning — class C.)
4. Between work calls, don't fill silence with synthesized built-in-
   knowledge prose. (Catches the "while waiting on work result, agent
   confabulates a paragraph" pattern Susan observed in sqlite earlier.)

Pairs with #1103's work-tool description update — that PR strengthened
the WHEN-to-call-work prompt; this PR strengthens the WHAT-not-to-say
between/around work calls.

voice-agent.ts (the web surface) already has equivalent guards on
lines 713-719 — those are unchanged. This PR brings discord-voice and
phone to parity.

Test plan: live test on Susan's voice channel after merge. The
specific hallucinations seen today (msg `1508502999088107731`,
sqlite ep012-recording lines 11-23) should not reproduce.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.

discord-voice: tighten system prompt against tool-narration and capability hallucinations

1 participant