You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Windows: ucode claude fails with apiKeyHelper POSIX shell error
Summary
On Windows, ucode claude can fail after Databricks auth succeeds with:
apiKeyHelper failed: exited 1: No se esperaba -n en este momento.
The failure appears to come from the generated Databricks helper command being POSIX shell syntax, which is not valid in the Windows shell context used by Claude Code.
Evidence
Uploaded evidence: screenshot 1 shows ucode claude failing on Windows, and screenshot 2 shows the ucode configure traceback leading to the Databricks setup path.
The terminal output shows ucode claude reaching Databricks auth successfully and then failing when Claude Code starts.
The exact error shown is:
apiKeyHelper failed: exited 1: No se esperaba -n en este momento.
Start from a Windows machine with no existing Databricks CLI auth profile.
Run ucode configure and complete the Databricks login flow.
Select Claude during the provider/tool selection step.
Close the terminal after configuration finishes.
Open a new PowerShell terminal and run ucode claude.
Claude Code starts, then fails with the apiKeyHelper error.
Expected Behavior
ucode claude should start Claude Code successfully on Windows and fetch the Databricks token without relying on POSIX shell syntax.
Actual Behavior
Claude Code fails before it can fully initialize because the generated apiKeyHelper command is interpreted incorrectly on Windows.
Likely Cause
The helper command returned for Claude appears to use POSIX shell logic such as:
if [ -n"${DATABRICKS_BEARER:-}" ];then ...
That syntax is valid in sh/bash, but not in PowerShell or cmd.exe.
Recommendation
Update the Windows path so the helper command is generated as a PowerShell-compatible command. The helper should be written in a way that is safe for PowerShell and avoids POSIX shell syntax entirely. For example:
This keeps the DATABRICKS_BEARER fallback, but makes the Windows branch explicit and avoids POSIX-only constructs such as [ -n ... ] and jq on Windows.
If possible, add a focused regression test that asserts the Windows helper contains a PowerShell command and not the POSIX shell branch.
Suggested Implementation Notes
Keep the existing POSIX helper for Unix-like systems.
Add a Windows-specific helper branch in the token command builder.
Preserve the DATABRICKS_BEARER fallback if it is already part of the design.
Acceptance Criteria
ucode claude works on Windows with a fresh Databricks setup.
The helper command used by Claude is valid in PowerShell.
Automated tests cover the Windows-specific branch.
Windows:
ucode claudefails withapiKeyHelperPOSIX shell errorSummary
On Windows,
ucode claudecan fail after Databricks auth succeeds with:apiKeyHelper failed: exited 1: No se esperaba -n en este momento.The failure appears to come from the generated Databricks helper command being POSIX shell syntax, which is not valid in the Windows shell context used by Claude Code.
Evidence
Uploaded evidence: screenshot 1 shows
ucode claudefailing on Windows, and screenshot 2 shows theucode configuretraceback leading to the Databricks setup path.The terminal output shows
ucode claudereaching Databricks auth successfully and then failing when Claude Code starts.The exact error shown is:
apiKeyHelper failed: exited 1: No se esperaba -n en este momento.A related report is visible in GitHub issue ucode configure fails without existing Databricks auth profile #54, where
ucode configurefails when no Databricks auth profile exists yet.Environment
ucodeSteps to Reproduce
ucode configureand complete the Databricks login flow.ucode claude.apiKeyHelpererror.Expected Behavior
ucode claudeshould start Claude Code successfully on Windows and fetch the Databricks token without relying on POSIX shell syntax.Actual Behavior
Claude Code fails before it can fully initialize because the generated
apiKeyHelpercommand is interpreted incorrectly on Windows.Likely Cause
The helper command returned for Claude appears to use POSIX shell logic such as:
That syntax is valid in
sh/bash, but not in PowerShell orcmd.exe.Recommendation
Update the Windows path so the helper command is generated as a PowerShell-compatible command. The helper should be written in a way that is safe for PowerShell and avoids POSIX shell syntax entirely. For example:
This keeps the
DATABRICKS_BEARERfallback, but makes the Windows branch explicit and avoids POSIX-only constructs such as[ -n ... ]andjqon Windows.If possible, add a focused regression test that asserts the Windows helper contains a PowerShell command and not the POSIX shell branch.
Suggested Implementation Notes
DATABRICKS_BEARERfallback if it is already part of the design.Acceptance Criteria
ucode claudeworks on Windows with a fresh Databricks setup.