Skip to content

feat: add Linux x64 support - #12

Merged
BytePioneer-AI merged 12 commits into
BytePioneer-AI:mainfrom
XWIlluDelu:feat/linux-x64-solid
Aug 15, 2026
Merged

BytePioneer-AI merged 12 commits into
BytePioneer-AI:mainfrom
XWIlluDelu:feat/linux-x64-solid

Conversation

@XWIlluDelu

@XWIlluDelu XWIlluDelu commented Aug 13, 2026 •

Copy link
Copy Markdown
Contributor

中文

这个 PR 为 CodexHost 增加 Linux x64 支持。我使用 Debian GNU/Linux 和官方 ChatGPT .deb 包完成了开发与实机测试。

实机截图

下图是官方 ChatGPT App 在 Linux x64 上通过 CodexHost 使用 Pi 的实际界面。

codexhost-pr-12-linux-evidence

截图只用于展示 GUI。同一请求也出现在 Pi 的 session 记录中,确认它确实路由到了 Pi。Gate A 另行验证了协议转发和进程生命周期。

支持范围

当前支持:

  • x86-64 Linux
  • 安装在 /usr/lib/chatgpt 的官方 ChatGPT .deb 或 .rpm 包
  • 官方 /usr/bin/chatgpt 启动器
  • npm 包 @codexhost/cli-linux-x64

这个 PR 暂不包含 CodexHost 自己的 Linux installer 和 installer 自更新,也不支持 ARM64、Snap、Flatpak、AppImage、其他 ChatGPT 安装路径或没有 /proc 的容器。

实现

  • 校验官方 Linux 包的 metadata、资源文件和 x64 ELF
  • 通过官方 wrapper 启动 App,同时跟踪真实的 ChatGPT Desktop 进程
  • 使用 /proc 中的 PID、启动时间和可执行文件确认进程身份
  • 使用 pidfd 发送信号,不在旧内核上退回到可能命中复用 PID 的做法
  • 清理正常退出、启动失败和信号转发后留下的受管进程
  • 接入 npm 打包、发布目标、Gate A 和 Linux CI

如果发现一个独立运行的 ChatGPT App,CodexHost 会拒绝接管并提示用户先退出它。

测试

  • Node 24 和 npm 11 下的 npm run check
  • 真实 Linux npm tarball 构建、空目录安装、可执行权限检查、codexhost --version 和 codexhost inspect
  • Gate A 协议差分及 Desktop 生命周期测试
  • Chat composer 隔离检查,并用 Pi session 记录确认实际路由
  • GitHub Actions 在 Ubuntu、macOS 和 Windows 上的完整检查;Ubuntu 同时运行 Linux npm package smoke

谢谢

感谢作者做出 CodexHost。让 Pi 和其他 Agent 直接复用 Codex GUI 这个想法真的很酷。

我自己在写 Pi 的 Web GUI,所以很喜欢 CodexHost 选择的这条不同路线。很高兴能贡献这次 Linux 支持。🤝


English

This PR adds Linux x64 support to CodexHost. I developed and tested it on Debian GNU/Linux with the official ChatGPT .deb package.

Screenshot

The screenshot above shows the official ChatGPT App using Pi through CodexHost on Linux x64.

The screenshot is only a visual record of the GUI. The same request appears in the Pi session log, confirming that it was routed to Pi. Gate A separately validates protocol forwarding and process lifecycle behavior.

Supported setup

  • x86-64 Linux
  • the official ChatGPT .deb or .rpm package installed at /usr/lib/chatgpt
  • the official /usr/bin/chatgpt launcher
  • the @codexhost/cli-linux-x64 npm package

This PR does not include a CodexHost Linux installer or installer self-update. ARM64, Snap, Flatpak, AppImage, alternate ChatGPT layouts, and containers without /proc are also outside its scope.

Implementation

  • validate the official Linux package metadata, required resources, and x64 ELF files
  • launch through the official wrapper while tracking the real ChatGPT Desktop process
  • identify processes using their PID, start time, and executable from /proc
  • signal through pidfd without falling back to a PID-only path on older kernels
  • clean up managed processes after normal exit, startup failure, and forwarded signals
  • wire Linux into npm packaging, release targets, Gate A, and CI

CodexHost refuses to take over an independently running ChatGPT App and asks the user to quit it first.

Tests

  • npm run check with Node 24 and npm 11
  • real Linux npm tarball build, clean-directory install, executable permission checks, codexhost --version, and codexhost inspect
  • Gate A protocol differential and Desktop lifecycle coverage
  • Chat composer isolation checks, with the actual Pi route confirmed against the Pi session log
  • full GitHub Actions checks on Ubuntu, macOS, and Windows; Ubuntu also runs the Linux npm package smoke test

Thanks

Thanks to the author for building CodexHost. Letting Pi and other agents reuse the Codex GUI is a really cool idea.

I am working on a Web GUI for Pi, so I enjoyed seeing CodexHost take a different route. I am glad to contribute the Linux support here. 🤝

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ce4b664376

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread crates/launcher/src/runtime_instance.rs Outdated
Comment on lines 112 to 115
#[cfg(target_os = "linux")]
let root = env::var_os("HOME")
.map(PathBuf::from)
.ok_or_else(|| io::Error::new(io::ErrorKind::NotFound, "HOME is unavailable"))?;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep Linux runtime state under the updater root

When running a Linux npm update with the default state directory, the updater writes status under $HOME/.codexhost/updates and then wait_for_relaunch derives the new descriptor path as $HOME/.codexhost/desktop-runtime-v1.json; this Linux branch makes the relaunched Launcher publish desktop-runtime-v1.json under $HOME/codexhost instead. The update can successfully reinstall and relaunch but still time out as failed because it polls the wrong descriptor path, so use the same Linux state root for the Launcher descriptor/guard and the update manager.

AGENTS.md reference: AGENTS.md:L66-L66

Useful? React with 👍 / 👎.

@XWIlluDelu
XWIlluDelu marked this pull request as ready for review August 13, 2026 22:05
Copilot AI lite review requested due to automatic review settings August 13, 2026 22:05
@XWIlluDelu

XWIlluDelu commented Aug 13, 2026 •

Copy link
Copy Markdown
Contributor Author

Linux 现在会把通过 /usr/bin/chatgpt 启动的 launcher 作为一个具体的进程实例来跟踪,记录 PID、启动时间、PGID 和可执行文件。Desktop root 只有两种情况会进入 DesktopSession:launcher 自己 exec 成 Desktop,或 root 是它的后代并留在同一个私有 PGID 中。其他匹配的 root 会中止这次启动。清理只会通过 pidfd 处理已经归属到本次启动的进程。

当兼容性状态为 warning 或 degraded 时,交互终端会显示 Desktop 与 CodexHost 版本、兼容性状态、能力、原因和观察到的 identity。用户可以选择继续一次、继续并记住、打开最新 CodexHost release、启动原生 ChatGPT 或取消。非交互运行、EOF 和无效输入都会取消。只有“继续并记住”会保存确认记录。

runtime descriptor 优先放在 $XDG_RUNTIME_DIR/codexhost;当 XDG_RUNTIME_DIR 未设置时,使用私有用户状态目录。该目录权限为 0700,descriptor、launcher guard 和 acknowledgement 文件为 0600。代码在打开、替换和删除这些文件时都会拒绝 symlink,并检查 owner、类型和权限。删除 descriptor 时还会比较已打开文件的 inode,避免删除被替换后的文件。

测试覆盖独立 root、PID reuse、wrapper exec、fork 后代、非交互兼容性处理、确认记录的持久化、permissive umask、symlink 和 descriptor cleanup。

本地检查:

  • Node 24 / npm 11:npm run check(121 个文件通过,1 个跳过;905 个测试通过,6 个跳过)
  • Linux npm tarball:打包、空目录安装、可执行权限和 codexhost --version
  • cargo check -p codexhost-platform --target x86_64-pc-windows-gnu --locked

GitHub Actions 仍在等待维护者批准 fork PR 的 workflow,因此当前 run 为 action_required,尚未产生 CI 结果。批准后会在 Ubuntu、macOS、Windows 上运行 npm run check,并运行 Linux npm smoke。


Linux now tracks the launcher started through /usr/bin/chatgpt as a concrete process instance: PID, start time, PGID, and executable. A Desktop root enters DesktopSession only when that launcher execs into Desktop, or when the root is its descendant and remains in the same private PGID. Any other matching root stops the launch. Cleanup uses pidfd only for processes already attributed to that launch.

For warning or degraded compatibility states, an interactive terminal shows the Desktop and CodexHost versions, the compatibility state, capability, reason, and observed identity. The choices are continue once, continue and remember, open the latest CodexHost release, launch stock ChatGPT, or cancel. Non-interactive runs, EOF, and invalid input cancel. Only "continue and remember" saves an acknowledgement.

The runtime descriptor prefers $XDG_RUNTIME_DIR/codexhost; when XDG_RUNTIME_DIR is unset, it uses a private user-state directory. That directory is 0700, and the descriptor, launcher guard, and acknowledgement files are 0600. The code rejects symlinks and checks owner, type, and permissions when it opens, replaces, or removes these files. Descriptor cleanup also compares the inode of the open file so it cannot delete a replacement.

Tests cover independent roots, PID reuse, wrapper exec, forked descendants, non-interactive compatibility handling, acknowledgement persistence, permissive umasks, symlinks, and descriptor cleanup.

Local checks:

  • Node 24 / npm 11: npm run check (121 files passed, 1 skipped; 905 tests passed, 6 skipped)
  • Linux npm tarballs: pack, empty-directory install, executable permissions, and codexhost --version
  • cargo check -p codexhost-platform --target x86_64-pc-windows-gnu --locked

GitHub Actions is waiting for maintainer approval before it can run jobs for this fork PR. The current run has action_required and no CI result yet. After approval, it will run npm run check on Ubuntu, macOS, and Windows, plus the Linux npm smoke.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds first-party Linux x64 support across the native Rust launch/supervision layer, Gate A evidence tooling, npm packaging/release automation, and update-manager semantics (Linux supported via npm distribution but not via installers).

Changes:

  • Add Linux desktop discovery + managed launch/supervision (PID/start-time/exe identity via /proc, pidfd signaling, compatibility warning UI, and secure on-disk state/runtime storage).
  • Extend Gate A to run on Linux, including probe capture parsing/sanitization and Linux fixtures/contracts.
  • Add linux-x64 to release targets and CI workflows, plus a Linux npm-package smoke test path (without installer packaging).

Reviewed changes

Copilot reviewed 50 out of 51 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
tools/gate-a/run.mjs Enable Gate A on Linux and add capture-based shim invocation evidence handling.
tools/gate-a/native/src/capture.rs Extend probe capture platform fields for Unix/Linux.
tools/gate-a/native/src/bin/codexhost-probe.rs Add Linux probe flow and shutdown-after-capture option.
tools/gate-a/differential.test.mjs Add differential temp-parent safety test coverage.
tools/gate-a/contracts.mjs Extend Gate A contracts with Linux variants and scenarios.
tools/gate-a/capture.test.mjs Add Linux capture sanitization test coverage.
tools/gate-a/capture.mjs Support sanitizing/parsing Linux raw captures.
tests/release/targets.test.mjs Expand target matrix to include linux-x64 and no-installer expectations.
tests/release/packagers.test.mjs Validate workflow steps for Linux npm build/smoke and installer skipping.
tests/release/npm-publish.test.mjs Include Linux tarball + platform package in npm publish plan.
tests/release/npm-package.test.mjs Add Linux npm target mapping and expected launcher source content.
tests/release/distribution-metadata.test.mjs Allow Linux npm distribution metadata.
tests/fixtures/gate-a/linux/desktop-shim-invocation.fixture.json Add Linux Gate A shim invocation fixture.
tests/fixtures/gate-a/linux/desktop-interactive.fixture.json Add Linux Gate A interactive evidence fixture.
tests/differential/codex-transparent-proxy.mjs Allow differential runs to place temp dirs under an explicit parent.
scripts/release/targets.mjs Add linux-x64 release target and split installer vs npm target sets.
scripts/release/smoke-npm-package.mjs New script: build + install + verify Linux npm platform + meta packages.
scripts/release/prepare-npm.mjs Add Linux platform package mapping and linux cpu/os handling.
scripts/release/prepare-npm-meta.mjs Update meta-package README text to include Linux.
scripts/release/distribution-metadata.mjs Extend target validation regex to include linux-x64.
README.md Document npm Linux support and clarify installer availability scope.
packages/update-manager/test/distribution.test.ts Ensure Linux npm installations resolve without enabling installer updates.
packages/update-manager/src/github-release.ts Add ReleaseTarget union including Linux (installer targets remain separate).
packages/update-manager/src/distribution.ts Allow Linux targets in distribution metadata + expected-host mapping.
packages/host-runtime/src/update-coordinator.ts Disable installer-update flows for Linux targets while allowing npm installs.
docs/README.en.md Mention Linux npm support and clarify installers are macOS/Windows only.
docs/linux.zh-CN.md New: Chinese Linux support documentation and constraints.
docs/linux.md New: English Linux support documentation and constraints.
crates/updater/src/install.rs Gate installer-specific codepaths/tests to macOS/Windows only.
crates/shim/tests/proxy.rs Add streaming behavior test ensuring response can arrive before stdin EOF.
crates/shim/tests/fixtures/fake-codex-cli.rs Add fake streaming response mode for shim tests; broaden unix cfg.
crates/shim/src/lib.rs Change stream copy loop to flush per chunk and handle EINTR explicitly.
crates/shim/Cargo.toml Enable nix/signal-hook deps for Linux as well as macOS.
crates/platform/src/process.rs Add Linux /proc snapshots, identity checks, pidfd signaling, and root selection logic.
crates/platform/src/process_supervision.rs Extend supervised process group signaling/cleanup behavior to Linux.
crates/platform/src/linux_ui.rs New: Linux compatibility warning TTY prompt UI.
crates/platform/src/linux_installation.rs New: validate official Linux package layout + ELF identity/resources.
crates/platform/src/lib.rs Wire Linux modules/exports and add Linux identity + error variants.
crates/platform/src/installation.rs Refactor shared unix helpers for Linux usage (sha256 + executable validation).
crates/platform/src/desktop_launch.rs Linux managed launch via launcher wrapper + /proc lineage + cleanup.
crates/platform/src/background.rs Extend background detachment support to Linux and tighten unsupported-OS behavior.
crates/platform/Cargo.toml Add Linux deps (rustix/serde/serde_json) and share nix for macOS+Linux.
crates/launcher/src/secure_storage.rs New: Linux secure runtime/state directory + file ops (no symlink, owned perms).
crates/launcher/src/runtime_instance.rs Use secure storage primitives on Linux for runtime descriptor/guard handling.
crates/launcher/src/main.rs Add Linux launch path, Linux compatibility prompt flow, and linux ownership checks.
crates/launcher/src/desktop_attachment.rs Pass installation into ownership acquisition; use per-installation root discovery.
crates/launcher/src/compatibility.rs Persist acknowledgements securely on Linux; include Linux identity in keying.
crates/launcher/Cargo.toml Add Linux-only nix/rustix deps for secure storage.
Cargo.lock Add/update lock entries for new Linux dependencies (rustix, linux-raw-sys, etc.).
.github/workflows/release-packages.yml Add linux-x64 matrix target; skip installer on Linux; add Linux npm smoke step.
.github/workflows/ci.yml New CI workflow running checks on Ubuntu/macOS/Windows + Linux npm smoke test.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +62 to +74
let metadata_path = install_root.join("resources/linux-package-metadata.json");
let metadata_file = File::open(&metadata_path).map_err(|error| {
PlatformError::NotFound(format!(
"ChatGPT Linux package metadata '{}' is unavailable: {error}",
metadata_path.display()
))
})?;
if !metadata_file.metadata()?.is_file() {
return Err(PlatformError::Invalid(format!(
"ChatGPT Linux package metadata '{}' is not a regular package file",
metadata_path.display()
)));
}
Comment thread tools/gate-a/native/src/capture.rs Outdated
Comment on lines +63 to +65
let process_group_id = codexhost_platform::process_snapshot(process_id)
.map_or(0, |process| process.process_group_id);
.expect("capture process must remain inspectable")
.process_group_id;
Comment thread docs/linux.md Outdated
@@ -0,0 +1,35 @@
# Linux support

CodexHost supports x64 Linux through the npm package. Install the official ChatGPT App first, then install CodexHost:
Comment thread docs/linux.zh-CN.md Outdated
@@ -0,0 +1,35 @@
# Linux 支持

CodexHost 通过 npm 包支持 x64 Linux。请先安装官方 ChatGPT App,再安装 CodexHost:
Comment on lines 1083 to 1089
Err(error)
if interactive_running_desktop
&& error.downcast_ref::<UnmanagedDesktopConflict>().is_some() =>
&& (error.downcast_ref::<UnmanagedDesktopConflict>().is_some()
|| error.to_string() == UNMANAGED_DESKTOP_MESSAGE) =>
{
continue;
return Err(error);
}
@XWIlluDelu
XWIlluDelu marked this pull request as draft August 14, 2026 04:23
@XWIlluDelu

XWIlluDelu commented Aug 14, 2026 •

Copy link
Copy Markdown
Contributor Author

我已把 #12 rebase 到最新 main。packages/adapters/grok/src/acp-transport.ts 中原有的一处 Prettier 换行问题,已作为独立的纯格式提交保留在这个分支中,因此不会改变 Linux 实现。

使用仓库锁定的 Node 24.13.1、npm 11.8.0 和 Rust 1.97.1,npm run check 已通过。Linux npm platform 与 meta tarball 也已完成实际构建、空目录安装和命令 smoke;受影响的 Platform 与 Launcher 通过了 Windows x64 交叉检查。

#12 现已转为 Ready。如果方便,烦请维护者批准来自 fork 的 CI workflow;它会在 Ubuntu、macOS 和 Windows 上运行 npm run check,并在 Linux 上运行 npm package smoke。


I rebased #12 onto the latest main. The existing Prettier line-wrapping issue in packages/adapters/grok/src/acp-transport.ts is included here as a separate formatting-only commit, so it does not change the Linux implementation.

With the repository-pinned Node 24.13.1, npm 11.8.0, and Rust 1.97.1, npm run check now passes. I also rebuilt the Linux npm platform and meta tarballs, installed them in an empty directory, ran their command smoke, and cross-checked the affected Platform and Launcher crates for Windows x64.

#12 is now ready for review. When convenient, could a maintainer approve the workflow from this fork? It will run npm run check on Ubuntu, macOS, and Windows, plus the Linux npm package smoke.

@XWIlluDelu
XWIlluDelu marked this pull request as ready for review August 14, 2026 05:37
@XWIlluDelu
XWIlluDelu marked this pull request as draft August 14, 2026 05:43
@XWIlluDelu

XWIlluDelu commented Aug 14, 2026 •

Copy link
Copy Markdown
Contributor Author

抱歉。我在使用 Agent 辅助调试 #12 时,没有正确限制验证环境,错误地把上游 PR Actions 用作了迭代测试,因此产生了多条不必要的 workflow runs。这是我的流程判断失误。

后续验证已转到我 fork 的 staging 分支,并已在那里通过完整矩阵。现在我已向 #12 推送一次清理后的提交序列:去除了 staging 专用触发器、诊断提交和重复历史,只保留实际修复与可重复验证所需的测试。上游的这一次 PR check 已在 Ubuntu、macOS 和 Windows 通过,#12 已转为 Ready for review。若还需后续定位,只会在 fork staging 中进行,再提交一次干净更新。

我没有权限删除上游 runs;如希望清理,拥有写权限的维护者可以在 Actions 页面删除。给你添麻烦了。


Sorry. While using an agent to help debug #12, I failed to constrain the validation environment correctly and mistakenly used upstream PR Actions for iterative testing. That created several unnecessary workflow runs, and it was a process mistake on my side.

Validation then moved to a staging branch in my fork, where the full matrix passed. I have pushed one cleaned commit series to #12: staging-only triggers, diagnostic commits, and duplicate history were removed, while the actual fixes and reproducible verification coverage remain. This one upstream PR check has now passed on Ubuntu, macOS, and Windows, and #12 is ready for review. If anything needs further investigation, it will stay in fork staging until one clean follow-up is ready.

I do not have permission to remove runs from the upstream repository. If you would like them removed, a maintainer with write access can delete them from the Actions page. Sorry for the extra noise.

@XWIlluDelu
XWIlluDelu marked this pull request as ready for review August 14, 2026 08:49
@BytePioneer-AI
BytePioneer-AI merged commit a6f4e36 into BytePioneer-AI:main Aug 15, 2026

@BytePioneer-AI BytePioneer-AI left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary

This is a substantial, carefully structured Linux x64 bring-up: official .deb/.rpm layout checks, /proc identity (PID + start time + executable), pidfd signaling without a PID-only fallback, takeover refusal, XDG-private runtime/state files, npm/CI/release wiring, and Gate A fixtures. Process ownership and launch supervision look intentionally conservative and are covered by focused tests. The dominant risk is the half-wired npm update path: Linux now advertises npm updates, but the launcher derives its update-state directory from the new XDG runtime descriptor location, so it never observes waiting-for-exit. Secondary review pressure is comment volume and a macOS force_stop_desktop refactor that now keys supervision off tree[0] after a PID sort.

Issue counts by severity

  • bugs: 1
  • suggestions: 2
  • nits: 1

release: CodexhostLatestRelease,
): Promise<boolean> {
if (context.metadata.distribution === "npm") return true;
if (context.installation.kind === "npm") return true;

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[bug] Linux npm updates are treated as installable (installation.kind === "npm" returns true; the following linux-x64 guard is dead for real Linux installs). The updater still writes waiting-for-exit under defaultUpdateStateDirectory() ($HOME/.codexhost/updates). The Linux launcher now publishes its runtime descriptor under XDG_RUNTIME_DIR/codexhost (or ~/.local/state/codexhost) and update_state_directory() is derived as that parent plus updates, so should_stop_desktop_for_update() in the new Linux supervise loop never sees the updater status. The helper is also never started on Linux (helper_started = false). Result: the Desktop stays up, the updater waits 180s for the launcher PID, then fails. The new CODEXHOST_RUNTIME_DESCRIPTOR_PATH would make post-relaunch probing work only after the launcher actually exits.

Suggestion: Either disable Linux npm updates until the path is finished (installable() false / start() error, matching the stated out-of-scope self-update), or point launcher update_state_directory() and defaultUpdateStateDirectory("linux") at one durable directory (prefer XDG_STATE_HOME/codexhost/updates, never the ephemeral XDG runtime dir) and cover the waiting-for-exit handshake with a Linux test.

}
signal_processes_checked(&members, nix::sys::signal::Signal::SIGTERM)?;
let mut survivors = members;
let mut observed = ObservedProcessTree::new(tree[0].clone());

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[suggestion] macOS force_stop_desktop now builds ObservedProcessTree from tree[0] after desktop_process_tree sorts by PID. The first SIGTERM still covers every member, but the wait/SIGKILL loop only observes that one root. If tree[0] is a descendant (PID wrap / helper started with a lower PID) or one of several independent roots, survivors outside that subtree can be treated as gone and never receive SIGKILL. Previously the function waited on the full identity-checked member list.

Suggestion: Seed the observed tree from a real Desktop root (desktop_root_snapshots_for_installation / the group leader), or keep one observed tree per root, and wait/kill the original member set rather than tree[0] after a PID sort.

.cloned()
.collect::<Vec<_>>()
});
// The Linux managed-launch group is private when it is created, but a

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[suggestion] This block (and the similar launch-loop comment in desktop_launch.rs) restates the PGID-versus-lineage design and architecture history. Comments in this change set often narrate WHY at essay length instead of naming the invariant.

Suggestion: Collapse to a one-line invariant, e.g. “same-PGID is not ownership; only the root instance and known descendants may be signaled.”

Comment thread docs/linux.md
## Diagnosis

```bash
codexhost inspect

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nit] The doc says shutdown signals are sent only after PID, start time, and executable identity are revalidated. signal_processes now checks same_process_instance (PID + start time) and explicitly does not require the executable to match, so descendants can exec. The Desktop root executable is checked in observe(), not at signal delivery.

Suggestion: Say signals revalidate PID + start time via pidfd, and that only the Desktop root’s executable is re-checked during observation.

BytePioneer-AI added a commit that referenced this pull request Sep 2, 2026
Merge pull request #12 from XWIlluDelu/feat/linux-x64-solid
unlgame pushed a commit to unlgame/codex-host that referenced this pull request Oct 28, 2026
Route only external multi-select groups to an isolated card while preserving native single-choice and approval surfaces. Validate ownership, lifecycle and answers through the existing Host pending-question flow.

Adapt the card, styles and polling foundation from karlorz/codex-host BytePioneer-AI#12 under LGPL-3.0-only, omitting Grok-specific timer and activity features.

Co-authored-by: karlorz <[email protected]>
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.

3 participants