Skip to content

feat(desktop): bundle a self-contained Avibe Runtime - #1041

Merged
cyhhao merged 19 commits into
desktopfrom
feature/self-contained-desktop-runtime
Jul 27, 2026
Merged

feat(desktop): bundle a self-contained Avibe Runtime#1041
cyhhao merged 19 commits into
desktopfrom
feature/self-contained-desktop-runtime

Conversation

@cyhhao

@cyhhao cyhhao commented Jul 26, 2026

Copy link
Copy Markdown
Collaborator

Summary

Ship the desktop shell with an app-private, verified Avibe Runtime so a new user does not need to install uv, Python, Node.js, ripgrep, or Codex.

The build pins and verifies CPython, Node.js, the complete target-specific Codex package, Python dependencies, and the Avibe wheel; creates a deterministic Runtime archive; embeds it in the Tauri package; verifies the archive and installed tree before execution; and launches the private interpreter in isolated mode. The Codex CLI, code-mode host, ripgrep sidecar, and platform shell/sandbox resources retain their package layout. A corrupt install is repaired once from the immutable app resource and otherwise fails closed.

Desktop-managed installs no longer offer or perform Python package self-upgrades. Desktop application updates own the Runtime lifecycle: the Controller reports the immutable archive identity, the UI forwards only that authoritative value, matching daemons are adopted, superseded daemons hand over gracefully before service reuse, and old extracted trees are pruned only after the successor is proven ready.

The current review fixes also require the UI and Controller process identities to match before readiness, validate every directly launched Codex helper, suppress backend self-updates for the bundled Codex, expose a localized in-app private-Runtime uninstall action that preserves ~/.avibe, stop every confirmed managed Runtime before deletion while failing closed on unknown ownership, allow inactive corrupt installs to be removed without repair, complete identity handover within the same startup run, and let Python's bounded vibe stop lifecycle remain the single handover timeout authority.

Scenarios

  • D01 cold launch from a clean machine
  • D02 adopt an already-running Runtime
  • D03 Workbench streaming through the packaged Runtime
  • D09 desktop window lifecycle while the Runtime remains independent
  • D10 retry after Runtime startup failure
  • D11 clean install with no system uv, Python, Node.js, ripgrep, or Codex
  • D12 native Windows x64 package path without WSL

Evidence

  • Unit: the broader focused Python desktop/runtime/control-IPC/CLI suite passed 277 tests; the current review fixes pass 177 focused Python tests and 112 Rust tests/doc-tests across the Runtime host and Tauri shell.
  • Contract: strict Runtime manifest, archive hash/size, full installed-tree hash, Unix executable validation, target/entrypoint validation, traversal/symlink/size/count rejection, atomic install, bounded repair, hermetic verification state, portable cross-platform tree ordering, platform-resolved npm launcher, complete Codex target-package preservation, private codex-path precedence, executable ripgrep repair, Controller-owned Runtime identity, version-aware daemon handover including polling-time mismatches, readiness-gated cleanup, explicit uninstall ownership states, inactive corrupt-tree removal, and central-catalog native localization.
  • Scenario: a real packaged macOS arm64 private Runtime completed endpoint, Node, Codex, cold vibe start --no-open-browser, exact /ready, clean vibe stop, and readiness disappearance checks under an isolated AVIBE_HOME. The package verifier now also runs the bundled ripgrep binary.
  • Build: TypeScript/Vite production builds passed; Rust fmt, Clippy with warnings denied, and release Tauri app packaging passed. The resulting arm64 app archive is ad-hoc signed and passes deep strict signature verification.

Distribution scope

The package workflow requires one validated SemVer and stamps it into macOS Apple Silicon DMG, macOS Intel DMG, and Windows x64 NSIS acceptance artifacts. Production release remains gated on Developer ID/notarization for macOS and Authenticode signing for Windows, including the executable Runtime payload before it is archived.

Residual manual checks

  • Install the current macOS Apple Silicon acceptance archive on a clean second Mac and verify first launch, onboarding, Codex auth, one streamed turn with repository search, one native workspace edit, quit/reopen, and Runtime recovery.
  • Run the equivalent clean-machine checks for macOS Intel and Windows x64 artifacts produced by Actions.
  • Verify the final signed/notarized release pipeline before public distribution.

cyhhao commented Jul 26, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

cyhhao commented Jul 26, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

cyhhao commented Jul 26, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

cyhhao commented Jul 26, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@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: 4ab7756b32

ℹ️ 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 desktop/scripts/build-runtime-bundle.py Outdated
Comment thread desktop/runtime-host/src/private_runtime.rs
Comment thread desktop/runtime-host/src/private_runtime.rs
Comment thread desktop/scripts/build-runtime-bundle.py Outdated
Comment thread desktop/runtime-host/src/launcher.rs Outdated
Comment thread vibe/api.py
Comment thread desktop/scripts/build-runtime-bundle.py
Comment thread .github/workflows/desktop-package.yml
cyhhao added 2 commits July 27, 2026 02:00
…untime' into feature/self-contained-desktop-runtime

# Conflicts:
#	.github/workflows/desktop-package.yml
#	desktop/README.md
#	desktop/runtime-host/src/launcher.rs
#	desktop/runtime-host/src/private_runtime.rs
#	desktop/scripts/build-runtime-bundle.py
#	docs/plans/tauri-desktop-vertical-slice.md
#	tests/test_upgrade_flow.py
#	vibe/api.py
#	vibe/cli.py

cyhhao commented Jul 26, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@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: 9e8a6551a1

ℹ️ 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 desktop/scripts/build-runtime-bundle.py Outdated
Comment thread vibe/ui_server.py Outdated
@cyhhao

cyhhao commented Jul 26, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@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: 7909611306

ℹ️ 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 desktop/scripts/build-runtime-bundle.py Outdated
@cyhhao

cyhhao commented Jul 26, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@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: 0cac62dea3

ℹ️ 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 vibe/ui_server.py Outdated
Comment thread desktop/runtime-host/src/private_runtime.rs Outdated
Comment thread desktop/runtime-host/src/launcher.rs
Comment thread desktop/src-tauri/src/lib.rs
Comment thread desktop/runtime-host/src/launcher.rs Outdated

cyhhao commented Jul 26, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@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: ef4fa001a2

ℹ️ 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 desktop/runtime-host/src/launcher.rs Outdated
Comment thread desktop/runtime-host/src/launcher.rs Outdated
Comment thread desktop/src-tauri/src/lib.rs Outdated
Comment thread desktop/runtime-host/src/bootstrap.rs Outdated

cyhhao commented Jul 26, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep them coming!

Reviewed commit: e9a3274d95

ℹ️ 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".

@cyhhao
cyhhao merged commit a78456d into desktop Jul 27, 2026
13 checks passed
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.

1 participant