Native experience overhaul: reliability, streaming fidelity, transport (v0.5.0-next.0)#76
Merged
Conversation
…remains as fallback
…tted for local agents)
…ant collision loop, abort parity, docs
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
Overhaul making Cursor-as-provider in opencode feel, function, and perform as natively as possible. Targets the three pain areas identified: reliability, streaming fidelity, and model/feature parity. Ships as
0.5.0-next.0.22 commits,
+2net test files. 338/338 unit tests green, typecheck clean, build emits DTS. Live E2E transport matrix 6/6 green (verified against Cursor API, cheapest model).Reliability
error-classify.ts): name/status/code heuristics →agent-not-found | agent-busy | rate-limit | network | auth | config | unknown(neverinstanceof— sidecar errors cross a JSON boundary as plain objects). Sidecar now preservesstatus/code/isRetryable/helpUrlround-trip.local.forceresend; rate-limit/network → bounded backoff (same agent); auth/config → fail fast. Replaces prior retry-on-any-error.OPENCODE_CURSOR_STALL_MS, default 60s): pre-first-event stall → cancel + force-resend once; mid-stream stall → cancel wedged run + terminal error (no orphan runs).Transport (native HTTP)
node:http2breaks Cursor's connect-RPC streaming (upstream oven-sh/bun#31499, NOT_PLANNED, still failing). No released Bun fix.http1(Bun default, viaCursor.configure({local:{useHttp1ForAgent:true}})),http2-direct(Node default),sidecar(fallback). Configurable viatransportoption orOPENCODE_CURSOR_TRANSPORT. LegacyOPENCODE_CURSOR_SIDECAR=0routes to http1 under Bun (was routing to broken http2-direct).Streaming fidelity
partial-tool-call→tool-input-start/-delta/-end(opportunistic, SDK-dependent; edit stays diff-buffered). Live plan streaming forcreatePlan. Kill-switchOPENCODE_CURSOR_TOOL_INPUT_STREAM=0.providerMetadata.cursor.Model / feature parity
Cursor.models.list()variants(displayName/isDefault) over generated ones; deterministic slug with collision counter.additionalCwds).Hygiene
@cursor/sdk^1.0.24,@opencode-ai/plugin+sdk^1.18.4. Node floor>=22.13(SDK requirement — package.json previously claimed 22.0 while the SDK needed 22.13).Test plan
npm test→ 338/338 (29 files)npm run typecheck→ cleannpm run build→ ESM + DTS emittedE2E=1 npm run test:e2e→ transport matrix 6/6 (tool-parity, resume, long-stream >64KB, recovery) against live Cursor API