fix(mobile,extension): use the real cloud agent prompt cap - #5475
Merged
Conversation
The mobile and extension composers capped the prompt at 4000 characters. The cloud agent accepts 100000 (`Limits.MAX_PROMPT_LENGTH` in `services/cloud-agent-next/src/schema.ts`), and the web composer already uses that number. On mobile the cap sat on the native `TextInput`, so a long paste lost its tail with no toast and no counter. The cap now lives once in `@kilocode/cloud-agent-sdk/limits`. The web constant re-exports it, and mobile and the extension import it in place of the copied literal.
Contributor
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (8 files)
Reviewed by grok-4.6 · Input: 73.7K · Output: 8.9K · Cached: 384.8K Review guidance: REVIEW.md from base branch |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The mobile and extension composers capped the prompt at 4000 characters. The cloud agent accepts 100000 —
Limits.MAX_PROMPT_LENGTHinservices/cloud-agent-next/src/schema.ts— and the web composer already uses that number. On mobile the cap sat on the nativeTextInput, so a long paste lost its tail with no toast and no counter. The extension carried the same 4000 literal.The cap now lives once in
@kilocode/cloud-agent-sdk/limits, a package all three apps already depend on. The web constant re-exports it, so the web keeps its exported name and its behaviour.Files
packages/cloud-agent-sdk/src/limits.ts— new; holdsCLOUD_AGENT_PROMPT_MAX_LENGTH = 100_000and names the server cap it mirrors.apps/web/src/lib/cloud-agent/constants.ts— re-exports the SDK constant instead of declaring its own copy.apps/mobile/src/components/agents/chat-composer-input-row.tsx— theTextInputmaxLengthuses the shared cap.apps/mobile/src/components/agents/chat-composer.tsx— the share-prefill, voice-draft, and clipboard-paste paths use the shared cap.apps/mobile/src/components/agents/new-session-prompt.tsx—PROMPT_INPUT_MAX_CHARSuses the shared cap.apps/mobile/src/lib/share-payload.ts—SHARE_TEXT_MAX_CHARSuses the shared cap, so shared text is no longer cut at 4000 before it reaches a composer.apps/extension/entrypoints/sidepanel/agents-new-session.tsx—PROMPT_MAX_LENGTHuses the shared cap.Tests: 1 test file changed — the extension constant test asserts the shared cap instead of the literal 4000.
Generated: none — no lockfiles, build output, or generated artifacts changed.
Verification
pnpm typecheckinapps/mobile,apps/extension, andapps/web— passed.pnpm lintinapps/mobileandapps/extension— 0 warnings, 0 errors.vitest runon the touched tests — extensionagents-new-session31 passed; mobileshare-payload,share-prefill,composer-paste-text,chat-composer,new-session-prompt-initial-prompt49 passed.No E2E report attached.
Visual Changes
Visual Changes: N/A
Reviewer Notes
Two behaviours stay as they are. Mobile shows no character counter, unlike the web composer, which shows one from 90% of the cap. Mobile still truncates at the cap itself, now at the same length the worker rejects.
No manual step is needed before or after merge.
Stacked on #5463.
Stack
feat(mobile): kilo remote hint, Live now slots, and remote remap(basemain)mobile-batch-1154)Merge in order.