ChatAI Docs

Answer owner rollout

How to roll the shared tool-calling agent into text and Voice without flipping visitors early, plus soak and transport exit criteria.

ChatAI can answer substantive text and Voice turns with either the legacy prepareAnswer path or the shared tool-calling agent (packages/rag/src/agent). Defaults stay on legacy until you flip instance flags. This page is the operator checklist for soak, visitor release, and when GPT-Live's transitional transport is no longer acceptable.

Defaults (safe)

FlagDefaultEffect
ANSWER_OWNER_TEXTlegacyText uses prepareAnswer
ANSWER_OWNER_VOICElegacyVoice uses prepareAnswer → commentary → gate
TEXT_AGENT_VISITOR_RELEASEfalseWidget/API visitors stay on legacy text even if text owner is agent
VOICE_AGENT_VISITOR_RELEASEfalseWidget visitors stay on legacy Voice even if voice owner is agent

Playground/owner sessions may use agent when the matching owner flag is agent, without visitor release. Mid-turn flag flips do not switch the path for an in-flight turn (snapshot at turn start).

Rollout stages

Do text before Voice. Prefer an allowlist of assistant ids before instance-wide enablement.

  1. Shadow (optional): ANSWER_OWNER_TEXT=shadow_agent (and later Voice). Production stays legacy; a background agent run writes status=shadow usage with path: shadow_agent. No visitor output, history, or customer charge from the shadow path.
  2. Playground agent: ANSWER_OWNER_TEXT=agent with visitor release still false. Exercise shared fixtures and reported conversations. Confirm debug.answerOwner === "agent" via Dashboard → Conversations → Export JSON (sanitized per-message debug; not an in-playground download).
  3. Voice playground agent: ANSWER_OWNER_VOICE=agent after text looks healthy. Same gate rules: validated speakable text only, then commentary, then open gate. On connect, the server speaks the assistant welcome once (session.started → commentary + gate). Exports include modality: "voice" and slim debug.voice when present.
  4. Visitor release: set TEXT_AGENT_VISITOR_RELEASE=true / VOICE_AGENT_VISITOR_RELEASE=true only after soak acceptance below. Independent per channel.
  5. Widen allowlists then clear them when ready for all assistants on that channel.

Rollback: set the channel flag back to legacy. In-flight turns keep their snapshot; new turns use legacy immediately.

Soak acceptance (before visitor release)

Keep defaults until these hold on staging (or a narrow production allowlist):

  • Shared fixtures green on text: ack, yes-after-offer, how-are-you, greeting+ask, overview, off-topic (no invite-loop phrasing).
  • Evidence: Layer B rejects bad citations; Layer C fail-closed when unavailable; unsupported-but-cited claims do not ship as verified.
  • Purpose: suggested / instructions-derived / unconfigured still enforce; high-confidence out-of-scope → domain limitation; uncertain with verified evidence keeps the draft.
  • Billing: one production reservation settle per turn; shadow rows never increment customer hosted balance under HOSTED_USAGE_ENFORCEMENT=enforce.
  • Voice: no factual commentary append before validation; social path unchanged; widget visitors still legacy until VOICE_AGENT_VISITOR_RELEASE.
  • Metrics present on agent turns: t_agent_draft_ms, t_verify_ms, t_purpose_ms, t_validated_ready_ms (debug / internal).

Playground Voice mic soak checklist

With ANSWER_OWNER_TEXT=agent, ANSWER_OWNER_VOICE=agent, and visitor release still false, run once on a real mic in the owner playground. Store the conversation, then Dashboard → Conversations → Export JSON.

  1. Connect Voice → hear the assistant welcome once (no double-speak on reattach).
  2. Say “Hey, what’s good” and “How is it going first of all” → short social replies; no domain-limitation redirect loop.
  3. Ask a missing in-domain fact (e.g. “How old is he” when age is not in sources) → not-in-knowledge wording; no “Feel free to ask…”.
  4. Ask “Okay, what’s their latest” then quickly “the new project” (same breath or short continuation) → one knowledge turn (or a rewritten query that includes the Purpose subject / project sense); when the KB has project docs, answer cites projects/ChatAI — not a domain-limitation line with sources attached.
  5. Export JSON on that agent turn shows modality: "voice", debug.answerOwner: "agent", and rewritten debug.question / slim debug.searchQueries (strings only).
  6. Ask “Help me bake a cake” → domain limitation; no cake recipe; outcome stays out of scope.
  7. Soft ASR noise alone (e.g. inhale/laugh tags) → no redirect turn / no canned help spam.
  8. Confirm widget/API visitors still use legacy while VOICE_AGENT_VISITOR_RELEASE / TEXT_AGENT_VISITOR_RELEASE remain false.

Do not flip visitor release until this checklist passes on staging (or a narrow production allowlist).

GPT-Live transport exit criteria

GPT-Live client-delegation + playback gate is a transitional transport. Validated server text is not the spoken audio: commentary is paraphrased, so heard claims can diverge.

Treat these as transport replacement triggers (measure on real mic / staging transcripts):

Failure modeWhy it matters
Ungated factual speechVisitor hears model audio before ChatAI validates / opens the gate
Paraphrase distortionHeard transcript asserts facts not in the validated payload
Grounding control lossModel invents or expands beyond passages/profile evidence after gate open
Sideband cannot block audioServer cannot prevent residual spontaneous speech on the media path

Acceptance for keeping the transport: compare validated commentary payload to the heard transcript on Orb / Dock / Guided; mismatches are fidelity failures, not “already safe because the server validated.”

This checklist does not migrate Voice to a new provider by itself — it only says when to stop treating the current transport as good enough.

Legacy retirement checklist

Do not remove prepareAnswer / scope-router ownership until all of the following are true:

  • Text production traffic uses ANSWER_OWNER_TEXT=agent (or allowlist covering production assistants) with visitor release on, soak metrics healthy
  • Voice production uses ANSWER_OWNER_VOICE=agent the same way, or an explicit decision to keep Voice on legacy longer
  • Shared fixtures remain green on both channels
  • Shadow soak (if used) no longer needed for the cutover decision
  • No nested call from the agent into prepareAnswer / generateGuardedAnswer exists
  • Docs and env reference describe only the surviving path (or document legacy as deprecated)

Until then, legacy remains the production path for legacy and for the production side of shadow_agent.