Skip to content

fix(launcher): include Desktop exit status in early-exit error message - #1352

Merged
iruriQ merged 1 commit into
BytePioneer-AI:mainfrom
koeria:fix/desktop-exited-status
Nov 28, 2026
Merged

iruriQ merged 1 commit into
BytePioneer-AI:mainfrom
koeria:fix/desktop-exited-status

Conversation

@koeria

@koeria koeria commented Nov 28, 2026

Copy link
Copy Markdown
Contributor

Summary

launcher 在 "Codex Desktop exited before starting the codexhost Host chain" 场景下,等待 Host chain 期间检测到 Desktop 根进程退出时,当前错误信息不含退出状态,用户诊断文件(launcher-startup-v1)里也只有一个固定文案,无法区分崩溃类型/退出码。

本 PR 在清理 Desktop 进程前先 try_wait() 捕获退出状态,并将其追加到错误消息中(例如 (exit status: exit code: 1));捕获不到时保持原文案不变。纯诊断信息增强,不改变重试/清理逻辑。

Related issues

fixes #1223

UI Demo

No visual changes: 仅 launcher 错误消息文本,无任何 UI 改动。

Test plan

  • cargo check -p codexhost-launcher 通过
  • cargo clippy -p codexhost-launcher --all-targets -- -D warnings 通过
  • 未实机复现 Windows Desktop 提前退出场景(需要 Windows 环境);改动仅捕获已有子进程退出状态并拼入消息,不影响控制流。

@coderabbitai

coderabbitai Bot commented Nov 28, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • 问题修复
    • Windows 上,如果 Codex Desktop 在 Host 链启动前退出,启动失败提示现在会附带可读取的退出状态,帮助用户了解失败原因。
    • 若无法获取退出状态,仍显示原有错误提示;其他启动失败情况的处理保持不变。

Windows 下,Launcher 在 Host 链启动前检测到 Codex Desktop 退出时,会尝试读取其退出状态。读取成功时,错误信息会附加该状态;读取失败时,错误信息保持原样。

Changes: Desktop 退出诊断

Layer / File(s) Summary
读取并报告退出状态
crates/launcher/src/main.rs
Launcher 在停止 Desktop 前尝试读取退出状态。若 Desktop 在 Host 链启动前退出,且状态可读取,则将状态附加到错误信息;否则保留原错误信息。其他等待结果的处理分支不变。

Estimated code review effort: 1 (Trivial) | ~3 minutes

Change: Feature

Possibly related PRs

Suggested reviewers: bytepioneer-ai

Merge Risk: Minimal · up to 93739

This change adds the Desktop exit status to the launcher error shown when Codex Desktop exits before the Host chain starts, which should make failures easier to diagnose. Behavior is otherwise unchanged and no merge-blocking risk is apparent.

Pre-merge checks: Passed 3 · Inconclusive 1

Failed Failed checks: 1 inconclusive

Check name Status Explanation Resolution
Linked Issues check Inconclusive 关联 Issue #1223 是缺陷报告。Issue 只给出错误文案“Codex Desktop exited before starting the codexhost Host chain”和诊断文件路径,没有验收标准,也没有指定修复方式。PR 描述和 AI 摘要说明:在 Windows 下清理 Desktop 进程前调用 try_wait() 读取退出状态,并把它追加到该错误消息中;读取失败… 需要以下证据之一以完成判断:(1) 可读取的 main.rs 变更 hunk,用于确认 try_wait() 调用位置、消息拼接逻辑和 Windows 条件编译;(2) 作者对 Issue #1223 期望结果的说明,用于确认诊断增强是否满足 Issue 的预期(仅提供错误消息信息,还是需要定位根因)。
Passed Passed checks: 3 passed

Check name Status Explanation
Title check Passed 标题“fix(launcher): include Desktop exit status in early-exit error message”描述了主要变更:在 Desktop 提前退出的错误信息中加入退出状态。该标题与变更集相关,且与 raw_summary 及 PR 目标一致。标题简洁、具体,没有使用模糊词语。
Description check Passed 描述说明了问题背景(Desktop 提前退出时错误信息缺少退出状态)、改动方式(清理前调用 try_wait() 捕获退出状态并追加到消息)、保持不变的行为(捕获失败时保留原文案),并列出了测试计划和关联 issue #1223。该描述与变更集直接相关。
Out of Scope Changes check Passed 根据 PR 描述和 AI 摘要,变更仅涉及 crates/launcher/src/main.rs,约 +5/-1 行,且位于 Desktop 提前退出的错误路径内。摘要明确说明 AppX 重试判断和其他失败结果保持不变,也没有公共声明变更。该变更与 Issue #1223 报告的错误消息直接相关,未发现与关联 Issue 无关的改动。注意:diff 无法直接读取,此结论基于 PR 描述和摘要。
Full details: Linked Issues check

Explanation

关联 Issue #1223 是缺陷报告。Issue 只给出错误文案“Codex Desktop exited before starting the codexhost Host chain”和诊断文件路径,没有验收标准,也没有指定修复方式。PR 描述和 AI 摘要说明:在 Windows 下清理 Desktop 进程前调用 try_wait() 读取退出状态,并把它追加到该错误消息中;读取失败时保持原文案。该描述与 Issue 报告的错误路径一致。但 inspect_repository 的 diff 操作失败(变更 blob 在现有检出中缺失),且 crates/launcher/src/main.rs 的完整内容超过读取上限,因此无法直接核对 try_wait() 调用和消息拼接代码。未测试 Windows 提前退出场景,也未见自动化测试。

Resolution

需要以下证据之一以完成判断:(1) 可读取的 main.rs 变更 hunk,用于确认 try_wait() 调用位置、消息拼接逻辑和 Windows 条件编译;(2) 作者对 Issue #1223 期望结果的说明,用于确认诊断增强是否满足 Issue 的预期(仅提供错误消息信息,还是需要定位根因)。

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
Fix failing CI checks

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 8e81377 and 9373911.

Files selected for processing: 1

  • crates/launcher/src/main.rs

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 6 remain after this review.

Recent review details

Context from checks skipped due to timeout: 8

  • GitHub Check: CodeRabbit
  • GitHub Check: Check windows-latest
  • GitHub Check: Check ubuntu-22.04
  • GitHub Check: Static checks
  • GitHub Check: Vitest
  • GitHub Check: Check macos-26
  • GitHub Check: Web Host tests
  • GitHub Check: Check Linux ARM64
Additional context used

Code guidelines: 1

CLAUDE.md — auto-discovered
Path-based instructions: 1

Source excerpt: Rust owns native launch, process management, update installation, and platform integration.

CodeRabbit inference engine (CLAUDE.md)

Files:

  • crates/launcher/src/main.rs

@iruriQ
iruriQ merged commit 948377a into BytePioneer-AI:main Nov 28, 2026
6 of 8 checks passed
@iruriQ

iruriQ commented Nov 28, 2026

Copy link
Copy Markdown
Collaborator

感谢补充退出状态诊断信息,已合并到 main!

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.

[Bug] Codex Desktop exited before starting the codexhost Host chain

2 participants