Skip to content

fix(mobile,extension): use the real cloud agent prompt cap - #5475

Merged
iscekic merged 1 commit into
mobile-batch-1154from
fix/mobile-ext-paste-cap
Aug 25, 2026
Merged

fix(mobile,extension): use the real cloud agent prompt cap#5475
iscekic merged 1 commit into
mobile-batch-1154from
fix/mobile-ext-paste-cap

Conversation

@iscekic

@iscekic iscekic commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Summary

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 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; holds CLOUD_AGENT_PROMPT_MAX_LENGTH = 100_000 and 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 — the TextInput maxLength uses 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.tsxPROMPT_INPUT_MAX_CHARS uses the shared cap.
  • apps/mobile/src/lib/share-payload.tsSHARE_TEXT_MAX_CHARS uses the shared cap, so shared text is no longer cut at 4000 before it reaches a composer.
  • apps/extension/entrypoints/sidepanel/agents-new-session.tsxPROMPT_MAX_LENGTH uses 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 typecheck in apps/mobile, apps/extension, and apps/web — passed.
  • pnpm lint in apps/mobile and apps/extension — 0 warnings, 0 errors.
  • vitest run on the touched tests — extension agents-new-session 31 passed; mobile share-payload, share-prefill, composer-paste-text, chat-composer, new-session-prompt-initial-prompt 49 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

  1. feat(mobile): kilo remote hint, Live now slots, and remote remap #5463feat(mobile): kilo remote hint, Live now slots, and remote remap (base main)
  2. fix(mobile,extension): use the real cloud agent prompt cap #5475 — this PR (base mobile-batch-1154)

Merge in order.

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.
@kilo-code-bot

kilo-code-bot Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (8 files)
  • packages/cloud-agent-sdk/src/limits.ts
  • apps/web/src/lib/cloud-agent/constants.ts
  • apps/mobile/src/components/agents/chat-composer-input-row.tsx
  • apps/mobile/src/components/agents/chat-composer.tsx
  • apps/mobile/src/components/agents/new-session-prompt.tsx
  • apps/mobile/src/lib/share-payload.ts
  • apps/extension/entrypoints/sidepanel/agents-new-session.tsx
  • apps/extension/entrypoints/sidepanel/agents-new-session.test.ts

Reviewed by grok-4.6 · Input: 73.7K · Output: 8.9K · Cached: 384.8K

Review guidance: REVIEW.md from base branch mobile-batch-1154

@iscekic
iscekic merged commit a524c77 into mobile-batch-1154 Aug 25, 2026
3 checks passed
@iscekic
iscekic deleted the fix/mobile-ext-paste-cap branch August 25, 2026 10:56
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