Fix Windows: agent launch corruption and POSIX apiKeyHelper (#173, #116)#177
Merged
Conversation
Two Windows-only bugs broke `ucode claude`/`ucode codex`: #173 — garbled, split-screen terminal input. Both agents launched via os.execvp, but Windows has no real exec: the CRT spawns a new process and kills the parent, so the launching shell resumes and fights the agent for the console. New launcher.exec_or_spawn() keeps execvp on POSIX and spawns+waits (propagating exit code / SIGINT) on Windows, matching the pattern the token-refreshing agents already use. #116 — apiKeyHelper failed with a POSIX shell error. build_auth_shell_command emitted `if [ -n ... ]; ... | jq` and Codex ran it via `sh -c`; neither sh nor jq exists on Windows. Replaced with a hidden `ucode auth-token` command that prints the bearer via get_databricks_token (which already owns the DATABRICKS_BEARER short-circuit and PAT path). Claude's apiKeyHelper and Codex's auth block now invoke that executable directly as argv — no shell, no jq, identical on every platform. Also hardens the --use-pat path: ensure_pat_bearer() treats an empty DATABRICKS_BEARER as absent (setdefault would let it shadow the PAT and force OAuth, which can't serve a PAT-only profile), and `auth-token --use-pat` fails closed with an actionable error instead of silently trying OAuth. Co-authored-by: Isaac
The MLflow tracing e2e races async trace ingestion against the poll timeout and fails intermittently in CI. Skip it pending a more robust verification path. Co-authored-by: Isaac
AarushiShah-db
approved these changes
Jun 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two Windows-only bugs broke
ucode claude/ucode codex:#173 — garbled, split-screen terminal input. Both agents launched via os.execvp, but Windows has no real exec: the CRT spawns a new process and kills the parent, so the launching shell resumes and fights the agent for the console. New launcher.exec_or_spawn() keeps execvp on POSIX and spawns+waits (propagating exit code / SIGINT) on Windows, matching the pattern the token-refreshing agents already use.
#116 — apiKeyHelper failed with a POSIX shell error. build_auth_shell_command emitted
if [ -n ... ]; ... | jqand Codex ran it viash -c; neither sh nor jq exists on Windows. Replaced with a hiddenucode auth-tokencommand that prints the bearer via get_databricks_token (which already owns the DATABRICKS_BEARER short-circuit and PAT path). Claude's apiKeyHelper and Codex's auth block now invoke that executable directly as argv — no shell, no jq, identical on every platform.Also hardens the --use-pat path: ensure_pat_bearer() treats an empty DATABRICKS_BEARER as absent (setdefault would let it shadow the PAT and force OAuth, which can't serve a PAT-only profile), and
auth-token --use-patfails closed with an actionable error instead of silently trying OAuth.