Skip to content

fix(proxy): fix two Claude Desktop Windows startup failures#3

Closed
AntonYeromin wants to merge 1 commit into
mainfrom
fix/claude-desktop-haiku-thinking-and-mcp-server-name
Closed

fix(proxy): fix two Claude Desktop Windows startup failures#3
AntonYeromin wants to merge 1 commit into
mainfrom
fix/claude-desktop-haiku-thinking-and-mcp-server-name

Conversation

@AntonYeromin

Copy link
Copy Markdown
Owner

Summary

Two separate Windows-only bugs that prevented Claude Desktop (3P mode) from starting successfully when certain conditions were met.

Changes

1. Haiku model crash — Content block is not a text block

Root cause: When the user selects claude-haiku-4-5-20251001 in Claude Desktop, the app resolves maxThinkingTokens = 31999 and sends thinking: { type: "enabled", budget_tokens: 31999 } to the API via the CodeMie proxy. Haiku returns thinking content blocks in the response stream. The Desktop SDK, expecting only text blocks, throws:

API Error: Content block is not a text block

The SSO proxy already had a ClaudeRequestNormalizerPlugin that strips the thinking field for Haiku models — but it was scoped only to codemie-claude (Claude Code). Desktop 3P requests carry clientType: 'claude-desktop' and were silently bypassing the plugin.

Fix: Added 'claude-desktop' to ALLOWED_AGENTS in ClaudeRequestNormalizerPlugin so the Haiku thinking-strip logic runs for Desktop proxy requests as well.

2. Session crash on startup — Server name can only contain letters, numbers, hyphens, and underscores

Root cause: The managed MCP server entry "Atlassian Jira and Confluence" contained spaces. Claude Code validates allowedMcpServers names against /^[a-zA-Z0-9_-]+$/. On Windows, loading the managed-policy settings file failed with:

parent managed settings: Server name can only contain letters, numbers, hyphens, and underscores

This caused the Claude Code process to exit with code 1 before the session could start.

Fix: Renamed the entry to "Atlassian-Jira-and-Confluence" (spaces → hyphens).

Test Plan

  • Unit tests for ClaudeRequestNormalizerPlugin updated — new cases cover claude-desktop agent scoping and Haiku stripping via Desktop agent
  • All 1686 unit tests pass (npm run test:unit)
  • ESLint passes with zero warnings
  • TypeScript compiles clean (tsc --noEmit)

Checklist

  • Code follows style guide
  • All tests pass
  • No ESLint warnings
  • No secrets introduced
  • Architecture boundaries respected (proxy plugin layer)

- Strip thinking field for claude-desktop agent in ClaudeRequestNormalizerPlugin.
  Haiku models (claude-haiku-4-5-*) do not support extended thinking. When
  Desktop 3P mode selects Haiku, the app resolves maxThinkingTokens=31999 and
  sends thinking:enabled to the API. The API returns thinking content blocks
  which the Desktop SDK cannot parse as text blocks, resulting in:
  "API Error: Content block is not a text block".
  Fix: add 'claude-desktop' to ALLOWED_AGENTS so the existing Haiku thinking-
  strip logic runs for Desktop proxy requests, same as for codemie-claude.

- Rename MCP server "Atlassian Jira and Confluence" → "Atlassian-Jira-and-Confluence".
  Claude Code validates allowedMcpServers names against /^[a-zA-Z0-9_-]+$/.
  Spaces in the name caused the managed-policy settings load to fail on Windows
  with "Server name can only contain letters, numbers, hyphens, and underscores",
  crashing the session before it could start.

Generated with AI

Co-Authored-By: codemie-ai <codemie.ai@gmail.com>
@AntonYeromin

Copy link
Copy Markdown
Owner Author

Closing — opening PR against upstream codemie-ai/codemie-code instead.

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.

1 participant