Repository navigation
fix(integrations): pre-approve Cursor Band tools and surface agent crashes - #750
Open
AlexanderZ-Band wants to merge 12 commits into
Open
AlexanderZ-Band wants to merge 12 commits into
AlexanderZ-Band wants to merge 12 commits into
Conversation
AlexanderZ-Band
enabled auto-merge
October 6, 2026 09:34
AlexanderZ-Band
commented
Oct 6, 2026
AlexanderZ-Band
left a comment
Collaborator
Author
There was a problem hiding this comment.
Four verified in-scope findings: startup-cancellation diagnostics, custom-tool coverage, failure-triggered cleanup before stdout EOF, and custom-name ownership collision. Fixing under the requested --fix workflow. GitHub rejected REQUEST_CHANGES because the authenticated user is this PR author; submitting as COMMENT.
…approve-bands-mcp-tools-and-surfa-INT-1644
…-and-surfa-INT-1644
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Cursor's SDK-owned Band MCP tools now receive per-call approval in every approval mode, while native and other-server tools retain the configured approval policy. Unexpected ACP subprocess exits report the exit code and a bounded stderr tail instead of losing the agent's diagnostics.
Changes
client_runtime.pyis now 246 lines.Related Issues
Fixes INT-1644.
Testing
Live results and limitations:
last delivery status: none. Captured logs contained platform HTTP 500 (Internal Server Error) and WebSocketphx_error. An isolated recheck passed without code changes; this does not make the full lane green.BAND_API_KEY_USER_2 was rejected (403),plan_required— durable human API keys require an Enterprise plan. This acceptance case still needs an eligible second-user credential.last delivery status: processing; the configured retry passed. Its first attempt remains unsuccessful.Latest focused validation
On commit
81f28453, using the pinned Cursor CLI2026.09.28-64d2043, selected only Cursor approval and compound workflow tests with retries disabled:last delivery status: processing. Captured logs included platform HTTP 500 (Internal Server Error) and WebSocketphx_error. An isolated recovery recheck passed in 82.24 seconds without code changes; this does not erase the failed first attempt.BAND_API_KEY_USER_2 was rejected (403),plan_required.c42e9f19, all 27 applicable PR checks passed, including Windows and Ubuntu Python 3.11, 3.12, and 3.13 unit jobs: CI run. The weekly coverage report is intentionally excluded for PR events; the coverage gate passed.stdout-eoftimeout in the test fixture: CPython’s virtualenv redirector retains stdout handles while waiting for the child interpreter. The fixture now launchessys._base_executabledirectly and preserves the active virtualenv using CPython’s launcher environment. A real intermediary probe reproduced the deadlock; the unchanged crash-warning regression now passes on all three Windows versions.Checklist
Review fixes and current validation
On
f1f731ca, the requested review found four issues: one each in Runtime Safety, Test Quality, Edge-Case Flow Analysis, and Logical Bugs. All four are fixed, replied to, and resolved. The focused post-fix Logical Bugs pass found no new defects.I001import ordering; corrected, then Ruff check/format and Pyrefly passed.2026.09.28-64d2043and repo-root.env.test.f1f731ca, including Ubuntu and Windows Python 3.11, 3.12, and 3.13: run 37455410071. No pending or failed checks. The weekly coverage report skips for PR events; the required coverage gate passed. The new protocol-error and startup-cancellation stdio regressions passed on all three Windows versions (each Windows unit job: 6,516 passed, 773 skipped).Shared
phx_errorchannel recovery is tracked separately in INT-1700, with the real-WebSocket reproduction attached. It is a confirmed shared transport defect; its attribution to the original Cursor timeout remains unproven.Subsequent style-only commit
c6f488b7usesmatch/casefor stdio peer initialization stages. Ruff check/format and Pyrefly pass; the full local unit suite again passed 6,695 tests, 155 skipped (146.74 seconds). The CI and live E2E results above refer tof1f731ca.Single source of truth
On
aa27dff6, the adapter and live Cursor workflow guard share the exact registered Band MCP tool ownership predicate. The stderr drain and startup-cancellation observer share one log template. Tool names still come from the existing registry andBandToolvocabulary; the E2E consumer uses string-compatible membership on Python 3.11.Test intent
On
0fe4d8f8, approval tests state two contracts separately: registered Band tools always approve without a room request, while other tools follow explicit policy expectations. Shared fixtures own custom-tool setup and stdio cleanup. Crash tests requireConnectionErrorand retain direct assertions on exit-code/stderr diagnostics. No production code changed.Ruff check/format and Pyrefly pass. 134 focused tests passed (1 warning, 11.24 seconds); full local unit suite 6,695 passed, 155 skipped (60 warnings, 146.91 seconds). Live E2E was not rerun for these test-only changes; the prior relevant Cursor repair pass on
aa27dff6is documented above. New-head CI is pending.Workflow coverage
On
61c575ed, three compound Cursor cases exercise all approval modes through real ACP JSON-RPC, actual HTTP MCP custom-tool/memory/reply calls, a permission-gated native edit subprocess, and room cleanup/rejoin. They check filesystem effects, persisted memory, exactly one reply, and turn judgment; a registered custom-name collision is present throughout. Two real stdio cases drive stdout EOF/protocol failure through adapteron_event, failure reporting, crash diagnostics, cleanup, and a successful respawned turn. Only the deterministic agent decisions and platform tools are test doubles in these local cases.EchoInputrather than a string; the initial adapter calls omitted required turn arguments. First run: 5 failed, 134 passed; second: 2 failed, 137 passed. Final runs above pass with stricter assertions and no retries.61c575ed, with no pending or failed checks. Both CI run 37462073038 and coverage run 37462073019 succeeded on attempt 1. Ubuntu and Windows Python 3.11, 3.12, and 3.13 are green. The three new compound workflow cases and both stdio crash/recovery cases passed on all three Windows versions (each Windows unit job: 6,521 passed, 773 skipped). The weekly coverage report is intentionally excluded for PR events; the coverage gate passed.