Repository navigation
Conversation
|
Thanks — this is a useful reliability pass. The shared upstream error mapping, 429/rate-limit handling, request-log enrichment, and the Requesting changes before landing though:
Decision: request changes. The core fixes are wanted — after a rebase and the cancel-scope fix I'd like to land this quickly. |
- re-export httpStatusFromTerminalError from server/index (import-time test failure) - gate benign NGHTTP2_CANCEL handling on the expectedClose suspend path so unexpected server-side stream cancels surface as real transport errors - restrict live GetUsableModels base-model activation to known effort suffixes (claude-4-sonnet-1m no longer activates claude-4-sonnet) + regression tests
|
Update: rather than waiting on a rebase, I've landed this on
Gates after landing: |
- re-export httpStatusFromTerminalError from server/index (import-time test failure) - gate benign NGHTTP2_CANCEL handling on the expectedClose suspend path so unexpected server-side stream cancels surface as real transport errors - restrict live GetUsableModels base-model activation to known effort suffixes (claude-4-sonnet-1m no longer activates claude-4-sonnet) + regression tests
Summary
Improves Cursor provider reliability and request-log diagnosis when upstream calls fail or streams cancel benignly. Also fixes
cursor/autodisappearing after live model discovery and maps it to Cursor wire iddefault.Changes
Upstream error mapping
src/lib/errors.tsresource_exhausted/ rate limits to 429 (rate_limit_error) instead of generic 502bridge, relay, and request-log terminal status handlingCursor transport stability
NGHTTP2_CANCELafter client-tool suspend as non-fataltransport-retry.tsdebugProviderDiagnostic("cursor", ...)Request logs
upstreamError,requestedModel,requestedEffort,resolvedModel, usage statuscursor/autoautoin catalog even whenGetUsableModelsomits itauto/cursor/autoto wire iddefaultclaude-sonnet-5andglm-5.2Testing
bun test tests/errors-adapter-failure.test.tsbun test tests/cursor-discovery.test.ts tests/codex-catalog.test.ts tests/cursor-request-builder.test.ts tests/cursor-adapter.test.tsbun test tests/cursor-transport-retry.test.ts tests/request-log.test.ts tests/adapter-error-inline.test.tsNotes