Skip to content

feat: raise the sync config caps to match the service - #180

Closed
aurpsis-aai wants to merge 1 commit into
mainfrom
aurpsis/raise-sync-config-caps
Closed

aurpsis-aai wants to merge 1 commit into
mainfrom
aurpsis/raise-sync-config-caps

Conversation

@aurpsis-aai

Copy link
Copy Markdown
Contributor

What

Raise the client-side caps in src/services/sync/service.ts to the values the sync service enforces, and add the one check the SDK was missing.

before after
prompt 4096 chars 6000 chars
keyterms_prompt 2048 chars 8000 chars
keyterms_prompt term count unchecked 100 terms
conversation_context 100 turns / 4096 chars 500 turns / 16000 chars

Over-cap prompt and keyterms_prompt still throw before the request is sent; over-cap conversation_context is still trimmed oldest-first rather than rejected. Only the numbers move.

Why

The service raised these caps (DeepLearning#20095), so the SDK has been rejecting values the API now accepts — a caller passing a 5000-character prompt gets a client-side Error for a request the server would have taken. The values here match asr_sync_u3pro/http_server/schemas.py:27-36 exactly, and the Python SDK made the same change in 1.5.2.

The 100-term cap is new to this SDK: the service rejects a keyterms_prompt over 100 terms, and without a local check that surfaces as a server error mid-request instead of an immediate one.

Testing

pnpm test:unit -- tests/unit/sync.test.ts — 34 passed. Five existing cases asserted behavior at the old caps (3000-char keyterms rejected, 5000-char prompt rejected, 120 turns trimmed, and two conversation_context trims) and were re-based on the new ones; added a case for the term-count cap. pnpm lint:eslint, lint:tsc, and prettier are clean on the changed files.

Pre-existing on main, untouched by this PR: tests/unit/utils.test.ts (3 user-agent assertions expecting runtime_env=Node/) and tests/unit/realtime.test.ts fail, and prettier reports 6 unformatted files under samples/ and the generated src/types/*.generated.ts. Verified by running both suites with this branch's two source files reverted to origin/main.

Not in this PR

stt_prompt is a dictation parameter, and this SDK has no dictation surface yet — the Python SDK grew one in 1.5.x. Adding client.dictation is a feature, not a cap change, so it's out of scope here.

🤖 Generated with Claude Code

The sync API raised its `config` caps, so the SDK was rejecting values the
server now accepts: prompt 4096 → 6000, keyterms_prompt 2048 → 8000, and
conversation_context 100 → 500 turns / 4096 → 16000 characters. Also enforce
the server's 100-term cap on keyterms_prompt, which had no client-side check.

Mirrors the Python SDK's 1.5.2.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@aurpsis-aai

Copy link
Copy Markdown
Contributor Author

Superseded by #181, which raised the same sync caps (plus the SyncTranscriptionConfig JSDoc) as part of the Python-parity change and has merged into main at 4.41.0. — Jeeves

@aurpsis-aai
aurpsis-aai deleted the aurpsis/raise-sync-config-caps branch September 11, 2026 20:09
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