Skip to content

docs: system_prompt limit is 4,000 tokens (2,000 recommended) - #126

Merged
Him188 merged 1 commit into
mainfrom
docs/system-prompt-token-limit
Aug 9, 2026
Merged

docs: system_prompt limit is 4,000 tokens (2,000 recommended)#126
Him188 merged 1 commit into
mainfrom
docs/system-prompt-token-limit

Conversation

@Him188

@Him188 Him188 commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Summary

Companion to fishaudio/platform-api#1296 — prompt budgets are now measured in tokens:

  • Quickstart and Build/Configuration: cap is 4,000 tokens with ≤2,000 recommended (Builder no longer hard-stops input at 4,000 chars).
  • Authenticated sessions: overrides system_prompt is 4,000 tokens, same budget as the configured prompt (was 8,000 characters).
  • Agent errors: 422 example rewritten to the real value_error shape emitted by the token validator (verified against the actual model output).

first_message/first_message_prompt (10,000 chars) and the analysis prompt (1,000 chars) are unchanged.

🤖 Generated with Claude Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

Summary by CodeRabbit

  • Documentation
    • Updated system prompt limits from 4,000 characters to 4,000 tokens across configuration, authentication, and quickstart guidance.
    • Added a recommendation to keep prompts under 2,000 tokens to help reduce latency and costs.
    • Updated validation error examples to reflect token-based limit enforcement.

Matches platform-api's switch from character to token budgets: config
and session overrides now share one 4,000-token cap (overrides were
8,000 chars), and the 422 example reflects the real value_error shape.

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

mintlify Bot commented Aug 9, 2026

Copy link
Copy Markdown

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

Project Status Preview Updated (UTC)
hanabiaiinc 🔴 Failed Aug 9, 2026, 6:43 AM

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

@Him188
Him188 merged commit 2fd0849 into main Aug 9, 2026
5 of 7 checks passed
@Him188
Him188 deleted the docs/system-prompt-token-limit branch August 9, 2026 06:43
@coderabbitai

coderabbitai Bot commented Aug 9, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: c1b92e71-3ddf-497d-a694-9384d3bddbd1

📥 Commits

Reviewing files that changed from the base of the PR and between 2e68889 and c4fbf09.

📒 Files selected for processing (4)
  • agents/build/configuration.mdx
  • agents/deploy/authenticated-sessions.mdx
  • agents/quickstart.mdx
  • api-reference/agent-errors.mdx

📝 Walkthrough

Walkthrough

The documentation changes replace character-based system prompt limits with a 4,000-token limit. They add a 2,000-token recommendation and update the 422 validation error example.

Changes

System prompt token limits

Layer / File(s) Summary
Token limit guidance and validation example
agents/build/configuration.mdx, agents/deploy/authenticated-sessions.mdx, agents/quickstart.mdx, api-reference/agent-errors.mdx
The documentation now states a 4,000-token system prompt limit, recommends staying below 2,000 tokens in applicable guides, and shows the revised token-limit validation error.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Possibly related PRs

  • fishaudio/docs#116: Updates the same agent documentation pages and introduces related limit and validation examples.
  • fishaudio/docs#119: Updates prompt-related documentation across the same files.
✨ 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/system-prompt-token-limit

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.

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