13670 Commits

Author SHA1 Message Date
Val Alexander
b703ea3675
fix: prevent compaction "prompt too long" errors (#22921)
* includes: prompt overhead in compaction safeguard calculation.

Subtracts SUMMARIZATION_OVERHEAD_TOKENS from maxChunkTokens in both the main summarization path and the dropped-messages summarization path.

This ensures the chunk budget leaves room for the prompt overhead that generateSummary wraps around each chunk.

* adds: budget for overhead tokens to use an effectiveMax instead of maxTokens naïvely.

- Added `SUMMARIZATION_OVERHEAD_TOKENS = 4096` — a budget for the tokens that `generateSummary` adds on top of the serialized conversation (system prompt, `<conversation>` tags, summarization instructions, `<previous-summary>` block, and reasoning: "high" thinking budget).
- `chunkMessagesByMaxTokens` now divides `maxTokens` by `SAFETY_MARGIN` (1.2) before comparing against estimated token counts. Previously, the safety margin was only used in `computeAdaptiveChunkRatio` and `isOversizedForSummary` but not in the actual chunking loop — so chunks could be built that fit the estimated budget but exceeded the real budget once the API tokenized them properly.
2026-02-21 14:42:18 -06:00
kumarabhirup
db4c90b37d
Merge remote-tracking branch 'origin/markrachapoom/design' into kumareth/workspaces
Co-authored-by: Cursor <cursoragent@cursor.com>

# Conflicts:
#	apps/web/app/api/chat/subagent-stream/route.ts
#	apps/web/app/api/workspace/watch/route.ts
#	apps/web/app/components/chat-panel.tsx
#	apps/web/app/components/subagent-panel.tsx
#	apps/web/lib/subagent-runs.ts
#	apps/web/tsconfig.tsbuildinfo
2026-02-21 12:40:07 -08:00
kumarabhirup
536ae59667
web: add interactive messaging UI to subagent panel
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-21 12:32:59 -08:00
kumarabhirup
7cdcf61639
web: support subagent sessions in chat and stop API routes 2026-02-21 12:32:37 -08:00
kumarabhirup
54d048bfb9
web: merge subagent-stream into unified stream route 2026-02-21 12:32:32 -08:00
kumarabhirup
e267fe7df4
web: export stream parser and add user-message event type 2026-02-21 12:32:27 -08:00
kumarabhirup
7d762b2b75
web: refactor subagent-runs to use direct gateway subscription with interactive messaging 2026-02-21 12:32:21 -08:00
kumarabhirup
3ee2528b75
web: filter silent-reply tokens and remove subagent event routing from parent stream 2026-02-21 12:32:16 -08:00
kumarabhirup
f3ae8127da
web: filter leaked NO_REPLY tokens in chat message display 2026-02-21 12:32:10 -08:00
Onur Solmaz
ac633366ce
docs: add Onur Solmaz to contributors (#22890) 2026-02-21 21:00:26 +01:00
Peter Steinberger
518dbbf4c6 test: avoid template-literal temp path in runner fixture 2026-02-21 20:49:38 +01:00
Peter Steinberger
302fa03f41 fix(test): skip test-utils files in temp path guard 2026-02-21 20:48:52 +01:00
Peter Steinberger
48ddb1cc81 fix(ci): stabilize install smoke in docker 2026-02-21 20:39:34 +01:00
Peter Steinberger
549549f6a0 fix(ci): sync plugin versions and harden install smoke 2026-02-21 20:18:37 +01:00
Peter Steinberger
a20c773251 test(media): dedupe auto-e2e temp/env setup and cover no-binary path 2026-02-21 19:17:01 +00:00
Peter Steinberger
b889a5d516 test(cli): dedupe temp dirs in camera tests and cover non-ok url responses 2026-02-21 19:17:01 +00:00
Peter Steinberger
0ecb07e6d1 test(cli): dedupe acp secret file setup and cover password flag collisions 2026-02-21 19:17:01 +00:00
Peter Steinberger
4f835c4c0d test(media): dedupe temp roots and cover directory attachment rejection 2026-02-21 19:17:01 +00:00
Peter Steinberger
9ebfc99c1b refactor(test): dedupe temp media fixture setup in apply e2e 2026-02-21 19:17:01 +00:00
Peter Steinberger
0a207b9860 refactor(test): share temp workspace helper in compact skill path tests 2026-02-21 19:16:22 +00:00
Peter Steinberger
324922f804 refactor(test): dedupe temp dir lifecycle in agents skills directory e2e 2026-02-21 19:16:22 +00:00
Peter Steinberger
b3c7fd6c69 refactor(test): dedupe temp dirs and skill writer in snapshot e2e 2026-02-21 19:16:22 +00:00
Peter Steinberger
85c768d3d2 refactor(test): dedupe temp workspace setup in skills load entries e2e 2026-02-21 19:16:22 +00:00
Peter Steinberger
0401762144 refactor(test): dedupe temp root setup in identity avatar e2e 2026-02-21 19:16:22 +00:00
Peter Steinberger
9ead79937e refactor(test): dedupe temp session path setup in file repair e2e 2026-02-21 19:16:22 +00:00
Peter Steinberger
70fdab6e95 test(agents): add coverage for shared skill writer helper 2026-02-21 19:16:21 +00:00
Peter Steinberger
0876fbde19 refactor(test): reuse shared skill writer in skills e2e 2026-02-21 19:16:21 +00:00
Peter Steinberger
f086245afe refactor(test): reuse shared skill writer in sandbox and bundled tests 2026-02-21 19:16:21 +00:00
Peter Steinberger
96ef00ec38 refactor(test): drop redundant env snapshots in skill download suites 2026-02-21 19:16:21 +00:00
Peter Steinberger
603e28648b refactor(test): centralize temp workspace env handling for skill install tests 2026-02-21 19:16:21 +00:00
Peter Steinberger
61817c90e7 refactor(test): share temp workspace helper for skill download suites 2026-02-21 19:16:21 +00:00
Peter Steinberger
a814cce359 refactor(test): share temp command dir helper in shell utils e2e 2026-02-21 19:16:21 +00:00
Peter Steinberger
c240104dc3 refactor(test): snapshot gateway auth env in security audit tests 2026-02-21 19:16:21 +00:00
Peter Steinberger
e5aa04d432 refactor(test): snapshot daemon cli env in coverage e2e 2026-02-21 19:16:21 +00:00
Peter Steinberger
3fd7dc5046 refactor(test): snapshot shell/path env in bash tools e2e 2026-02-21 19:16:21 +00:00
Peter Steinberger
272bf2d8bc refactor(test): dedupe env override assertions in skills e2e 2026-02-21 19:16:21 +00:00
Peter Steinberger
d982893490 refactor(test): use env helper for web auto-reply timezone test 2026-02-21 19:13:47 +00:00
Peter Steinberger
7ba09e414f refactor(test): snapshot env in shell utils e2e 2026-02-21 19:13:47 +00:00
Peter Steinberger
c3e1c82871 refactor(test): snapshot bundled hooks env in loader tests 2026-02-21 19:13:47 +00:00
Peter Steinberger
5e607ae1eb refactor(test): snapshot deprecated auth profile env in e2e 2026-02-21 19:13:47 +00:00
Peter Steinberger
5dc1b5a8db refactor(test): reuse env helper in workspace skill sync gating 2026-02-21 19:13:47 +00:00
Peter Steinberger
c0706b7799 refactor(test): reuse env helper in workspace skill status tests 2026-02-21 19:13:47 +00:00
Peter Steinberger
cf371fde6d refactor(test): use env helper in workspace skills prompt gating 2026-02-21 19:13:47 +00:00
Peter Steinberger
8745964142 refactor(test): snapshot PATH env in bash tools exec path e2e 2026-02-21 19:13:47 +00:00
Peter Steinberger
af66e3103a test(agents): cover bundled skills env override and dedupe setup 2026-02-21 19:13:47 +00:00
Peter Steinberger
ae06dbb794 refactor(test): snapshot tar.bz2 skills install env 2026-02-21 19:13:47 +00:00
Peter Steinberger
b44aa5b1f7 refactor(test): snapshot skills install state dir env 2026-02-21 19:13:47 +00:00
Peter Steinberger
884166c7af refactor(test): snapshot telegram action env in e2e suite 2026-02-21 19:13:47 +00:00
Peter Steinberger
1fd88af219 test(commands): stabilize message e2e env and gateway mock 2026-02-21 19:13:47 +00:00
Peter Steinberger
1b585b2959 refactor(test): snapshot tailscale test env per case 2026-02-21 19:13:47 +00:00