Disconnect: treat a 404 on the provider deletes as already removed - #432
Merged
TheGreatAxios merged 3 commits intoAug 29, 2026
Conversation
TheGreatAxios
force-pushed
the
cl-7127-disconnecting-a-provider-500s-couldnt-disconnect-try-again
branch
from
August 28, 2026 12:23
c86eaf9 to
3377f6b
Compare
Covers a second/concurrent disconnect where the catalog-provider or provider DELETE 404s because a prior call already removed the row: disconnectConnector should resolve instead of throwing.
disconnectConnector threw on any non-204 from DELETE /catalog/providers/:id or DELETE /providers/:id, so a second or concurrent disconnect (the hub 404s once a prior call already removed the row) collapsed into a 500 "Couldn't disconnect - try again" even though the connector was disconnected. A 404 is now treated as already removed; only a genuinely unexpected status still fails. The route's catch block also reports the failure through @corbits/error-sink so a real 500 carries a refId and the upstream cause. Fixes CL-7127.
TheGreatAxios
force-pushed
the
cl-7127-disconnecting-a-provider-500s-couldnt-disconnect-try-again
branch
from
August 29, 2026 04:46
3377f6b to
a671051
Compare
TheGreatAxios
commented
Aug 29, 2026
TheGreatAxios
left a comment
Contributor
Author
There was a problem hiding this comment.
critique · comment
disconnectConnector no longer throws on hub DELETE 404.
- A provider-row 404 can still surface as HTTP 404 to settings-ui ("Couldn't disconnect — try again.").
- Hugging Face stolen-state 5s timeout is not this diff (packages/onboarding/test/huggingface-connect-routes.test.ts against https://bench.example.com).
Walking-skeleton red on this PR is main deleting DATABASE_URL after memory-mount tests (CL-7182 / #465).
…-a-provider-500s-couldnt-disconnect-try-again
TheGreatAxios
commented
Aug 29, 2026
TheGreatAxios
left a comment
Contributor
Author
There was a problem hiding this comment.
critique · comment
API 404-on-already-removed path is covered by routes.test.ts. CI is green.
Live agent-browser on main-gate (not this branch) with local Ollama: Disconnect confirm did not show "Couldn't disconnect — try again." Ollama stayed CONNECTED; fallback still Inherited. That is operator/env inheritance, not this PR's catalog-DELETE 404 race.
Merge this head: Sawyer-only, all checks green, no blocking defect in the 404 handling.
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.
Fixes CL-7127 — https://linear.app/abklabs/issue/CL-7127
Problem
disconnectConnector(packages/connections/src/routes.ts:89-153) lists the tenant's catalog providers, issuesDELETE /catalog/providers/:id, and throws unless the status is exactly 204 (:116-120), with a mirror check for the credential provider delete (:146-150). The hub's model-provider DELETE answers 404 when the row is already gone, so a second or concurrent disconnect throws and the route (:579-591) collapses that into a 500 "Couldn't disconnect — try again," even though the connector ends up disconnected.Change
DELETE /catalog/providers/:idorDELETE /providers/:idas "already removed" instead of throwing; only a genuinely unexpected status still fails the disconnect.reportErrorfrom@corbits/error-sinkso a real disconnect failure carries a refId and the upstream cause, not just a log line.Tests
packages/connections/src/routes.test.ts: two new cases in thedisconnectConnectordescribe block — a 404 on the catalog-provider DELETE, and a 404 on the provider DELETE — both now resolve instead of throwing (previously reproduced the bug and failed).bun test packages/connections/src/routes.test.ts: 39 pass, 0 fail.cd packages/connections && bunx tsc --noEmit -p .: clean.