Repository navigation
fix(quick-commands): save agent prompts whole, bounded by what a chat message carries - #24488
Conversation
|
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes — reviewed the complete 42-file diff (1 commit) that removes the 6,000-character agent-prompt cap from quick commands and moves the length constraint to launch time.
- Storage:
normalizeTerminalQuickCommands, thesettings.updateTerminalQuickCommandsschema, and the mobileagentPromptlaunch param no longer cap agent prompts.MAX_QUICK_COMMAND_AGENT_PROMPT_LENGTHbecomesLEGACY_MAX_QUICK_COMMAND_AGENT_PROMPT_LENGTH, used only when talking to pre-long-prompt builds. - Launch:
planLaunchAgentStartupPromptchecks the built launch command withagentLaunchCommandFitsPlatform(the renamed draft limit, now also covering Linux/macOS's 128 KB per-argument bound) and falls back to paste-after-ready with auto-submit when it will not fit.launch-agent-in-new-tabsuppresses command-code's inlineinitialAgentStatuswhen the prompt is pasted instead of riding the command. - Host / mixed versions: new
terminal.quick-commands.long-prompts.v1capability, advertised by hosts (RUNTIME_CAPABILITIES) and by every client (remoteRuntimeClientCapabilities).projectTerminalQuickCommandsForClientwithholds over-cap commands from clients that do not advertise it, on both the read and update replies, so an older client never rejects the whole list. - Mobile: host-built mobile launches now refuse a prompt the host command line cannot carry; editors read the target host's capability to decide whether to cap and refuse rather than trim.
- Desktop editors: the dialog shows a character counter near a cap and blocks Save over an older host's cap; no cap means no counter and no limit.
I verified the capability is present in both the host and client capability lists, that only upsert/delete mutations exist (so a withheld command cannot be overwritten by an older client's later save), that SettingsUpdate cannot carry quick commands, and that the mobile client capability count stays under the host's 64-entry parse limit. The focused suites for the launch planner, host withholding, editor refusal, and host prompt limit all pass.
deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 Walkthrough
Priority: ➖ Normal Merge Risk: 🟡 Moderate · up to
|
There was a problem hiding this comment.
Actionable comments posted: 3
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: 6fdbb4ee-1e99-42b7-8ada-a54eae52ac03
📒 Files selected for processing (42)
mobile/src/session/MobileSessionSheets.tsxmobile/src/session/QuickCommandEditorForm.tsxmobile/src/session/QuickCommandsSheet.test.tsmobile/src/session/QuickCommandsSheet.tsxmobile/src/session/quick-command-draft.test.tsmobile/src/session/quick-command-draft.tsmobile/src/session/use-mobile-session-feedback-capabilities.tsmobile/src/session/use-mobile-session-tab-reconciliation.tsmobile/src/terminal/quick-commands.tssrc/cli/runtime/websocket-transport.test.tssrc/main/runtime/orca-runtime-resolve-mobile-session-terminal-command.tssrc/main/runtime/orca-runtime-tests/mobile-session-tabs-part-11.spec.tssrc/main/runtime/rpc/methods/client-ui.test.tssrc/main/runtime/rpc/methods/client-ui.tssrc/main/runtime/rpc/methods/terminal-quick-command-long-prompt-capability.test.tssrc/main/runtime/rpc/methods/terminal-quick-command-long-prompt-capability.tssrc/renderer/src/components/settings/QuickCommandsPane.tsxsrc/renderer/src/components/tab-bar/TabBarQuickCommandsButton.tsxsrc/renderer/src/components/terminal-pane/TerminalQuickCommandEditorDialog.tsxsrc/renderer/src/components/terminal-quick-commands/TerminalQuickCommandContentSection.tsxsrc/renderer/src/components/terminal-quick-commands/TerminalQuickCommandDialog.test.tsxsrc/renderer/src/components/terminal-quick-commands/TerminalQuickCommandDialog.tsxsrc/renderer/src/hooks/use-terminal-quick-command-hosts.test.tssrc/renderer/src/i18n/locales/en.jsonsrc/renderer/src/lib/launch-agent-in-new-tab.tssrc/renderer/src/lib/launch-agent-startup-prompt-plan.test.tssrc/renderer/src/lib/launch-agent-startup-prompt-plan.tssrc/renderer/src/lib/terminal-quick-command-host-prompt-limit.tssrc/renderer/src/store/slices/terminal-quick-command-hosts.test.tssrc/renderer/src/store/slices/terminal-quick-command-hosts.tssrc/renderer/src/web/web-runtime-client.test.tssrc/renderer/src/web/web-runtime-connection-frame-router.tssrc/shared/agent-draft-platform-limit.tssrc/shared/agent-launch-command-platform-limit.tssrc/shared/protocol-version.tssrc/shared/remote-runtime-client-capabilities.tssrc/shared/rpc-contract/session-tabs-schemas-params.tssrc/shared/rpc-contract/terminal-quick-command-params.tssrc/shared/terminal-quick-command-capabilities.tssrc/shared/terminal-quick-commands.test.tssrc/shared/terminal-quick-commands.tssrc/shared/tui-agent-startup.ts
💤 Files with no reviewable changes (3)
- src/shared/agent-draft-platform-limit.ts
- src/main/runtime/rpc/methods/client-ui.test.ts
- src/shared/rpc-contract/session-tabs-schemas-params.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review.
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: abf4fe28-a491-44df-9931-814049cfe908
📒 Files selected for processing (83)
mobile/src/session/MobileSessionSheets.tsxmobile/src/session/QuickCommandEditorForm.tsxmobile/src/session/QuickCommandsSheet.test.tsmobile/src/session/QuickCommandsSheet.tsxmobile/src/session/quick-command-draft.test.tsmobile/src/session/quick-command-draft.tsmobile/src/session/use-mobile-session-feedback-capabilities.tsmobile/src/session/use-mobile-session-tab-reconciliation.tsmobile/src/terminal/quick-commands.tssrc/main/agent-launch/agent-launch-executor.test.tssrc/main/agent-launch/agent-launch-executor.tssrc/main/agent-launch/agent-launch-prompt-delivery.tssrc/main/agent-launch/agent-launch-surface-factories.tssrc/main/ipc/pty/ipc/write-launch-prompt.test.tssrc/main/ipc/pty/ipc/write.tssrc/main/ipc/pty/register-handlers.tssrc/main/persistence/applying-settings/settings-update-terminal-quick-commands.test.tssrc/main/persistence/applying-settings/settings-update.tssrc/main/providers/windows-shell-args.tssrc/main/runtime/agent-terminal-startup-prompt.test.tssrc/main/runtime/orca-runtime-agent-session-oversized-prompt.test.tssrc/main/runtime/orca-runtime-create-agent-session.tssrc/main/runtime/orca-runtime-create-terminal-desktop.tssrc/main/runtime/orca-runtime-create-terminal.tssrc/main/runtime/orca-runtime-resolve-worktree-removal-target.tssrc/main/runtime/orca-runtime-stop-exact-terminals-for-worktree.tssrc/main/runtime/rpc/methods/agent-launch-surfaces.tssrc/main/runtime/rpc/methods/terminal/terminal-launch-prompt-send.tssrc/main/runtime/rpc/methods/terminal/terminal-send-method.tssrc/main/runtime/rpc/terminal-launch-prompt-send.test.tssrc/main/runtime/runtime-terminal-contracts.tssrc/main/runtime/terminal-run-facts-input.test.tssrc/preload/api/pty-api.tssrc/preload/api/pty-bridge-session-control.tssrc/renderer/src/components/settings/QuickCommandsPane.tsxsrc/renderer/src/components/tab-bar/TabBarQuickCommandsButton.tsxsrc/renderer/src/components/terminal-quick-commands/TerminalQuickCommandContentSection.tsxsrc/renderer/src/components/terminal-quick-commands/TerminalQuickCommandDialog.test.tsxsrc/renderer/src/components/terminal-quick-commands/TerminalQuickCommandDialog.tsxsrc/renderer/src/i18n/locales/en.jsonsrc/renderer/src/i18n/locales/fr.jsonsrc/renderer/src/i18n/locales/ja.jsonsrc/renderer/src/i18n/locales/ko.jsonsrc/renderer/src/i18n/locales/zh.jsonsrc/renderer/src/lib/agent-launch-prompt-delivery.test.tssrc/renderer/src/lib/agent-launch-prompt-delivery.tssrc/renderer/src/lib/agent-launch-prompt-host-delivery.test.tssrc/renderer/src/lib/agent-launch-prompt-host-delivery.tssrc/renderer/src/lib/launch-agent-in-new-tab-web-runtime.test.tssrc/renderer/src/lib/launch-agent-in-new-tab-windows-quoting.test.tssrc/renderer/src/lib/launch-agent-in-new-tab.tssrc/renderer/src/lib/launch-agent-paste-timeout-notice.tssrc/renderer/src/lib/launch-agent-startup-prompt-plan.test.tssrc/renderer/src/lib/launch-agent-startup-prompt-plan.tssrc/renderer/src/lib/launch-agent-web-host-tab.tssrc/renderer/src/lib/terminal-quick-command-host-prompt-limit.tssrc/renderer/src/lib/terminal-quick-command-search.test.tssrc/renderer/src/lib/terminal-quick-command-search.tssrc/renderer/src/runtime/web-runtime-agent-session-create-params.tssrc/renderer/src/runtime/web-runtime-session-terminal-deferred-prompt.test.tssrc/renderer/src/runtime/web-runtime-session-types.tssrc/renderer/src/runtime/web-runtime-session.tssrc/renderer/src/runtime/web-runtime-terminal-create-operation.tssrc/renderer/src/runtime/web-runtime-terminal-creation.tssrc/renderer/src/runtime/web-runtime-terminal-identity.tssrc/renderer/src/store/slices/terminal-quick-command-hosts.tssrc/renderer/src/web/preload-api/web-terminal-api.tssrc/shared/agent-launch-command-line-budget.test.tssrc/shared/agent-launch-command-line-budget.tssrc/shared/agent-session-host-authority.tssrc/shared/hermes-startup-query.tssrc/shared/hermes-startup-query.windows.test.tssrc/shared/protocol-version.tssrc/shared/rpc-contract/agent-session-params.tssrc/shared/rpc-contract/session-tabs-schemas-params.tssrc/shared/rpc-contract/terminal-quick-command-params.tssrc/shared/rpc-contract/terminal-unary-params.tssrc/shared/runtime-terminal-contracts.tssrc/shared/runtime-terminal-create-contract.tssrc/shared/terminal-quick-command-capabilities.tssrc/shared/terminal-quick-commands.tssrc/shared/tui-agent-startup-oversized-prompt.test.tssrc/shared/tui-agent-startup.ts
🚧 Files skipped from review as they are similar to previous changes (1)
- src/renderer/src/i18n/locales/en.json
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 2 remain after this review.
There was a problem hiding this comment.
ℹ️ No critical issues — a couple of minor suggestions inline.
Reviewed changes — re-reviewed the delta since the prior pullfrog review (56ae836): commits c81b438 (host-side deferred launch-prompt delivery) and ce5c070 (100,000-char cap plus host-derived editor cap), with 772b696 bringing origin/main in.
- Deferred prompt delivery rework: the runtime create now reports
startupPromptDeferredand each caller delivers the text through the host's agent-prompt writer instead of refusing the launch. Adds adeferOversizedPromptopt-in toterminal.createAgentSession, aterminal.send { launchPrompt: true }delivery, and a localpty:deliverAgentLaunchPromptIPC. - Launch budget:
agentLaunchCommandFitsPlatformbecomeslaunchCommandFitsinagent-launch-command-line-budget.ts; Windows is judged against cmd.exe (each"/\weighted twice, plus a shim-prefix reserve) and POSIX against a 128 KiB per-argument limit. - Storage cap: agent prompts are capped at 100,000 characters and the whole list is given a serialized byte budget, both enforced once in
updateSettings; saves are refused rather than trimmed. - Host cap negotiation: editors derive each host's cap from runtime status capabilities, dropping the separate
acceptsLongPromptsprobe; over-cap refusals are static alert text with a separate live count. - Legacy mobile path restored:
agentPromptis back to its 6,000-character cap and the host-built mobile refusal is gone.
deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
Actionable comments posted: 2
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: d10cb423-c489-4b21-876b-e9271bb1c75a
📒 Files selected for processing (41)
src/main/ipc/pty/ipc/write-launch-prompt.test.tssrc/main/ipc/pty/ipc/write.tssrc/main/persistence/applying-settings/settings-update-terminal-quick-commands.test.tssrc/main/runtime/agent-session-create-launch-plan.tssrc/main/runtime/host-launch-prompt-deliveries.tssrc/main/runtime/orca-runtime-agent-session-oversized-prompt.test.tssrc/main/runtime/orca-runtime-create-agent-session.tssrc/main/runtime/orca-runtime-create-terminal-dependencies.tssrc/main/runtime/rpc/methods/terminal/terminal-lifecycle-methods.tssrc/main/runtime/runtime-terminal-contracts.tssrc/main/runtime/terminal-run-facts-input.test.tssrc/preload/api/pty-api.tssrc/preload/api/pty-bridge-session-control.tssrc/renderer/src/components/settings/QuickCommandsPane.tsxsrc/renderer/src/components/tab-bar/TabBarQuickCommandsButton.tsxsrc/renderer/src/components/terminal-pane/TerminalQuickCommandEditorDialog.tsxsrc/renderer/src/components/terminal-pane/use-terminal-pane-startup-actions.tssrc/renderer/src/components/terminal-quick-commands/TerminalQuickCommandDialog.test.tsxsrc/renderer/src/components/terminal-quick-commands/TerminalQuickCommandDialog.tsxsrc/renderer/src/lib/agent-launch-prompt-host-delivery.test.tssrc/renderer/src/lib/agent-launch-prompt-host-delivery.tssrc/renderer/src/lib/launch-agent-in-new-tab-web-runtime.test.tssrc/renderer/src/lib/launch-agent-in-new-tab.tssrc/renderer/src/lib/launch-agent-startup-prompt-plan.tssrc/renderer/src/lib/launch-agent-web-host-tab.tssrc/renderer/src/lib/paired-host-long-prompt-compat.tssrc/renderer/src/lib/terminal-quick-command-host-prompt-limit.test.tssrc/renderer/src/runtime/web-runtime-agent-session-create-params.tssrc/renderer/src/runtime/web-runtime-session-terminal-deferred-prompt.test.tssrc/renderer/src/runtime/web-runtime-session-types.tssrc/renderer/src/runtime/web-runtime-terminal-create-operation.tssrc/renderer/src/runtime/web-runtime-terminal-creation.tssrc/renderer/src/runtime/web-runtime-terminal-identity.tssrc/renderer/src/store/slices/settings-terminal-quick-commands.test.tssrc/renderer/src/store/slices/settings.tssrc/renderer/src/web/preload-api/web-terminal-api.tssrc/shared/agent-session-host-authority.tssrc/shared/rpc-contract/terminal-unary-params.tssrc/shared/runtime-terminal-contracts.tssrc/shared/runtime-terminal-create-contract.tssrc/shared/terminal-quick-commands.ts
💤 Files with no reviewable changes (1)
- src/shared/runtime-terminal-create-contract.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 1 remain after this review.
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: 65f0ebb6-dd6e-40b1-967f-a800dd4332cf
📒 Files selected for processing (17)
src/main/runtime/agent-session-create-launch-plan.tssrc/main/runtime/orca-runtime-agent-session-oversized-prompt.test.tssrc/main/runtime/orca-runtime-create-agent-session.tssrc/main/runtime/runtime-terminal-contracts.tssrc/renderer/src/lib/launch-agent-in-new-tab.tssrc/renderer/src/lib/launch-agent-startup-prompt-plan.tssrc/renderer/src/lib/launch-agent-web-host-tab.tssrc/renderer/src/lib/paired-host-long-prompt-compat.tssrc/renderer/src/runtime/web-runtime-agent-session-create-params.tssrc/renderer/src/runtime/web-runtime-session-terminal-deferred-prompt.test.tssrc/renderer/src/runtime/web-runtime-terminal-creation.tssrc/renderer/src/runtime/web-runtime-terminal-identity.tssrc/shared/agent-launch-command-line-budget.test.tssrc/shared/agent-launch-command-line-budget.tssrc/shared/agent-session-host-authority.tssrc/shared/tui-agent-startup-oversized-prompt.test.tssrc/shared/tui-agent-startup.ts
💤 Files with no reviewable changes (1)
- src/main/runtime/runtime-terminal-contracts.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.
There was a problem hiding this comment.
Actionable comments posted: 1
♻️ Duplicate comments (1)
src/renderer/src/runtime/web-runtime-terminal-creation.ts (1)
56-69: 🩺 Stability & Availability | 🟡 Minor | ⚡ Quick winCatch a rejected client paste so
promptDeliveredresolves tofalse.
deliverLaunchPromptToAgentTabrethrows when the paste rejects.launchAgentInWebHostTabawaitspromptDeliveredand does not catch the error. The user then gets nonotifyPromptNotSentnotice. An auto-submit launch also leaves the rejection unhandled. Add a.catchthat returnsfalse.Proposed fix
- }) + }).catch((error) => { + console.error('Prompt delivery failed after launch', error) + return false + })
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: 4ee1e4ca-3db3-4673-ba9f-77bd903199e2
📒 Files selected for processing (36)
src/cli/handlers/terminal.tssrc/cli/terminal-format.tssrc/main/agent-launch/agent-launch-executor.test.tssrc/main/agent-launch/agent-launch-executor.tssrc/main/agent-launch/agent-launch-prompt-delivery.tssrc/main/agent-launch/agent-launch-surface-factories.tssrc/main/ipc/pty/ipc/write-launch-prompt.test.tssrc/main/ipc/pty/ipc/write.tssrc/main/runtime/host-launch-prompt-deliveries.tssrc/main/runtime/launch-prompt-startup-dialog-transcript.test.tssrc/main/runtime/orca-runtime-agent-session-oversized-prompt.test.tssrc/main/runtime/orca-runtime-create-agent-session.tssrc/main/runtime/rpc/methods/agent-launch-surfaces-terminal-prompt.test.tssrc/main/runtime/rpc/methods/agent-launch-surfaces.tssrc/main/runtime/rpc/methods/agent-launch-terminal-prompt.tssrc/main/runtime/rpc/methods/terminal/terminal-lifecycle-methods.tssrc/preload/api/pty-api.tssrc/preload/api/pty-bridge-session-control.tssrc/renderer/src/lib/launch-agent-in-new-tab-web-runtime.test.tssrc/renderer/src/lib/launch-agent-in-new-tab.tssrc/renderer/src/lib/launch-agent-web-host-tab.tssrc/renderer/src/lib/paired-host-long-prompt-compat.tssrc/renderer/src/runtime/web-runtime-agent-session-create-params.tssrc/renderer/src/runtime/web-runtime-session-terminal-deferred-prompt.test.tssrc/renderer/src/runtime/web-runtime-session-terminal-host-authority.test.tssrc/renderer/src/runtime/web-runtime-session-types.tssrc/renderer/src/runtime/web-runtime-terminal-create-operation.tssrc/renderer/src/runtime/web-runtime-terminal-creation.tssrc/renderer/src/runtime/web-runtime-terminal-identity.tssrc/shared/agent-launch-command-line-budget.tssrc/shared/agent-launch-intent.tssrc/shared/agent-session-host-authority.tssrc/shared/host-launch-prompt-budget.tssrc/shared/runtime-terminal-contracts.tssrc/shared/runtime-types.tssrc/shared/terminal-quick-command-capabilities.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 2 remain after this review.
Review status: ready for a final look. Not merged; merging is Brennan's call.The problem. Agent quick-command prompts were silently cut to 6,000 characters on save. A 7,008-character review prompt reopened ending mid-sentence ("…and the fixer"), with no warning. The 6,000 was a Windows launch speed threshold that had been read as a hard limit. What changes for you.
How the review went. Four review rounds, plus an architecture challenge in round 1 and again after each redesign. The first version's save fix was right, but its launch half was in the wrong place, so it was largely rebuilt:
Deferred (each listed as temporary in the PR body, with its follow-up):
Verified
Not verified
CI. |
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes — re-reviewed the delta since the prior pullfrog review (ce5c0707), which is seven authored commits (the served incremental only covered the final push, so this covers the whole unreviewed span) that move the delivery of a launch prompt the host command line cannot carry onto the host, plus the quick-command cap change.
- Host-owned deferral:
agent-session-create-launch-plan.tsnow plans everyterminal.createAgentSessionwith deferral;orca-runtime-create-agent-session.tsstarts the write itself and replieslaunchPrompt: { outcome: 'pending' }. ThedeferOversizedPromptrequest field and its schema entry are gone. - Per-runtime record:
host-launch-prompt-deliveries.tskeys one delivery per terminal handle on the runtime that writes it, deduping retried and reclaimed creates. - Observation, not a second send: clients read the outcome through
terminal.wait { for: 'launch-prompt' }; theterminal.send { launchPrompt: true }path (terminal-launch-prompt-send.ts) is deleted. - Startup dialogs and exited panes:
waitForLaunchComposerre-arms through a dialog up to a 5-minute deadline and refuses to paste into a terminal that exited. - Paired older hosts:
paired-host-long-prompt-compat.tsmakes the client paste a long prompt after ready when the host lacksterminal.quick-commands.long-prompts.v1, and the legacy create route runs a clean launch. - Local desktop:
pty:deliverAgentLaunchPromptshares the host record and deadline and now returns the disposal. - Cap:
MAX_QUICK_COMMAND_AGENT_PROMPT_LENGTHis 40,000 (down from the branch's 100,000) so a saved prompt fits the tightest path, and a refused save keeps the dialog open. - Types:
LaunchPromptWritingRuntimenames the registry owner; the ledger test reads through a typed subclass instead ofReflect.get.
Both prior inline threads (mixed-version paired launch; aggregate budget invisible to the editor) are addressed and were resolved.
deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏
… message carries Agent quick-command prompts were silently cut to 6,000 characters on save: the editor accepted a long paste, settings normalization trimmed it, and reopening showed the shortened copy. The 6,000 was a Windows launch speed threshold, not a limit on prompts. - Storage no longer trims. A save is refused, never trimmed, when a prompt's chat text block is over 256 KiB of JSON (measured on its real escaped size, the measure the chat send schema applies) or the list is too large for one paired reply. Host and desktop store both check before writing. - The editor shows the size against the limit and blocks Save past it, and stays open with the text when the host refuses the save. - terminal.quick-commands.long-prompts.v1: hosts withhold prompts over 6,000 characters from clients that do not advertise it (older clients reject a whole list holding one); editors keep an older host's 6,000 cap. - The phone editor no longer drops pasted text past 6,000 via maxLength. Launch delivery of long prompts is left to the launch-prompt series (#24257, #23962, #24080); this branch's earlier paste-after-ready delivery duplicated it and is removed.
f98b149 to
602d1a7
Compare
|
Reworked; the review status above is out of date. This PR is now only the storage fix: quick-command prompts save whole, bounded by what one chat message carries (256 KB, measured on the prompt's actual size) instead of a fixed 6,000 or 40,000 characters. The launch-delivery code this branch had grown (pasting a prompt too long for the command line once the agent is ready) duplicated the launch-prompt series and is removed. #24080 already covers quick commands: the prompt rides the command line, or a launch file when the line can't carry it. Merge order: after #24080. The previous head was |
There was a problem hiding this comment.
ℹ️ No critical issues — one trivial nit below.
Reviewed changes — re-reviewed the delta since the prior pullfrog review (f98b1491): the branch was rebased onto main and squashed, dropping its own launch-prompt delivery and re-scoping the save bound.
- Launch delivery removed: the host-owned deferral, paired-host paste-after-ready,
PendingLaunchPromptoutcome, and command-line budget are gone; those files are back tomain. A long saved prompt now launches through the existing path, which the PR documents as merge-order-after-#24080. - Byte-based storage bound:
normalizeTerminalQuickCommandsno longer trims agent prompts;assertTerminalQuickCommandsStorablerefuses a prompt whose single-text-block JSON exceeds 256 KiB, or a list over 4 MiB − 128 KiB, at both the host settings update and the desktop store. - Capability + withholding:
terminal.quick-commands.long-prompts.v1is advertised by the host and every remote client;projectTerminalQuickCommandsForClientomits over-6,000-char prompts from clients that do not advertise it, on reads and update replies. - Editors: the desktop dialog and mobile form show a KB/character count near the limit, refuse instead of trimming, and await
onSaveso a host refusal keeps the text. - Search: long prompt bodies are normalized once via a
WeakMap, not per keystroke.
The two prior inline threads (mixed-version paired launch, aggregate-budget visibility) are moot or resolved — the launch path they discussed was removed, and saveDraft now awaits onSave.
ℹ️ Nitpicks
mobile/src/session/QuickCommandEditorForm.tsx:26— duplicate doc comment:/** The host's agent-prompt cap. */immediately precedes the accurate/** An older host's agent-prompt character cap; null means none. */. Drop the first.
deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏
…k-command-paste # Conflicts: # src/renderer/src/web/web-runtime-connection-frame-router.ts
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes — re-reviewed the delta since the prior pullfrog review (602d1a7): two authored commits on top of a merge of main at a154562.
- Desktop own-host capability parity:
DESKTOP_RENDERER_RUNTIME_CLIENT_CAPABILITIESnow advertisesterminal.quick-commands.long-prompts.v1, so the desktop renderer's own main process does not withhold over-6,000-character prompts from it. This also restores the invariant pinned bydesktop-renderer-runtime-capabilities.test.ts, which the capability's addition to the shared remote base set had broken (it was inmissingFrom(PAIRED_HOST_RECEIVES, DESKTOP…)without a recorded decision). - Merge of
main: main had moved the browser capability list intoweb-runtime-client-capabilities.ts; the merge resolution re-added the long-prompts capability there, withweb-runtime-client.test.tsupdated to match. - Prior nit removed: dropped the stale
/** The host's agent-prompt cap. */duplicate aboveagentPromptMaxLength.
I confirmed the capability reaches every client path that reads quick commands: the paired-host proxy wraps the bare Electron list via remoteRuntimeClientCapabilities in remote-runtime-request-socket.ts:67 and remote-runtime-request-connection.ts:240, web and desktop-own-host now list it explicitly, and mobile/CLI inherit it from the shared base.
deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏
…k-command-paste # Conflicts: # src/cli/runtime/websocket-transport.test.ts # src/main/ipc/desktop-renderer-runtime-capabilities.ts # src/main/runtime/rpc/methods/client-ui.ts # src/main/runtime/rpc/ws-transport.ts # src/shared/protocol-version.ts # src/shared/remote-runtime-client-capabilities.ts
|
Saving and reopening a 7,008-character agent quick command used to keep only its first 6,000 characters because storage reused a launch threshold. This PR preserves the whole prompt, or visibly refuses a save that exceeds the existing message and reply budgets. Launch delivery stays outside this PR. Four review rounds corrected pending-save editing and dismissal, dropdown keyboard handling, and a credential-retention ordering bug. A rejected settings batch could discard recoverable encrypted credentials before validation finished; commit The 11 remaining review threads were resolved: nine concerned delivery changes absent from the final diff, one is fixed by the credential correction, and the unexpected save-callback rejection remains a deferred concern after tracing production error handling without finding a concrete failing input. A reconnect during saving can leave the editor open without feedback; that source-only observation is deferred. The settings handler's existing theme side effect remains outside this narrow fix; this does not make the whole settings API transactional. Not ready to merge. CI is running for current head Terminal commands retain their 4,000-character bound; visible refusal replaces silent trimming intentionally. Older-client filtering and older-host limits are temporary compatibility behavior. The reopening flash was not reproduced and is not claimed fixed. No merge or auto-merge was performed. |

ELI5
A 7,008-character prompt pasted into an agent quick command looked intact, but saving and reopening kept only its first 6,000 characters. Quick-command storage now preserves the whole prompt and visibly refuses a save it cannot store.
What Changed
Agent prompts save and reopen whole on desktop, phone, and current paired hosts. Settings normalization no longer slices them, and the phone field no longer cuts off pasted prompt text. The existing trailing-whitespace normalization remains.
A prompt is bounded by what one chat message carries: 256 KiB of JSON-escaped text blocks, measured on its actual bytes. The complete saved list must also fit one paired reply. The host and desktop store check before writing; oversized drafts stay intact with Save disabled and an explanation. Terminal commands retain their existing 4,000-character storage bound, but desktop now refuses an oversized command instead of silently saving a trimmed copy.
While a desktop save is pending, editing, Save, Cancel, Escape, and outside dismissal are disabled. Success closes the editor; refusal restores the intact draft so it can be edited or cancelled. This prevents a delayed save from discarding newer edits or closing an editor reopened before the earlier save finished.
Current hosts withhold prompts over 6,000 characters from older clients that would reject the entire list. Older clients can still change their visible commands without deleting the hidden long prompts. An editor connected to an older host shows that host’s 6,000-character bound and update instruction.
Why
The old 6,000-character prompt cap came from a Windows launch threshold, which chooses how a command is delivered rather than what can be saved. A silent storage slice loses user text. Measuring the actual message bytes preserves ordinary prompts while respecting existing transport bounds; refusing a save keeps the original draft available.
The editor now treats submission as one immutable form operation, using the common pattern. Keyboard events consumed by a selector or originating in its popup do not also submit the form. It avoids tracking a second draft version solely to decide which later edits a callback may close.
Linked Issue
Reported directly by the maintainer; no separate issue.
Visual Proof
Earlier branch evidence: paste a 6,984-character prompt ending
FINAL LINE - if you can read this, nothing was cut., save, reopen, and scroll to the end.These screenshots predate the review fixes. They show the storage result, not current-head pending-save behavior. Current-head remote comparison remains incomplete. Windows setup and native dependencies now build successfully, but repeated resource checks refused app launch. The Codex driver checkpointed this QA attempt as blocked. No fresh screenshots are claimed.
Testing
0e301f0bfaee2c6f687987d227336a977839066f.b2e62b901c5ac55fc4630de9b54b34b6ecb30b3d: lint, typecheck, all five test shards, relay and cross-version contracts, packaging, selected end-to-end checks, test-selection evidence, and the final aggregate job. Other current-head checks passed or were skipped by their workflow conditions.The earlier branch reported broader desktop/mobile suites and scoped static checks passing. Those runs are historical evidence, not a current-head validation claim.
AI Disclosure
Review
Four review rounds and independent architecture decisions corrected pending-save ownership, dropdown interaction, and credential-retention ordering. Refusing an oversized settings batch now leaves retained encrypted credentials intact. Nine obsolete delivery threads were resolved; the unexpected save-callback rejection was deferred after a bounded production trace found no concrete failing input. CI is running on current head
0e301f0bfaee2c6f687987d227336a977839066f. Required remote Electron QA and fresh screenshots remain incomplete, so this PR is not ready to merge.Agent skill upstream boundary
Notes
This PR changes storage only. Launch delivery remains out of scope. The launch work in #24257 and #23962 merged; #24080 and #24081 were closed by the maintainer, so there is no merge-order dependency on them.
Windows has a known existing launch limitation: it still carries the prompt on the launch line, and commands above 6,000 characters use the existing stdin delivery path. Agent launch already accepts unbounded prompts from every entry point. The roughly 7,000-character multiline launch remains unverified. Windows dependency setup and the native build now succeed. The Codex driver completed an independent source check and checkpointed its rendered QA attempt as blocked. Both Windows hosts repeatedly remained below the required 30% free memory; the M4Air load exceeded 260. No test renderer or fresh screenshot exists yet. A launch failure, once verified, is to be reported without expanding this storage PR into delivery work.
The report that the dialog flashes on reopening has not been reproduced and is not claimed fixed. The existing whitespace normalization, transport-derived refusal, terminal-command refusal, and pending-form behavior are intended differences. Withholding incompatible rows from older clients and showing older-host limits are temporary compatibility behavior until supported releases update.
Checklist