Skip to content

Let Drive finish long turns: steer, stop, and keep context cheap - #4

Merged
ishu86 merged 4 commits into
mainfrom
feat/oss-drive-loop
Aug 26, 2026
Merged

Let Drive finish long turns: steer, stop, and keep context cheap#4
ishu86 merged 4 commits into
mainfrom
feat/oss-drive-loop

Conversation

@ishu86

@ishu86 ishu86 commented Aug 26, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Mid-turn messages go to /api/chat/steer and land at the next round; leftovers persist if the turn ends. STOP / disconnect aborts the in-flight model stream, not just tools.
  • Turns may run up to 200 rounds, with CASE_TURN_TOKENS (default 2M) as the spend ceiling. OpenAI requests use prompt_cache_key per thread.
  • Context diet: exec output spools to /tmp and history keeps a pointer; unchanged snapshots/screenshots are elided; long clips keep head and tail. Screenshots persist under ~/.case/drive/shots (Compose: CASE_HOME=/data on the ui-data volume).
  • Static pages are a whitelist (/, /index.html, /deploy). Provider rounds retry on 429/529.

Stacked on #3. Merge that first, then retarget this PR to main.

Test plan

  • node web/web-ui/test_serve.mjs
  • Type a message while a turn is running — it injects without a 409
  • STOP mid-stream frees the thread; a follow-up send does not say the thread is still running
  • A noisy computer_exec shows a head + full_output path, not the whole log
  • /serve.mjs and /threads.json 404; / and /deploy still load
  • Compose UI writes shots next to threads.json on ui-data

Made with Cursor

A mid-turn message injects at the next round, STOP aborts the model
stream, and screenshots/exec output stay as disk pointers so 200-round
turns do not balloon the prefix cache.

Co-authored-by: Cursor <cursoragent@cursor.com>
ishu86 and others added 3 commits August 26, 2026 19:53
Partial fills no longer post the form, upload treats `..` as a path
segment not a substring, and CASE_TURN_TOKENS now stops Claude turns too.

Co-authored-by: Cursor <cursoragent@cursor.com>
Disconnect already aborted OpenAI. Anthropic kept the stream and the
rate-limit sleep alive, so STOP still billed and held the thread busy.

Co-authored-by: Cursor <cursoragent@cursor.com>
@ishu86
ishu86 changed the base branch from feat/oss-browse-pack to main August 26, 2026 15:19
@ishu86
ishu86 merged commit 5ef3256 into main Aug 26, 2026
@ishu86
ishu86 deleted the feat/oss-drive-loop branch August 26, 2026 15:19
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