Skip to content

Comments

fix(agents): Error handling when claude client is not available in region#148

Merged
8nevil8 merged 4 commits intocodemie-ai:mainfrom
DmitriyStoyanov:main
Feb 16, 2026
Merged

fix(agents): Error handling when claude client is not available in region#148
8nevil8 merged 4 commits intocodemie-ai:mainfrom
DmitriyStoyanov:main

Conversation

@DmitriyStoyanov
Copy link
Contributor

@DmitriyStoyanov DmitriyStoyanov commented Feb 13, 2026

Summary

Fix error handling when claude client is not available in region

Changes

  • Fixed error handling when claude client is not available in region
  • Added parallelization during different checks

Impact

When user will try to install claude code from Belarus, previously we have seen message like:

✗ Failed to install agent claude: Installer exited with code 2. Output: bash: line 1: syntax error near unexpected token `<'                                                             
  bash: line 1: `<!DOCTYPE html><!-- Last Published: Fri Feb 13 2026 20:50:58 GMT+0000 (Coordinated Universal Time) --><html data-wf-domain="websitemain.claude.com"                       
  data-wf-page="68bd5cf2687bfe3893fd2b7f" data-wf-site="6889473510b50328dbb70ae6" data-wf-intellimize-customer-id="117902971" lang="en-US"><head><meta charset="utf-8"/><title>App         
  unavailable in region | Claude</title><link rel="alternate" hrefLang="x-default" href="https://claude.com/app-unavailable-in-region"/><link rel="alternate" hrefLang="en-US"             
  href="https://claude.com/app-unavailable-in-region"/><link rel="alternate" hrefLang="ja-JP" href="https://claude.com/ja-jp/app-unavailable-in-region"/><link rel="alternate"             
  hrefLang="de-DE" href="https://claude.com/de-de/app-unavailable-in-region"/><link rel="alternate" hrefLang="fr-FR" href="https://claude.com/fr-fr/app-unavailable-in-region"/><link      
  rel="alternate" hrefLang="ko-KR" href="https://claude.com/ko-kr/app-unavailable-in-region"/><meta content="Unfortunately, Claude isn&#x27;t available here." name="description"/><meta   
  content="App unavailable in region | Claude" property="og:title"/><meta content="Unfortunately, Claude isn&#x27;t available here." property="og:description"/><meta                      
  content="https://cdn.prod.website-files.com/6889473510b50328dbb70ae6/68c469d23594abeb9ab6ee48_og-claude-generic.jpg" property="og:image"/><meta content="App unavailable in region |     
  Claude" property="twitter:title"/><meta content="Unfortunately, Claude isn&#x27;t available here." property="twitter:description"/><meta property="og:type" content="website"/><meta     
  content="summary_large_image" name="twitter:card"/><meta content="width=device-width, initial-scale=1" name="viewport"/><meta content="tPMMBQMBzgZlNmCBal5cMPAx3nhO2iyM4rT9nxuRcdk"      
  name="google-site-verification"/><link href="https://cdn.prod.website-files.com/6889473510b50328dbb70ae6/css/claude-brand.shared.64a63638a.min.css" rel="stylesheet" type="text/css"     
  integrity="sha384-ZKY2OKLFsUTo6mNHdUhenUoXFNIKjCfVyVpzVDNE3VLlfOLxz1AKAqN98vQg7LMj" crossorigin="anonymous"/><script type="text/javascript">!function(o,c){var n=c.documentElement,t="   
  w-mod-";n.className+=t+"js",("ontouchstart"in o||o.DocumentTouch&&c instanceof DocumentTouch)&&(n.className+=t+"touch")}(window,document);</script><link                                 
  href="https://cdn.prod.website-files.com/6889473510b50328dbb70ae6/689f4a9aff1f63fde75cf733_favicon.png" rel="shortcut icon" type="image/x-icon"/><link                                   
  href="https://cdn.prod.website-files.com/6889473510b50328dbb70ae6/68c33859cc6cd903686c66a2_apple-touch-icon.png" rel="apple-touch-icon"/><link                                           
  href="https://claude.com/app-unavailable-in-region" rel="canonical"/><style>.anti-flicker, .anti-flicker * {visibility: hidden !important; opacity: 0                                    
  !important;}</style><style>[data-wf-hidden-variation], [data-wf-hidden-variation] * {'                                                                                                   
  curl: (56) Failure writing output to destination, passed 4229 returned 0                  

Now user will see correct error during update like:

% codemie update claude 
✔ Update available: 2.1.41 → 2.1.42
✖ Failed to update Claude Code
✗ Update failed: Failed to install agent claude: Claude Code is not available in your current region. Visit https://claude.ai for information about supported regions.

or during install like:

% codemie install claude
Claude Code v2.1.41 is already installed (requested: 2.1.42)
? Reinstall with version 2.1.42? Yes
✖ Failed to install Claude Code
✗ Failed to install agent claude: Claude Code is not available in your current region. Visit https://claude.ai for information about supported regions.

💡 Available agents:
   • codemie-code
   • claude
   • claude-acp
   • gemini
   • opencode

💡 Tip: Run codemie install to see all agents

Checklist

  • Self-reviewed
  • Manual testing performed
  • Documentation updated (if needed)
  • No breaking changes (or clearly documented)

@DmitriyStoyanov DmitriyStoyanov changed the title feat: Update Claude code support to new release 2.1.41 chore(agents): Update Claude code support to new release 2.1.41 Feb 13, 2026
@DmitriyStoyanov DmitriyStoyanov changed the title chore(agents): Update Claude code support to new release 2.1.41 fix(agents): Error handling when claude client is not available in region Feb 14, 2026
Problem

  The codemie doctor command spawned 14-23 subprocesses sequentially. On Windows, process creation is ~10x slower than Unix, causing the command to exceed the 60s test timeout (took ~63.5s).

  Changes

  3 parallelization layers:

  1. src/agents/registry.ts — getInstalledAgents() now checks all 5 agents' isInstalled() in parallel via Promise.all() instead of a sequential loop. This was the single biggest bottleneck (4-6 process spawns
   serialized).
  2. src/cli/commands/doctor/checks/AgentsCheck.ts — run() now fetches getVersion() + getInstallationMethod() for all installed agents in parallel instead of one at a time.
  3. src/cli/commands/doctor/checks/FrameworksCheck.ts — run() now checks isInstalled() + getVersion() for all frameworks in parallel.
  4. src/cli/commands/doctor/index.ts — Restructured the orchestrator into 3 parallel groups:
    - Group 1: Tool checks (Node, npm, Python, uv, AWS CLI) — all run concurrently
    - Group 2: AI Config + Provider check — sequential (provider depends on config)
    - Group 3: Discovery checks (Agents, Workflows, Frameworks) — all run concurrently

  Results are collected first, then displayed sequentially to preserve output ordering.

  Before: ~23 subprocess spawns executed one after another
  After: Same subprocess spawns but organized into parallel batches, reducing wall-clock time from O(n) to roughly O(max-per-group)
@8nevil8 8nevil8 merged commit a2e9cb4 into codemie-ai:main Feb 16, 2026
5 checks passed
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.

2 participants