fix(launcher): surface curl diagnostics and restore the terminal CLI install prompt#448
Merged
Merged
Conversation
…install prompt Two launcher bugs hid information from terminal users: 1. verify_webview_origin captured curl stderr into a file but read it back with `detail=$(< "$err" 2>/dev/null)`. With an extra redirection this is a null command in bash, so `detail` was always empty and every webview origin failure logged the generic "curl exited non-zero with no diagnostic" fallback instead of the real curl error this code exists to surface. Use `cat` instead. 2. The interactive "Install Codex CLI now? [Y/n]" prompt was unreachable: stdout/stderr are redirected into the launcher log early via `exec >>"$LOG_FILE" 2>&1`, so the later `[ -t 1 ]` check in is_interactive_terminal was always false and terminal launches were routed to the GUI prompt (or a hard exit without an update manager). Capture interactivity before the redirect and talk to /dev/tty when prompting.
ilysenko
approved these changes
Jun 11, 2026
ilysenko
left a comment
Owner
There was a problem hiding this comment.
Reviewed. No blocking issues found; CI is green and the launcher changes are scoped to the source template.
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.
What changed
Two launcher bugs in
launcher/start.sh.templatethat hid information from terminal users:verify_webview_originnever surfaced the captured curl diagnostic. The error file was read back withdetail=$(< "$err" 2>/dev/null). In bash,$(< file)only works as the sole element of a command substitution; with the extra redirection it becomes a null command and produces no output, sodetailwas always empty and every webview-origin failure logged the genericcurl exited non-zero with no diagnosticfallback instead of the real cause (connect refused, timeout, HTTP status, ...) that the comment block above documents as the purpose of this code. Now reads withcat.Empirical check (bash 5.3):
The interactive
Install Codex CLI now? [Y/n]terminal prompt was unreachable. The launcher redirects stdout/stderr into the log early (exec >>"$LOG_FILE" 2>&1), so the later[ -t 1 ]check inis_interactive_terminalwas always false. Terminal launches with a missing CLI were routed to the GUI prompt path, or hard-exited when no update manager is installed — the elaborateprompt_install_missing_cliflow could never run (and itsprintfwould have gone into the log file anyway). Interactivity is now captured before the redirect, and the prompt reads/writes via/dev/tty.Source-of-truth files
launcher/start.sh.template(runtime launcher behavior)tests/scripts_smoke.sh(added template assertions)Validation
bash -noninstall.sh,scripts/lib/*.sh,launcher/start.sh.template, build scripts — cleanbash tests/scripts_smoke.shon this branch in Ubuntu (WSL): All script smoke tests passedmain(baseline)Notes / limitations