Skip to content

feat: de-brand layer 1+2 — neutral protocol naming, remove Anthropic hosted-service paths - #420

Merged
dahai80 merged 1 commit into
mainfrom
feat/debrand-layer12
Nov 30, 2026
Merged

dahai80 merged 1 commit into
mainfrom
feat/debrand-layer12

Conversation

@dahai80

@dahai80 dahai80 commented Nov 30, 2026

Copy link
Copy Markdown
Owner

Problem

Issue #419: ~995 textual Anthropic/Claude references remained after the SDK decoupling. Scope per the issue: layer 1 (naming/branding) + layer 2 (Anthropic network paths). Layer 3 (internal Messages wire protocol) intentionally stays.

Changes

Layer 1 — naming / branding

  • src/types/anthropic-protocol.ts → src/types/messages-protocol.ts; all 107 imports + one test comment updated
  • src/services/llm/capability.ts: hardcoded includes("claude-opus-4")-style heuristics replaced with semantic detection — parseModelId() extracts family (opus/sonnet/haiku) + major/minor generation, isLegacyGeneration() + version comparison drive thinking/ISP/context-management/structured-output. Behavior-preserving for every current canonical id (e.g. gen-3 → false, 4.1+ → structured output)
  • claudeCodeGuideAgent.ts → fusionGuideAgent.ts; agent type claude-code-guide → fusion-guide; prompt repurposed to Fusion-Code docs only; the platform.claude.com/llms.txt fetch and docs-map path dropped
  • package export ./claudemd-parser → ./project-md-parser (src/lib/project-md-parser/, test renamed)
  • User-visible strings + comments neutralized: rejected-plan / interrupted prompts, /usage stub, MCP panel section header, credit-balance error (provider billing link removed), PR attribution template (Fusion Code), availability docs, misc comments

Layer 2 — Anthropic network paths (product decisions embedded, flagged below)

  • constants/oauth.ts: getOauthConfig() / prod api.anthropic.com config and MCP_CLIENT_METADATA_URL (claude.ai CIMD doc) removed. MCP CIMD now env-only (MCP_OAUTH_CLIENT_METADATA_URL), falls back to Dynamic Client Registration
  • No default LLM provider: seam.ts requires FUSION_BASE_URL/ANTHROPIC_BASE_URL and throws a clear error without it; upstreamproxy disabled without a base URL; apiPreconnect skipped (renamed preconnectApi)
  • WebFetchTool: hosted api.anthropic.com/api/web/domain_info blocklist preflight dropped (issue offered this option). Local SSRF IP checks + permission flow unchanged; skipWebFetchPreflight now a compatibility no-op
  • Hosted endpoints now env-configurable, fail-open/skip without config: policy limits (FUSION_POLICY_LIMITS_URL), fast mode status (FUSION_FAST_MODE_STATUS_URL), OAuth profile reader (FUSION_PROFILE_API_URL), voice streaming STT (VOICE_STREAM_BASE_URL), GrowthBook (FUSION_CODE_GB_BASE_URL)
  • anthropic-beta OAuth header emission removed (http.ts, betas.ts)

Deferred (out of this PR, per issue scope note)

  • Layer 3 wire protocol: Messages format, anthropic-version + functional beta headers, model-id strings, ANTHROPIC_* env compat, CLAUDE.md conventions — kept
  • Full subscriber/OAuth token machinery (claudeAiLimits ratelimit parsing, isClaudeAISubscriber callers, keychain token storage) — stored-token compat, follow-up PR
  • platform.claude.com in WebFetch preapproved domains (fetches docs, not a network path we call programmatically)

Reviewer attention

  • Endpoint semantics: anthropic-version/functional beta headers kept as wire protocol (layer 3 note in issue conflicts with its layer-2 checkbox; followed the "NOT rewriting the protocol layer" scope decision)
  • README + docs/model-providers.md updated to "no default provider" — direct connect now requires FUSION_BASE_URL
  • fusion_guide agent expects code.fusion-mlx.com/docs/en/fusion_code_docs_map.md (path renamed from claude_code_docs_map.md) — fusion-site needs to serve it (will file cross-repo issue if wanted)

Test results

  • bun run typecheck: 0 errors
  • bun run lint: no new diagnostics vs main (33 warnings baseline unchanged)
  • bun run check: layer-lint, reverse-boundary, feature-flags (79=79), build all green
  • Tests: src/__tests__ 1312 pass / tests/ 529 pass / web 79 pass, 0 fail

Closes #419

🤖 Generated with Fusion Code

…hosted-service paths (#419)

Layer 1 (naming/branding):
- Rename src/types/anthropic-protocol.ts to messages-protocol.ts; update all imports
- capability.ts: replace hardcoded model-name substring heuristics with
  semantic family/generation parsing (parseModelId, isLegacyGeneration,
  version compare); behavior-preserving for all current canonical ids
- Rename claudeCodeGuideAgent.ts to fusionGuideAgent.ts; repurpose to
  Fusion-Code-only docs (agent type fusion-guide); drop platform.claude.com
  docs-map fetch
- Rename claudemd-parser package export to project-md-parser
- Neutralize user-visible strings and comments referencing Claude Code /
  claude.ai / Anthropic (UI messages, MCP panel header, PR attribution
  template, availability docs)

Layer 2 (Anthropic network paths removed; no default provider):
- oauth.ts: drop getOauthConfig/PROD_OAUTH_CONFIG (api.anthropic.com) and
  MCP_CLIENT_METADATA_URL (claude.ai CIMD doc); MCP CIMD now env-only,
  falls back to DCR
- seam.ts: no default base URL — FUSION_BASE_URL/ANTHROPIC_BASE_URL
  required, clear error otherwise
- upstreamproxy: disabled without explicit base URL
- WebFetch: drop hosted domain_info blocklist preflight (SSRF checks and
  permission flow unchanged)
- policy limits / fast mode / OAuth profile: env-configurable endpoints
  (FUSION_POLICY_LIMITS_URL / FUSION_FAST_MODE_STATUS_URL /
  FUSION_PROFILE_API_URL), fail-open/skip without them
- voice streaming STT: requires VOICE_STREAM_BASE_URL, no hosted default
- apiPreconnect: skip without FUSION_BASE_URL; renamed preconnectApi
- GrowthBook: no hosted default; requires FUSION_CODE_GB_BASE_URL
- Remove OAUTH_BETA_HEADER emission (http.ts, betas.ts)

Layer 3 (wire protocol, model ids, env-var compat, stored-token machinery)
intentionally kept per issue scope decision; full subscriber/OAuth token
machinery removal is follow-up work.

Verification: tsc 0 errors; lint no new diagnostics vs main; layer-lint +
feature-flags green; build green; tests 1312 unit + 529 integration +
79 web all pass.

Closes #419

Co-Authored-By: Claude Code <[email protected]>
@dahai80
dahai80 merged commit 36e78da into main Nov 30, 2026
2 checks passed
@dahai80
dahai80 deleted the feat/debrand-layer12 branch November 30, 2026 23:39
@dahai80 dahai80 mentioned this pull request Nov 30, 2026
dahai80 added a commit that referenced this pull request Dec 1, 2026
…leftover docs

Completes the remaining layer-1 items from issue #419 on top of #420:

- namespace Anthropic -> Messages in messages-protocol.ts (+94 dotted
  usages; default export alias AnthropicDefault -> MessagesDefault)
- flatten the redundant Beta.Messages nesting (types are already
  Beta-prefixed; the inner namespace shadowed the outer Messages and
  created circular type aliases)
- delete src/claude-api/ (orphaned upstream integration note, the only
  file still carrying Claude Code brand strings in src/)
- CostThresholdDialog: 'Anthropic API' -> neutral cost-cap title
- neutral wording in withRetry/compact comments

Live Anthropic network calls were already zero after #420 (remaining
refs are wire-format field names, kept per the layer-3 decision).
ANTHROPIC_API_KEY env fallback stays as interop compat for users with
existing keys.

Co-Authored-By: Claude Code <[email protected]>
dahai80 added a commit that referenced this pull request Dec 1, 2026
…leftover docs (#424)

Completes the remaining layer-1 items from issue #419 on top of #420:

- namespace Anthropic -> Messages in messages-protocol.ts (+94 dotted
  usages; default export alias AnthropicDefault -> MessagesDefault)
- flatten the redundant Beta.Messages nesting (types are already
  Beta-prefixed; the inner namespace shadowed the outer Messages and
  created circular type aliases)
- delete src/claude-api/ (orphaned upstream integration note, the only
  file still carrying Claude Code brand strings in src/)
- CostThresholdDialog: 'Anthropic API' -> neutral cost-cap title
- neutral wording in withRetry/compact comments

Live Anthropic network calls were already zero after #420 (remaining
refs are wire-format field names, kept per the layer-3 decision).
ANTHROPIC_API_KEY env fallback stays as interop compat for users with
existing keys.

Co-authored-by: Claude Code <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

De-branding roadmap: remove Anthropic/Claude references (layer 1+2, protocol rename only)

1 participant