Skip to content

Keep Stop/idle partials, cancel tools honestly, unblock CI - #10

Merged
wu1w merged 3 commits into
mainfrom
cursor/ux-stop-ci-no-walls-1ee7
Aug 18, 2026
Merged

Keep Stop/idle partials, cancel tools honestly, unblock CI#10
wu1w merged 3 commits into
mainfrom
cursor/ux-stop-ci-no-walls-1ee7

Conversation

@wu1w

@wu1w wu1w commented Aug 18, 2026

Copy link
Copy Markdown
Owner

Personal-desktop smoothness: Stop/idle/delete feel like a mainstream agent, secrets are stripped silently, and CI lint gates are unblocked. No new approval gates, confirm dialogs, or capability walls.

What changed

Stop / idle / session delete

  • sync_response idle now keeps the streamed partial (same path as status: idle / Stop fallback) instead of wiping it before history lands.
  • In-flight tools are marked cancelled, not completed-then-deleted. The cancelled rows ride on the kept partial bubble.
  • Backend Stop no longer commits prefetched readonly results. Serial tool calls are cancelled when _should_stop flips (process trees already die on CancelledError).
  • Composer send is not blocked while Stop is in flight, so the input does not sit idle-spinning.
  • Successful session delete immediately drops tevarn-chat-draft:<id> and the stream-cache entry. No extra confirm or delay.

Silent secret strip

  • Local python / command spawn inherits host env minus control-plane keys (TEVARN_JWT_SECRET, desktop HMAC, admin password, encryption/RPC secrets). PATH, HOME, and user-intended env (e.g. OPENAI_API_KEY) stay. No permission prompt.

CI without policy churn

  • useColResize syncs the width ref in an effect (React-legal). Did not downgrade react-hooks/refs.
  • Removed unused f-string prefixes in backend/agent/loop.py (Ruff F541). Pytest can run again after Ruff.
  • Typecheck follow-up: chat page no longer shadows useT() with a setTimeout id; CronWebhookPanel imports useT so existing t() calls typecheck.

Hang-avoidance

  • Image aiohttp sessions use ClientTimeout(total=120, connect=10). No retries.
  • emit_run_event spill I/O and file_write / file_edit disk I/O go through asyncio.to_thread.

What was verified locally

  • ruff check on the F541 file and all touched Python files: clean.
  • ESLint on the touched frontend files: 0 errors.
  • tsc --noEmit in frontend/: clean after the typecheck follow-up.
  • Pytest (41 tests): test_loop_stop_ux, test_tool_parallel (including new stop/cancel cases), test_tool_spawn_env, test_hang_avoidance — all green.

Deliberately skipped

  • Rust kernel lock / court (other agent).
  • JobBackend filesystem isolation, extra_roots confirms, MCP allowlists, steward/_workforce stripping, multi-user IDOR checks — those add walls or hot-path gates.
  • Mermaid XSS / openExternal / assertTrustedIpc — not one-line-safe for current UX.
  • Rewriting ~50 Chinese snapshot / budget / tool-policy tests — out of scope; this PR only unblocks Ruff so those can surface again.
  • New confirms, capability gates, dependency adds, version bumps.
  • channels/page.tsx no-explicit-any warnings — not a typecheck error.

How to review

Focus on frontend/app/chat/page.tsx, backend/agent/phases/tool_round.py, backend/core/host_commands.py, and the two CI one-liners. The product goal is fail-open desktop smoothness: Stop keeps what you already saw, delete is instant, tools that need PATH still work.

Open in Web Open in Cursor 

cursoragent and others added 3 commits August 18, 2026 02:29
Stop and idle now keep the streamed partial (including sync_response), mark interrupted tools cancelled instead of completed, and actually cancel serial/prefetched tool work. Session delete clears the dead draft and stream cache immediately. Local python/command spawn silently drops control-plane secrets while keeping PATH/HOME/user env. Image HTTP gets a timeout; emit_run_event and file write/edit leave the event loop. Ruff F541 and useColResize render-ref writes are fixed so CI can run.

Co-authored-by: wu1w <wu1w@users.noreply.github.com>
Co-authored-by: wu1w <wu1w@users.noreply.github.com>
The useColResize lint fix let tsc run. Chat page shadowed useT() with a setTimeout id (Number not callable). CronWebhookPanel already called t() without importing useT.

Co-authored-by: wu1w <wu1w@users.noreply.github.com>
@wu1w wu1w closed this Aug 18, 2026
@wu1w wu1w reopened this Aug 18, 2026
@wu1w
wu1w marked this pull request as ready for review August 18, 2026 02:45
@wu1w
wu1w merged commit 6a17fd8 into main Aug 18, 2026
2 of 4 checks passed
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.

2 participants