From f8d386519db7274ee6169eb262aa61df4a9c8f81 Mon Sep 17 00:00:00 2001 From: Pratiksha Bhere Date: Thu, 6 Aug 2026 13:06:23 +0530 Subject: [PATCH] chore(versioning): remove dead 423 freeze + v1-migration error handlers Both branches in formatApiError are now unreachable after the v1 cleanup: - HTTP 423 config-freeze: the AGENT_CONFIG_FROZEN flag was removed (atoms cleanup PR1), so the backend never returns 423. - versioning_v2_migration_required: the deprecated v1 versioning write endpoints were deleted (atoms cleanup PR3), so the backend never emits this error_type. Drops both handlers and the now-unused VERSIONING_V2_MIGRATION_ERROR const; formatApiError falls through to its generic message. Co-Authored-By: Claude Opus 4.8 (1M context) --- src/api.ts | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/src/api.ts b/src/api.ts index 8f74e04..ed8aa9e 100644 --- a/src/api.ts +++ b/src/api.ts @@ -51,22 +51,7 @@ export async function atomsApi( return { ok: response.ok, status: response.status, data }; } -/** Backend discriminator (branch-model-guard.ts) for deprecated v1 versioning endpoints. */ -const VERSIONING_V2_MIGRATION_ERROR = "versioning_v2_migration_required"; - export function formatApiError(result: ApiResult): string { - // Config freeze: the backend locks all config writes during a maintenance window (HTTP 423). - // Surface it as a clear, non-alarming state — reads and test-calls are unaffected. - if (result.status === 423) { - return "Agent config is frozen for a maintenance window — edits are paused. Test-calls and reads still work; try your edit again shortly."; - } - - // Deprecated v1 versioning endpoint after the branch-model cutover. This should not happen once - // migrated; if it does, the MCP is out of date relative to the backend. - if (result.data?.error_type === VERSIONING_V2_MIGRATION_ERROR) { - return "This Smallest MCP server is out of date and called a deprecated endpoint. Update it (restart your editor to pull the latest, or re-run the installer), then try again."; - } - const msg = result.data?.message ?? result.data?.error ?? JSON.stringify(result.data); return `API error ${result.status}: ${msg}`; }