Skip to content

NEXT: remove draft and unsent prompt size caps - #33145

Merged
teamleaderleo merged 4 commits into
feat-cmux-nextfrom
lane/limits-t1-drafts
Nov 3, 2026
Merged

teamleaderleo merged 4 commits into
feat-cmux-nextfrom
lane/limits-t1-drafts

Conversation

@teamleaderleo

@teamleaderleo teamleaderleo commented Nov 3, 2026 •

Copy link
Copy Markdown
Collaborator

“why are there prompt limits anyways?”
“well we ought to audit the limits and make sure 1. don't have nonsense 2. do some super sweet ergo perf stuff”

This is the first draft-path change in the limits audit.

This PR removes user-facing draft and unsent-prompt size/count caps across the draft path:

  • cmux-tui/crates/acpmux/src/hub/mod.rs:1965: removes the 1,000,000-character durable composer draft refusal.
  • cmux-tui/crates/acpmux/src/hub/composers.rs:138: removes the 100,000-character surface draft refusal and 16-surface eviction; every surface draft remains available.
  • cmux-tui/crates/cmux-tui-core/src/conversation_drafts.rs:53: removes the 16 KiB delta and 64 KiB fresh-text refusal; draft publication remains rate-limited. The matching 64 KiB catalog field restriction at cmux-tui/spec/resource-operations-v2.json:18563 is also removed, with SDK catalog descriptors regenerated.
  • Packages/macOS/CmuxNext/Sources/CmuxNextAgentPane/AgentPanePromptJournal.swift:119: removes the 8 MiB / 64-entry journal cap so restart recovery keeps large prompts and bursts.
  • Packages/macOS/CmuxNext/Sources/CmuxNextAgentPane/AgentUnsentDrafts.swift:96: removes the 1,000,000-character unsent-draft cap.
  • webviews/src/agent-session/acpmux/composerDraft.ts:50: removes MAX_DRAFT_CHARS; large saved and typed drafts merge and write whole.

The existing surface-id validation, in-memory turn retention, and live draft-event rate limit remain operational bounds. Journal replay retains its existing 24-hour age policy.

Remaining work: draft values still travel inline through the existing 31–32 MiB RPC envelope, journal and draft-map writes still encode whole documents, and per-surface drafts remain memory-only. This PR removes the listed caps; it does not yet fulfill arbitrary-size blob-backed persistence. That remaining work is tracked in #33167 (owned by this PR's author).

Validation at 124183c144e951f2bd870ac8d5b70f77d7a7e6ec:

  • Rust/core and catalog checks: passed; 12 acpmux draft tests and the core publication test, including 3 MiB payloads and 20 surfaces. Submodules initialized.
  • Web tests and lint/type checks: passed; 28 composer ordering cases, including 3 MiB merges and clearing after send.
  • Fleet compile for CmuxNext: passed (receipt 4b343a88f04f07a175e6a86e).
  • Base-red attribution passed for clippy (base run) and release-notary (base run). The advisory gallery comment failed with a GitHub API rate limit after capture passed.
  • Targeted gallery base replay at CI base 960d3eb56b495b6b8d3d25256d2bf6b682fb10c0 reproduced all remaining named gallery failures: changes-git-actions#include-new and #keyboard layout shift (0.0570 versus 0.02985 baseline), and viewer-empty.path-picker#rtl menu-label alignment (surface-007, 1.1 px). This run intentionally tested the base; its failure is attribution evidence, not a passing head test.
  • Added Swift regression tests cover 9 MiB journal prompts with 66 entries and 2 MiB unsent restoration; these tests have not been executed separately.

🤖 Generated with Codex

Agent session: agent session

Co-authored-by: Codex <199175422+chatgpt-codex-connector[bot]@users.noreply.github.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-8436bc3dafead47b3ea8
@github-actions

github-actions Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

cmux status (one comment, edited in place; each line is updated by the job that owns it)

Review 124183c: HQ feed card · gallery before/after runs · checks

App of this head (app.zip, kept 1 day)

gh workflow run reload-build.yml -R manaflow-ai/cmux --ref feat-cmux-next -f tag=pr33145 -f ref=lane/limits-t1-drafts -f platform=macos -f backend_mode=local

Stale: these images are of a8fb438; the head is now 124183c and a new capture is running.

Gallery before/after for a8fb438: 16 states rendered, 0 images differ, 3097 more touched states not rendered. Images are in the run's artifact, not on this public PR; the independent review of this head reads them on its own, so the PR needs no hand-made screenshots of these states.

gh run download 41608280328 -R manaflow-ai/cmux -n gallery-advisory-33145-a8fb4387e1929d31f8cdaf4ff3409db279ec12d5 (then read gallery-review.json)

States
State Theme Status Diff Picked by
agent-pane.composer/font-size-chat-14 Apple System Colors Light unchanged 0% own Composer.tsx
agent-pane.composer/font-size-chat-14 Apple System Colors unchanged 0% own Composer.tsx
agent-pane.composer/font-size-new-chat-14 Apple System Colors Light unchanged 0% own Composer.tsx
agent-pane.composer/font-size-new-chat-14 Apple System Colors unchanged 0% own Composer.tsx
agent-pane.composer/font-size-new-tab-14 Apple System Colors Light unchanged 0% own Composer.tsx
agent-pane.composer/font-size-new-tab-14 Apple System Colors unchanged 0% own Composer.tsx
agent-pane.composer/font-size-chat-21 Apple System Colors Light unchanged 0% own Composer.tsx
agent-pane.composer/font-size-chat-21 Apple System Colors unchanged 0% own Composer.tsx
agent-pane.composer/font-size-new-chat-21 Apple System Colors Light unchanged 0% own Composer.tsx
agent-pane.composer/font-size-new-chat-21 Apple System Colors unchanged 0% own Composer.tsx
agent-pane.composer/font-size-new-tab-21 Apple System Colors Light unchanged 0% own Composer.tsx
agent-pane.composer/font-size-new-tab-21 Apple System Colors unchanged 0% own Composer.tsx
agent-pane.composer/font-size-chat-28 Apple System Colors Light unchanged 0% own Composer.tsx
agent-pane.composer/font-size-chat-28 Apple System Colors unchanged 0% own Composer.tsx
agent-pane.composer/font-size-new-chat-28 Apple System Colors Light unchanged 0% own Composer.tsx
agent-pane.composer/font-size-new-chat-28 Apple System Colors unchanged 0% own Composer.tsx
agent-pane.composer-quote-persistence/ready Apple System Colors Light unchanged 0% own Composer.tsx
agent-pane.composer-quote-persistence/ready Apple System Colors unchanged 0% own Composer.tsx
agent-pane.composer-row/claude-auto Apple System Colors Light unchanged 0% own Composer.tsx
agent-pane.composer-row/claude-auto Apple System Colors unchanged 0% own Composer.tsx
agent-pane.composer-row/grid-running Apple System Colors Light unchanged 0% own Composer.tsx
agent-pane.composer-row/grid-running Apple System Colors unchanged 0% own Composer.tsx
agent-pane.composer-row/grid-draft Apple System Colors Light unchanged 0% own Composer.tsx
agent-pane.composer-row/grid-draft Apple System Colors unchanged 0% own Composer.tsx
agent-pane.composer-row/grid-draft-lines Apple System Colors Light unchanged 0% own Composer.tsx
agent-pane.composer-row/grid-draft-lines Apple System Colors unchanged 0% own Composer.tsx
agent-pane.composer-row/long-model Apple System Colors Light unchanged 0% own Composer.tsx
agent-pane.composer-row/long-model Apple System Colors unchanged 0% own Composer.tsx
agent-pane.composer-row/leo-report Apple System Colors Light unchanged 0% own Composer.tsx
agent-pane.composer-row/leo-report Apple System Colors unchanged 0% own Composer.tsx
agent-pane.composer-row/granted Apple System Colors Light unchanged 0% own Composer.tsx
agent-pane.composer-row/granted Apple System Colors unchanged 0% own Composer.tsx

Pick other states with a Gallery: entry.id, entry.id/variant line in the PR body.

Passes: CI passes on 124183c144.

CI passes on 124183c144 (run 41609679148 attempt 1).

Written by scripts/ci/classify_failures.py (ci-failure-attribution.yml); signatures are its SIGNATURES table. A machine verdict is the runner's fault, not this PR's; yours means the failing file is one this PR changes, also red on main that main's latest full suite fails the same way, seen on other PRs that it failed on another pull request's run lately.

web and size checks: green

Shipped in:

@blacksmith-sh

blacksmith-sh Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Found 1 test failure on Blacksmith runners:

Failure

Test View Logs
nightly preparation must run on Blacksmith Linux, keep its fallback, and reuse a succes
sful artifact/
nightly preparation must run on Blacksmith Linux, keep its fallback, and reuse a succes
sful artifact
View Logs

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

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Review (codex gpt-6-astra high, sweep, via the review router; full diff from merge base c39fe21 to this head): BLOCK at 3107ad7

No P1/P2 findings.

Co-authored-by: Codex <199175422+chatgpt-codex-connector[bot]@users.noreply.github.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-8436bc3dafead47b3ea8
Co-authored-by: Codex <199175422+chatgpt-codex-connector[bot]@users.noreply.github.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-8436bc3dafead47b3ea8
Co-authored-by: Codex <199175422+chatgpt-codex-connector[bot]@users.noreply.github.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-8436bc3dafead47b3ea8
@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

For the lane, this is the gallery health result from run 41609678735, which its host couldn't read. Shards 0 and 1 (jobs 125828512636 and 125828512702) give the same final line:

own red: 1 red state(s) render or are red another way on base 960d3eb56b49: pages.settings#font-picker: breaks menu-fit:div[aria-label="Font Family"]

So the only red these two shards name is the Settings font picker's menu-fit, and it isn't red on base. Check whether this PR touches the picker's menu sizing, for example a removed max-height or length cap on that list. If it does, fix it here. If not, rerun those two shards once to rule out a flake before calling it a base red.

@teamleaderleo
teamleaderleo merged commit 5360c04 into feat-cmux-next Nov 3, 2026
288 of 299 checks passed
@teamleaderleo
teamleaderleo deleted the lane/limits-t1-drafts branch November 3, 2026 10:59
@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Review (claude opus-5.5 subagent, medium): SHIP at 124183c

Visual verdict: no UI in this diff. The Composer.tsx change removes the over-limit merge path, and the last gallery capture (a8fb438, whose webview code matches this head) rendered 16 states with 0 images differing.

What I checked: the full diff from c39fe21. Every draft cap is gone end to end, and no other layer on the same path refuses or truncates the text. That covers acpmux draft_set/composer_set (no char cap, no 16-surface eviction), cmux-tui-core agent drafts (16/64 KiB), web MAX_DRAFT_CHARS/draftFits/keptOverLimit, the journal's JOURNAL_PARAMS_BYTES, and Swift's 1M-char draft cap and 8 MiB / 64-entry journal cap. A prompt past the old journal cap is now kept across a restart, so the data-loss case is fixed. The Swift changes only delete code and comments. Saves stay off the main thread: drafts encode and write on the state file's queue, and journal records come from the relay. Each layer has a 2–9 MiB test or a test past the old count (66 journal entries, 20 surfaces), and they pass at this head. The webview verdict web / react-apps-base-check (1–8) is finished and green at this head.

None of the reds at this head belong to this PR:

  • gallery health shards 0–5: font-picker menu-fit, changes-git-actions layout-shift, path-picker#rtl. None of these imports a changed file.
  • clippy: the panic ratchet hits are in acpmux/cmux-host files this diff doesn't touch. This diff only deletes acpmux code.
  • cmux-next swift test: the same 8 suites fail on run 41611175730 for perf/newtab-palette-model. The draft and journal tests pass, and none of the failures is a crash.

Follow-ups:

  • [follow-up] 31 MiB RPC envelope (Drafts: finish blob-backed transfer and durable surface storage #33167): one _acpmux/draft_set larger than one message (about 31 MiB of text) is refused, and acpmux keeps its older draft. The editor keeps the text, and the write stays queued and is retried on every flush. No error is shown, and the localStorage cache can't hold that much either, so after a restart the chat shows acpmux's older draft. That is silent loss of the newer text. A user can only reach it with a paste of about 31 MiB or more. It is not a regression: before this PR the same thing happened above 1M chars. It needs a chunked or blob write, or at least a visible error.
  • [follow-up] _acpmux/composers returns every surface's text in one reply. With no per-surface cap, a chat's combined surface drafts can now pass 31 MiB, and then the whole view comes back as a message.too_large error. That is a clear error, not loss. Page the view or leave the text out of it.
  • [follow-up] set_composer_draft makes a synchronous durable write (write_atomic plus a folder sync) of the whole session.json on a tokio worker. Every unrelated metadata commit (unread, title, bookmarks) rewrites the draft too, and s.meta() clones it. With multi-MiB drafts that stalls a worker for each settled edit. Keep the draft in its own file, written through spawn_blocking.
  • [follow-up] Every journal record rewrites the whole journal file, which no longer has a count cap. The 24-hour age limit and removal on acceptance bound it, but a burst of large pending prompts costs O(total) per record.

austinywang added a commit that referenced this pull request Nov 4, 2026
The send-path cap guard (#33145) now covers backend/apps/api/src and
flags the App Store registry limits: MAX_FILES and MAX_DECODED_BYTES
for one app bundle, MAX_SUBMIT_BODY and MAX_DECIDE_BODY for the submit
and review bodies. These bound app packages a reviewer reads, not a
message, prompt or attachment send, so they get safe: entries.
tests/test_send_path_caps.py passes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
teamleaderleo added a commit that referenced this pull request Nov 5, 2026
The base removed the journal's size and entry caps (#33145) and the
byDaemon close (#32389, #36333): record drops its too-large branch and
trim, and the two write-race tests use a forget on another thread.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-a57dc6a4e0ad73610b3a

This branch was previously deployed

3 inactive deployments
artifacts — 124183c1 Deployed Nov 3, 2026 by teamleaderleo via publish tree-addressed cmux-tui #105163
sentry-dsyms — 124183c1 Deployed Nov 3, 2026 by teamleaderleo via upload cmux-tui dSYMs to Sentry #105163
ci-routing-agent — 124183c1 Deployed Nov 3, 2026 by teamleaderleo via cmux-tui tree preflight #105163
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk:normal Risk tier (docs/ci/risk-tiers.md)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant