Skip to content

docs: session overrides — field reference, voice_id rename, public cap - #119

Merged
Him188 merged 3 commits into
mainfrom
docs/session-overrides
Aug 6, 2026
Merged

docs: session overrides — field reference, voice_id rename, public cap#119
Him188 merged 3 commits into
mainfrom
docs/session-overrides

Conversation

@Him188

@Him188 Him188 commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

What

  • Authenticated sessions gains an ## Overrides section — the single home for override semantics: the five-field table (first_message, first_message_prompt, system_prompt, voice_id, language) with types, limits, and what each replaces; example request; the public-session cap (language + voice_id only); what is not an override (max_duration_seconds comes from conversation config).
  • Dynamic variables page split: the page is now variables-only (title "Dynamic Variables"); its overrides content merged into the section above, with a card/link routing readers there.
  • voice_profile_idvoice_id across quickstart, configuration, voice-language, web-sdk, and openapi.json (six schemas synced surgically from the API).
  • Top-level language is documented as SDK-side sugar folded into overrides.language — no longer a wire field.
  • Cross-links from public-agents, widget, react-sdk, voice-language, and agent-errors point at the new section.
  • The per-agent override allowlist setting remains undocumented by design; pages describe only the 400 behavior ("not enabled for the agent").

Sequencing

Content describes platform-api#1264, merged — publish after it deploys.

Prettier clean; mint broken-links clean (temp/ and .mintlify skill leftovers are pre-existing).

🤖 Generated with Claude Code

Document the overridable fields in the session-creation flow (previously
just "an object gated by an allowlist"), and align with the API revision:
voice_profile_id → voice_id everywhere, first_message_prompt added,
top-level language sugar removed from the wire (SDK option folds into
overrides), public sessions capped to language + voice_id. The per-agent
allowlist setting stays undocumented; pages describe the 400 behavior only.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@mintlify

mintlify Bot commented Aug 6, 2026

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
hanabiaiinc 🟢 Ready View Preview Aug 6, 2026, 8:39 AM

💡 Tip: Enable Workflows to automatically generate PRs for you.

@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The PR updates the OpenAPI schema and agent documentation to use voice_id. It documents session override fields, validation, public-session restrictions, normalized language handling, and SDK links.

Changes

Voice and session override updates

Layer / File(s) Summary
OpenAPI voice and session contracts
api-reference/openapi.json
Renames voice fields to voice_id, removes top-level session language, adds first_message_prompt, and documents public-session restrictions.
Authenticated session override rules
agents/deploy/authenticated-sessions.mdx, agents/build/dynamic-variables.mdx, agents/deploy/public-agents.mdx, api-reference/agent-errors.mdx
Documents supported overrides, validation, keyless-session restrictions, and separate session configuration fields.
Configuration and SDK guidance
agents/build/configuration.mdx, agents/build/voice-language.mdx, agents/deploy/react-sdk.mdx, agents/deploy/web-sdk.mdx, agents/deploy/widget.mdx, agents/quickstart.mdx
Updates examples and guidance to use voice_id and reference session override documentation.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

  • fishaudio/docs#116: Modifies overlapping agent documentation and OpenAPI schemas for voice and session override fields.
  • fishaudio/docs#118: Modifies overlapping authenticated-session and deployment documentation, including override guidance.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main changes: session override documentation, the voice_id rename, and public-session restrictions.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/session-overrides

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 6

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@agents/build/dynamic-variables.mdx`:
- Around line 9-12: Update the overrides row in the comparison table to
accurately reflect the later field list: state that there are five overridable
fields, or describe four mutually exclusive categories and clarify that
first_message and first_message_prompt share one category.

In `@agents/deploy/authenticated-sessions.mdx`:
- Line 143: Update the voice_id field description in the overrides table to
document the 256-character maximum enforced by the OpenAPI schema, while
preserving the existing voice model and language guidance.
- Line 122: Update agents/deploy/authenticated-sessions.mdx:122-122 to state
that backend session-creation requests must send the language setting as
overrides.language rather than top-level language. Update
agents/deploy/web-sdk.mdx:64-64 to qualify language as shorthand for agentId
mode and direct sessionToken callers to configure the language on the backend.
- Around line 146-155: Make the JSON override example self-contained by adding a
dynamic_variables.name value matching the {{name}} placeholder in
overrides.first_message, or remove the placeholder from first_message while
preserving the example’s intent.

In `@agents/deploy/public-agents.mdx`:
- Line 95: Update the public-path documentation sentence to distinguish unknown
override fields, which return 422, from recognized prompt-shaping overrides that
are unsupported for public sessions and return 400; keep language and voice_id
as the allowed overrides.

In `@api-reference/openapi.json`:
- Line 1888: Update every overrides_allowed enum in the OpenAPI schema to
include first_message_prompt, including the five occurrences identified near the
existing voice_id entries and the additional schema definition range. Preserve
all existing enum values and ensure AgentSessionOverridesPayload and related
schemas consistently allow-list this value.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 35e20cd7-a363-4167-8b7a-77e43d4b3cd0

📥 Commits

Reviewing files that changed from the base of the PR and between ecaffe8 and 0ac33ac.

📒 Files selected for processing (11)
  • agents/build/configuration.mdx
  • agents/build/dynamic-variables.mdx
  • agents/build/voice-language.mdx
  • agents/deploy/authenticated-sessions.mdx
  • agents/deploy/public-agents.mdx
  • agents/deploy/react-sdk.mdx
  • agents/deploy/web-sdk.mdx
  • agents/deploy/widget.mdx
  • agents/quickstart.mdx
  • api-reference/agent-errors.mdx
  • api-reference/openapi.json

Comment thread agents/build/dynamic-variables.mdx Outdated
| `name` | string, optional | Display name for this session in the console's Conversations list, up to 128 characters. Omit it to show the session's start time instead. API-key requests only — keyless (public) creation rejects it with `400`. |
| `language` | string, optional | Shorthand for `overrides.language`; subject to the same override allow-list. See [Voice & language](/agents/build/voice-language). |
| `overrides` | object, optional | Per-session config overrides. Each field must be enabled in the agent's override allow-list — unauthorized fields are rejected with `400`. |
| `overrides` | object, optional | Replace parts of the published configuration for this session — see [Overrides](#overrides). |

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Align all language guidance with the wire contract.

Top-level language is an SDK/widget shorthand for overrides.language. It is not a field in the backend session-creation payload, and it cannot modify a session that already exists behind sessionToken.

  • agents/deploy/authenticated-sessions.mdx#L122-L122: Update the request guidance so backend callers send overrides.language, not top-level language.
  • agents/deploy/web-sdk.mdx#L64-L64: Qualify the language option as agentId-mode shorthand and direct sessionToken callers to configure it on the backend.
📍 Affects 2 files
  • agents/deploy/authenticated-sessions.mdx#L122-L122 (this comment)
  • agents/deploy/web-sdk.mdx#L64-L64
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@agents/deploy/authenticated-sessions.mdx` at line 122, Update
agents/deploy/authenticated-sessions.mdx:122-122 to state that backend
session-creation requests must send the language setting as overrides.language
rather than top-level language. Update agents/deploy/web-sdk.mdx:64-64 to
qualify language as shorthand for agentId mode and direct sessionToken callers
to configure the language on the backend.

Source: Coding guidelines

| `first_message` | string, up to 10,000 characters | The agent opens with exactly this text, spoken verbatim — whatever first-message mode the configuration sets. `{{placeholders}}` render inside it. |
| `first_message_prompt` | string, up to 10,000 characters | Instructions the agent generates its opener from, replacing the configured first-message behavior. `{{placeholders}}` render inside it. Mutually exclusive with `first_message` — sending both is `422`. |
| `system_prompt` | string, up to 8,000 characters | Replaces the configured system prompt entirely. `{{placeholders}}` render inside it. |
| `voice_id` | string | The voice the agent speaks with — any [voice model id](/agents/build/voice-language#use-any-voice-model) from the Voice Library. Voices bias pronunciation toward their own language, so pair it with `language`. |

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Document the voice_id length limit.

The OpenAPI schema limits overrides.voice_id to 256 characters. The table only states string. Add the limit so users can predict validation failures.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@agents/deploy/authenticated-sessions.mdx` at line 143, Update the voice_id
field description in the overrides table to document the 256-character maximum
enforced by the OpenAPI schema, while preserving the existing voice model and
language guidance.

Source: Coding guidelines

Comment on lines +146 to +155
```json
{
"agent_id": "YOUR_AGENT_ID",
"overrides": {
"first_message": "Welcome back, {{name}} — picking up where we left off.",
"voice_id": "802e3bc2b27e49c2995d23ef70e6ac89",
"language": "ja"
}
}
```

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Make the override example self-contained.

The example sends {{name}} in first_message but provides no dynamic_variables.name. The documented behavior leaves unmatched placeholders as literal text.

Add a matching variable or remove the placeholder.

Proposed example update
     "first_message": "Welcome back, {{name}} — picking up where we left off.",
     "voice_id": "802e3bc2b27e49c2995d23ef70e6ac89",
     "language": "ja"
-  }
+  },
+  "dynamic_variables": { "name": "Ada" }
 }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
```json
{
"agent_id": "YOUR_AGENT_ID",
"overrides": {
"first_message": "Welcome back, {{name}} — picking up where we left off.",
"voice_id": "802e3bc2b27e49c2995d23ef70e6ac89",
"language": "ja"
}
}
```
🧰 Tools
🪛 GitHub Check: Mintlify Validation (hanabiaiinc) - vale-spellcheck

[warning] 151-151: agents/deploy/authenticated-sessions.mdx#L151
Did you really mean 'voice_id'?

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@agents/deploy/authenticated-sessions.mdx` around lines 146 - 155, Make the
JSON override example self-contained by adding a dynamic_variables.name value
matching the {{name}} placeholder in overrides.first_message, or remove the
placeholder from first_message while preserving the example’s intent.

Source: Coding guidelines

## Treat public input as untrusted

On the public path, the entire session request originates in the visitor's browser. The platform enforces its own guardrails — `overrides` are filtered against the agent's allowlist and unauthorized fields are rejected with `400` — but anything that passes through verbatim is attacker-controllable:
On the public path, the entire session request originates in the visitor's browser. The platform enforces its own guardrails — public sessions accept only the `language` and `voice_id` [overrides](/agents/deploy/authenticated-sessions#overrides), rejecting everything else with `400` — but anything that passes through verbatim is attacker-controllable:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Distinguish unknown fields from unsupported public overrides.

The sentence says that every override other than language and voice_id is rejected with 400. Unknown fields inside overrides are documented elsewhere as 422; 400 applies to recognized fields that are not allowed for the public session.

Limit the 400 statement to recognized prompt-shaping overrides.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@agents/deploy/public-agents.mdx` at line 95, Update the public-path
documentation sentence to distinguish unknown override fields, which return 422,
from recognized prompt-shaping overrides that are unsupported for public
sessions and return 400; keep language and voice_id as the allowed overrides.

Source: Coding guidelines

"first_message",
"system_prompt",
"voice_profile_id",
"voice_id",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Add first_message_prompt to every overrides_allowed enum.

AgentSessionOverridesPayload now defines first_message_prompt, and the schema states that every override must be allow-listed. The enums at Lines 1888, 2115, 2293, 10994, and 11817 still omit this value. Generated clients and schema validators cannot represent an agent that enables this override.

Add first_message_prompt to all five enums.

Proposed schema update
  "first_message",
+"first_message_prompt",
  "system_prompt",

Also applies to: 2115-2115, 2293-2293, 10409-10421, 10994-10994, 11817-11817

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@api-reference/openapi.json` at line 1888, Update every overrides_allowed enum
in the OpenAPI schema to include first_message_prompt, including the five
occurrences identified near the existing voice_id entries and the additional
schema definition range. Preserve all existing enum values and ensure
AgentSessionOverridesPayload and related schemas consistently allow-list this
value.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@Him188
Him188 merged commit 1c7a5fc into main Aug 6, 2026
6 of 7 checks passed
@Him188
Him188 deleted the docs/session-overrides branch August 6, 2026 08: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