Skip to content

fix: restore latest build launch behavior#21

Merged
nisavid merged 23 commits intomainfrom
fix-black-window-latest-build
May 3, 2026
Merged

fix: restore latest build launch behavior#21
nisavid merged 23 commits intomainfrom
fix-black-window-latest-build

Conversation

@nisavid
Copy link
Copy Markdown
Owner

@nisavid nisavid commented May 3, 2026

Summary

Merge the latest upstream main into this fork and rebase the launch-fix branch on top of it. The upstream sync brings the current Linux quit-guard fallback, launcher startup scan improvements, Browser Use plugin fallback fixes, Fedora package-format detection cleanup, and Linux Computer Use accessibility updates while preserving this fork's codex-app identity, package layout, updater naming, and release/security gates.

The branch also fixes two launch regressions seen with the latest DMG build. First, the installer was extracting webview assets into the temporary DMG app tree instead of the generated Linux app tree, which left packaged launches without the local webview bundle and could produce an apparently launched but unusable black window. Second, the Linux quit-state helper could be emitted inside a startup helper block, while top-level tray/window classes referenced it during quit handling. That made the tray quit path unreliable and could leave a stale app process and tray icon behind.

Details

The upstream merge is preserved as a merge commit through upstream 2b3bd253cd9e9fa3d149a666db70c931aca3f30a, with conflict resolutions in the Makefile, Linux Computer Use backend, launcher, ASAR patcher, and smoke tests. Resolutions keep upstream's new semantic accessibility selectors and launcher scan behavior, while retaining fork-specific package detection, names, zypper handling, updater paths, and codex-app wording.

The installer fix sends extract_webview to the generated install directory and makes the launcher fail fast if the webview bundle is missing. The ASAR patcher fix keeps the Linux quit guard module-scoped, handles upstream's broader Electron-require fallback, and adds regression coverage that the guard is declared before top-level tray references.

Verification

  • node --check scripts/patch-linux-window-ui.js
  • node --test scripts/patch-linux-window-ui.test.js
  • bash -n launcher/start.sh.template tests/scripts_smoke.sh install.sh scripts/lib/webview-install.sh
  • bash tests/scripts_smoke.sh
  • cargo fmt --manifest-path computer-use-linux/Cargo.toml --check
  • cargo test --manifest-path computer-use-linux/Cargo.toml
  • stat -c '%n %Y %y' Codex.dmg confirmed the cached DMG was from 2026-05-03 01:54:45 -0400, under 24 hours old at build time.
  • make build-app DMG=Codex.dmg
  • test -s codex-app/content/webview/index.html
  • make pacman DMG=Codex.dmg

Built package: dist/codex-app-26.429.30905-1-x86_64.pkg.tar.zst.

Summary by CodeRabbit

  • New Features
    • Auto-detect Linux package format for build/install flows; unified package script routing.
    • Semantic element selectors (role, name, text, states) for UI actions.
    • Plugin cache sync on cold starts; staged browser-plugin handling with Node REPL runtime fallback and auto-approval.
  • Bug Fixes
    • Improved accessibility: serialized states, richer text/caret/selection, bounds normalization, and compacted accessibility trees.
    • More reliable webview extraction/installation and webview-server reuse; launcher warm-start improvements.
    • Fixed distro/package-manager detection priority; installer targets install directory.
  • Documentation
    • Added troubleshooting entry for missing/empty webview bundle; updated divergence baseline.
  • Tests
    • Added/expanded smoke and unit tests for installer, plugin fallbacks, tree compaction, patching, and launch flows.

avifenesh and others added 18 commits May 2, 2026 10:24
…r-use-atspi-readback

feat(computer-use): compact Linux AT-SPI state readback
…ackage-detection-clean

[codex] fix Fedora package format detection
…l-fallback

Fix Browser Use node_repl fallback install
Stage the upstream Browser Use plugin into Linux installs, sync the bundled copy into the Codex plugin cache on cold start, and keep the Linux node_repl/js bridge approved for the app-provided Browser Use server.

Patch browser-client.mjs during staging so a Linux nodeRepl.fetch allowlist failure for the ChatGPT site_status preflight falls back to the existing Browser Use approval settings instead of blocking navigation before local allowed/blocked domain checks can run.

Add smoke coverage for the patched Browser Use client and keep the existing patcher coverage for the node_repl approval config.
…tus-allowlist

Fix Browser Use site_status allowlist fallback on Linux
Avoid full /proc scans during the normal cold-start path. The launcher now trusts app and webview pid files first, only scans for an already-running Electron process when the warm-start socket exists, and only performs webview discovery or stale-server cleanup when the webview port is actually in use.

This keeps the defensive fallback behavior for stale ports and second-instance handoff while reducing startup overhead on systems with many processes.

Validation: bash -n launcher/start.sh.template tests/scripts_smoke.sh; ./tests/scripts_smoke.sh; git diff --check
…c-scans

Speed up launcher startup checks
Ensure the Linux quit-state helper is still injected when the current upstream main bundle no longer matches the older electron/path/fs require pattern. Without the helper, later tray and close-to-tray patches can leave references to codexLinuxIsQuitInProgress() that crash the Electron main process when closing a window.

Add regression coverage for bundles where only the Electron require is recognizable.

Validation: node --test scripts/patch-linux-window-ui.test.js; ./tests/scripts_smoke.sh; git diff --check
* upstream/main:
  Fix Linux quit guard patch fallback
  Speed up launcher startup checks
  Fix Browser Use Linux allowlist fallback
  Fix Browser Use node_repl fallback install
  tighten distro package detection
  fix Fedora package format detection
  feat(computer-use): add semantic element selectors
  feat(computer-use): compact Linux accessibility trees
  feat(computer-use): enrich Linux AT-SPI state readback

# Conflicts:
#       Makefile
#       computer-use-linux/src/atspi_tree.rs
#       computer-use-linux/src/server.rs
#       launcher/start.sh.template
#       scripts/patch-linux-window-ui.js
#       scripts/patch-linux-window-ui.test.js
#       tests/scripts_smoke.sh

Co-authored-by: Codex <noreply@openai.com>
Extract the ASAR webview into the generated Linux app tree instead of the temporary DMG app tree, and fail fast when a generated app is missing the bundle. Add smoke coverage for the extraction target.

Co-authored-by: Codex <noreply@openai.com>
Keep the Linux quit-state helper at module scope so top-level tray and window classes can call it after startup. Add regression coverage for helper ordering in patched bundles.

Co-authored-by: Codex <noreply@openai.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 3, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Centralizes native package-format detection in the Makefile; adds AT‑SPI state and capped text readback, semantic element selectors, and tree compaction for accessibility resolution; refactors launcher webview/plugin-cache and bundled-plugin staging with ELF/Node‑REPL fallbacks; expands Linux bundle patching and tests; updates installer/webview extraction and updater package-kind priority.

Changes

Accessibility Tree Enhancement

Layer / File(s) Summary
Data Shape
computer-use-linux/src/atspi_tree.rs
AccessibilityNode adds states: Vec<String> and text: Option<AccessibilityText>; new AccessibilityText and AccessibilityTextSelection types and readback caps/constants introduced.
Core Helpers
computer-use-linux/src/atspi_tree.rs
New helpers states_from_proxy, state_labels, text_from_proxies, and normalize_bounds serialize states, extract capped text/selections, and validate bounds.
Node Population
computer-use-linux/src/atspi_tree.rs
read_node now populates states and optional text alongside existing fields.
Server Integration
computer-use-linux/src/server.rs
get_app_state now returns accessibility_tree_raw_count and a compacted accessibility_tree; messages updated to report both counts.
Element Addressing
computer-use-linux/src/server.rs
ClickParams/ActionParams/SetValueParams extended with role, name, text, states enabling semantic selector usage.
Resolution Logic
computer-use-linux/src/server.rs
Introduced ElementSelector and ElementResolvePurpose; resolve_cached_node/resolve_semantic_node implement purpose-aware matching, preference heuristics, and ambiguity errors.
Click Targeting
computer-use-linux/src/server.rs
resolve_click_target prefers cached actionable bounds for coordinates, restricts non-plain clicks without bounds, and falls back to AT‑SPI primary action for plain left-clicks.
Tree Compaction
computer-use-linux/src/server.rs
compact_accessibility_tree filters noise, reindexes nodes, reparents kept nodes to nearest kept ancestor, and recomputes child_count.
Tests
computer-use-linux/src/
Unit tests added/updated for state-label ordering, tree compaction, semantic selector resolution, ambiguity, and click-resolution behaviors.

Launcher, Webview & Bundled Plugins

Layer / File(s) Summary
Webview Extraction
install.sh, scripts/lib/webview-install.sh
extract_webview call changed to extract_webview "$INSTALL_DIR"; function param renamed to install_dir and target path uses install_dir/content/webview.
Plugin Cache Sync
launcher/start.sh.template
Added browser_use_plugin_version() and sync_browser_use_bundled_plugin_cache(); cold-start runs cache sync before resolving Browser Use runtime env.
Warm-Start Discovery
launcher/start.sh.template
detect_warm_start() adds IPC-socket-based discovery and preserves discovered PID for warm-start handoff.
Webview Server Management
launcher/start.sh.template
Added webview_origin_is_reachable, webview_port_is_open, and adopt_discovered_webview_server; ensure_webview_server can adopt discovered servers, fails fast when port serves verified Codex content not owned by this launcher, and adjusts stop/retry sequencing.
Bundled Plugin Staging
scripts/lib/bundled-plugins.sh
Added stage_browser_use_plugin_from_upstream() to copy upstream browser-use plugin, remove macOS sidecars, and apply patch_browser_use_site_status_allowlist_fallback to scripts/browser-client.mjs.
Node REPL Runtime & ELF Check
scripts/lib/bundled-plugins.sh
Replaced ELF check with is_host_linux_elf_executable(file, ARCH) (magic + endianness + e_machine); added install_browser_use_node_repl_resource() which tries candidates and falls back to a primary-runtime archive (x86_64) with SHA256 verification and extraction.
Staging Wiring
scripts/lib/bundled-plugins.sh
install_bundled_plugin_resources now calls stage_browser_use_plugin_from_upstream and install_browser_use_node_repl_resource.
Tests / Smoke
tests/scripts_smoke.sh
Smoke tests added for webview extraction into generated app and node_repl fallback; launcher-template assertions extended for warm-start and webview server behavior; new fake upstream Browser Use app helper added.

Linux Window UI Patching

Layer / File(s) Summary
Quit-Guard Detection
scripts/patch-linux-window-ui.js
Added isLikelyModuleScopeOffset and hasNearbyModuleScopeQuitGuard; applyLinuxQuitGuardPatch now uses position-aware heuristics and can prepend a fallback quit-guard when needed.
Launch-Action Patches
scripts/patch-linux-window-ui.js
Quit-state initialization removed from semantic launch-action templates; applyLinuxQuitGuardPatch invoked at multiple control points in applyLinuxLaunchActionArgsPatch.
Browser Use Approval Patch
scripts/patch-linux-window-ui.js
Added and exported applyBrowserUseNodeReplApprovalPatch to inject startup_timeout_sec:120 and tools.js.approval_mode:"approve" into the nodeReplPath tool config (idempotent).
Tests
scripts/patch-linux-window-ui.test.js
Tests ensure quit-guard detection is scope-aware, quit-guard insertion order/idempotence in patchMainBundleSource, and node_repl approval patch behavior and idempotence.

Packaging and Updater

Layer / File(s) Summary
Makefile Auto-Detection
Makefile
Added NATIVE_PKG_FORMAT_CMD that detects pacman/rpm/deb by /etc/os-release ID/ID_LIKE tokens with command-existence fallbacks; package target dispatches to ./scripts/build-{pacman,rpm,deb}.sh based on detected format.
Makefile Install Logic
Makefile
install uses detected format to choose installer: pacman -U --noconfirm; RPM prefers dnf5/dnf then zypper (local .rpm validation) and falls back to sudo rpm -Uvh; DEB tries apt install -y then dpkg -i with apt-get -f install -y fallback.
Updater Detection Priority
updater/src/install.rs
detect_package_kind now prefers /etc/os-release ID/ID_LIKE matching before checking installed package-manager tools; tests updated to assert Fedora/RHEL maps to RPM even when deb tools appear installed.
Docs & Troubleshooting
docs/maintainers/fork-divergences.md, docs/usage/troubleshooting.md
Fork baseline commit updated; troubleshooting entry added for missing/empty webview bundle with regeneration instructions.
Installer Script Change
install.sh
extract_webview call adjusted to pass $INSTALL_DIR so webview is extracted into the install destination.

Sequence Diagram(s)

sequenceDiagram
    participant Client as Client
    participant Server as Server
    participant Cache as CachedNodes
    participant ATSPI as AT-SPI

    Client->>Server: click(params with selector)
    Server->>Cache: build ElementSelector and query cached nodes
    Server->>Server: resolve_semantic_node(selector, purpose=Click)
    alt unique cached actionable match with bounds
        Server->>Client: return coordinate click target (cached bounds)
    else unique cached match without bounds
        Server->>ATSPI: fetch primary AT‑SPI action for node
        Server->>Client: return AT‑SPI action result (plain-click only)
    else multiple matches
        Server->>Client: return ambiguity error with matches
    end
Loading
sequenceDiagram
    participant Launcher as Launcher
    participant FS as Filesystem
    participant Cache as PluginCache
    participant Web as WebviewServer

    Launcher->>Launcher: detect cold start?
    alt cold start
        Launcher->>FS: read bundled plugin.json -> version
        Launcher->>Cache: compare bundled browser-client.mjs with cached
        alt mismatch
            Launcher->>FS: stage bundled plugin, remove macOS sidecars, patch client
            Launcher->>Cache: move staged dir to versioned cache
        end
    end
    Launcher->>Web: ensure_webview_server()
    alt port open & origin reachable
        Launcher->>Launcher: adopt_discovered_webview_server()
    else port serving verified content but not owned
        Launcher->>Launcher: fail fast and exit
    end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

Poem

🐰 I nibble nodes and hop through trees,

States and text tucked in my leaves.
I cache a plugin, patch the line,
Extract the webview, mark it fine.
Then sniff for packages — hop, install with ease!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 23.15% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix: restore latest build launch behavior' directly addresses the main objectives: fixing two launch regressions (webview extraction location and Linux quit-state placement) that affected the latest DMG build, which are the primary issues resolved by this PR.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


Comment @coderabbitai help to get the list of available commands and usage tips.

@nisavid nisavid marked this pull request as ready for review May 3, 2026 08:38
Copilot AI review requested due to automatic review settings May 3, 2026 08:38
Copy link
Copy Markdown

@greptile-apps greptile-apps Bot left a comment

Choose a reason for hiding this comment

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

nisavid has reached the 50-review limit for trial accounts. To continue receiving code reviews, upgrade your plan.

Copy link
Copy Markdown

Copilot AI left a comment

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 merges the latest upstream main into the fork and restores correct packaged launch behavior on Linux by fixing webview extraction targeting and ensuring the Linux quit-guard is reliably module-scoped. It also brings in upstream improvements around launcher warm-start scanning, Browser Use fallback/runtime handling, Fedora package-format detection cleanup, and Linux Computer Use accessibility/selector updates.

Changes:

  • Fix installer to extract/copy the webview bundle into the generated app tree and make the launcher fail fast when the bundle is missing.
  • Make Linux quit-guard insertion more robust (including ordering before tray references) and expand patcher/smoke-test coverage.
  • Improve Browser Use staging and node_repl runtime fallback behavior; enhance Linux Computer Use accessibility tree output and add semantic selector support.

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
updater/src/install.rs Adjusts package-kind detection priority (OS release before installed package signals) and adds Fedora regression coverage.
tests/scripts_smoke.sh Adds smoke coverage for webview extraction target, Browser Use node_repl fallback runtime, and quit-guard ordering/extraction assertions.
scripts/patch-linux-window-ui.test.js Adds unit tests for quit-guard insertion fallback paths, tray reference ordering, and Browser Use node_repl approval patch.
scripts/patch-linux-window-ui.js Improves quit-guard patch robustness, ensures quit-guard is applied for launch-action patch paths, and adds Browser Use node_repl approval patch.
scripts/lib/webview-install.sh Changes extract_webview to target the generated install directory’s content/webview.
scripts/lib/bundled-plugins.sh Improves Linux ELF validation for node/node_repl, stages Browser Use more safely, patches Browser Use allowlist fallback, and adds node_repl runtime archive fallback.
launcher/start.sh.template Improves warm-start PID detection, adds webview port/origin checks + fast-fail for missing bundles, and syncs bundled Browser Use plugin cache on cold starts.
install.sh Calls extract_webview with $INSTALL_DIR (generated app tree) instead of DMG app dir.
docs/usage/troubleshooting.md Documents the new “webview bundle is missing or empty” failure mode and remediation.
docs/maintainers/fork-divergences.md Updates upstream baseline hash/date to the new synced upstream commit.
computer-use-linux/src/server.rs Compacts the accessibility tree, reports raw vs compacted counts, and adds semantic selector support for click/action/set_value.
computer-use-linux/src/atspi_tree.rs Adds node state/text extraction, normalizes bounds, and extends tests.
Makefile Adds distro/package-format auto-detection via /etc/os-release + tool fallback for make package and make install.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread scripts/lib/bundled-plugins.sh Outdated
Comment thread scripts/patch-linux-window-ui.js Outdated
Use a fork-scoped Browser Use runtime cache path and remove an unreachable quit-guard warning branch. Add smoke coverage for the cache identity contract.

Co-authored-by: Codex <noreply@openai.com>
Copy link
Copy Markdown

@greptile-apps greptile-apps Bot left a comment

Choose a reason for hiding this comment

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

nisavid has reached the 50-review limit for trial accounts. To continue receiving code reviews, upgrade your plan.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 4

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@computer-use-linux/src/server.rs`:
- Around line 1672-1674: Rename the function is_sentinel_or_missing_bounds to
is_missing_bounds since it only checks for None; update the function definition
(is_sentinel_or_missing_bounds -> is_missing_bounds) and replace all call sites
that reference is_sentinel_or_missing_bounds (e.g., the usage in the surrounding
logic that currently calls is_sentinel_or_missing_bounds) to call
is_missing_bounds instead so name matches behavior.

In `@Makefile`:
- Around line 224-230: The RPM install branch in the Makefile checks only for
`dnf` and misses systems with `dnf5`; update the conditional that currently
tests `command -v dnf` to also accept `dnf5` (e.g., check for `dnf` or `dnf5`)
so the branch that defines `rpm` (using `RPM`/`RPM_GLOB`) and runs `sudo dnf
install -y "$$rpm"` will execute when `dnf5` is present; ensure the chosen
command variable (or command invocation) uses the detected binary name so `dnf5`
is invoked instead of falling back to raw `rpm -Uvh`.

In `@scripts/lib/bundled-plugins.sh`:
- Around line 172-173: The fallback cache path uses "codex-desktop" and must
instead use this fork's namespace "codex-app": update the cache_dir assignment
that builds from CODEX_BROWSER_USE_RUNTIME_CACHE_DIR/XDG_CACHE_HOME/HOME to
replace the hardcoded segment "/codex-desktop/browser-use" with
"/codex-app/browser-use" so the variables cache_dir and archive continue to work
but store under codex-app; ensure you only change that string (refer to the
cache_dir variable and the subsequent archive="$cache_dir/$(basename "$url")"
use).

In `@scripts/patch-linux-window-ui.js`:
- Around line 916-923: The current early-return accepts any occurrence of "let
codexLinuxQuitInProgress=!1" even if it's nested; update the check so
quitGuardIndex is only treated as present when it's at module scope: after
finding quitGuardIndex, compute brace balance for patchedSource.slice(0,
quitGuardIndex) and only consider the guard valid if the count of '{' equals the
count of '}' (i.e., not inside an open block); keep the existing
electronRequireIndex and require(`electron`) checks and only early-return when
quitGuardIndex !== -1 AND (quitGuardIndex < electronRequireIndex ||
electronRequireIndex - quitGuardIndex < 1000) AND the brace-balance test passes,
ensuring codexLinuxIsQuitInProgress() references the module-scope guard.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 566d8b46-f698-44b5-938a-148c45262efe

📥 Commits

Reviewing files that changed from the base of the PR and between 678a8d3 and aa2c3af.

📒 Files selected for processing (13)
  • Makefile
  • computer-use-linux/src/atspi_tree.rs
  • computer-use-linux/src/server.rs
  • docs/maintainers/fork-divergences.md
  • docs/usage/troubleshooting.md
  • install.sh
  • launcher/start.sh.template
  • scripts/lib/bundled-plugins.sh
  • scripts/lib/webview-install.sh
  • scripts/patch-linux-window-ui.js
  • scripts/patch-linux-window-ui.test.js
  • tests/scripts_smoke.sh
  • updater/src/install.rs

Comment thread computer-use-linux/src/server.rs Outdated
Comment thread Makefile Outdated
Comment thread scripts/lib/bundled-plugins.sh Outdated
Comment thread scripts/patch-linux-window-ui.js
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

♻️ Duplicate comments (2)
tests/scripts_smoke.sh (1)

813-813: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Keep the smoke fixture on the fork namespace.

This reintroduces codex-desktop in a .sh file. Since the variable is unused here, it only normalizes the upstream name in the test surface instead of helping catch regressions.

As per coding guidelines, "Preserve this fork's intentional names: the app, install roots, launchers, package names, desktop files, and XDG app state use codex-app; the updater crate, binary, service, config, state, cache, and logs use codex-app-updater. Do not adopt upstream names during syncs."

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@tests/scripts_smoke.sh` at line 813, The smoke test sets CODEX_APP_ID to the
upstream name "codex-desktop" but per our fork policy it must remain
"codex-app"; update the assignment of the variable CODEX_APP_ID in
tests/scripts_smoke.sh (the line currently setting CODEX_APP_ID="codex-desktop")
to use "codex-app" so the fixture preserves the fork's intentional app name.
scripts/patch-linux-window-ui.js (1)

916-922: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Don't treat nested quit guards as "already patched".

indexOf("let codexLinuxQuitInProgress=!1") still matches stale nested guards. If that match happens before the Electron import, this early return skips the required module-scope injection and the top-level tray/launch helpers can call codexLinuxIsQuitInProgress() out of scope.

Suggested fix
   const electronRequireIndex = patchedSource.indexOf("require(`electron`)");
   const quitGuardIndex = patchedSource.indexOf("let codexLinuxQuitInProgress=!1");
+  const quitGuardIsTopLevel = quitGuardIndex === -1
+    ? false
+    : (() => {
+        const prefix = patchedSource.slice(0, quitGuardIndex);
+        let depth = 0;
+        for (const char of prefix) {
+          if (char === "{") depth += 1;
+          if (char === "}") depth -= 1;
+        }
+        return depth === 0;
+      })();
   if (
     electronRequireIndex !== -1 &&
     quitGuardIndex !== -1 &&
-    (quitGuardIndex < electronRequireIndex || quitGuardIndex - electronRequireIndex < 1000)
+    quitGuardIsTopLevel &&
+    (quitGuardIndex < electronRequireIndex || quitGuardIndex - electronRequireIndex < 1000)
   ) {
     return patchedSource;
   }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@scripts/patch-linux-window-ui.js` around lines 916 - 922, The current check
treats any earlier occurrence of "let codexLinuxQuitInProgress=!1" as "already
patched" even if it's a stale nested guard; update the if-condition around
patchedSource, electronRequireIndex and quitGuardIndex so that you only consider
the guard as a valid existing module-scope guard when quitGuardIndex is after
the Electron import and within the expected proximity (i.e., require
quitGuardIndex !== -1 && quitGuardIndex > electronRequireIndex && quitGuardIndex
- electronRequireIndex < 1000), otherwise proceed with the module-scope
injection so codexLinuxIsQuitInProgress() and the top-level tray/launch helpers
are defined in the correct scope.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@scripts/lib/bundled-plugins.sh`:
- Around line 178-185: The curl call that downloads the Browser Use node_repl
fallback (the block that checks if [ ! -f "$archive" ] and calls curl -L --fail
--progress-bar -o "$archive.part" "$url") needs timeout and retry bounds so a
stalled connection won't hang installation; replace the single curl invocation
with a bounded retry (e.g., 3 attempts) and explicit timeouts (use
--connect-timeout and --max-time and/or --retry and --retry-delay or loop with
sleep between attempts), keep writing to "$archive.part" and rm -f
"$archive.part" on each failed attempt, and if all attempts fail ensure you warn
"Failed to download Browser Use node_repl fallback runtime" and return 1 as
currently done.

In `@scripts/patch-linux-window-ui.js`:
- Around line 1345-1353: The current replace uses a broad needle
("startup_timeout_sec:120,env:{") which can match other MCP server blocks;
instead locate the specific Browser Use node_repl block first (e.g., find the
node_repl object that contains the "Browser Use" label) and only inject
approvalPatch into that block. Update the logic around currentSource, needle and
approvalPatch so you: (1) find the start/end of the node_repl block that
mentions "Browser Use", (2) ensure the needle occurs inside that block, and (3)
apply replacement only within that substring (then splice it back into
currentSource) rather than calling currentSource.replace globally. Use the
existing variable names (needle, currentSource, approvalPatch, node_repl/Browser
Use identifier) to locate and modify the correct region.

---

Duplicate comments:
In `@scripts/patch-linux-window-ui.js`:
- Around line 916-922: The current check treats any earlier occurrence of "let
codexLinuxQuitInProgress=!1" as "already patched" even if it's a stale nested
guard; update the if-condition around patchedSource, electronRequireIndex and
quitGuardIndex so that you only consider the guard as a valid existing
module-scope guard when quitGuardIndex is after the Electron import and within
the expected proximity (i.e., require quitGuardIndex !== -1 && quitGuardIndex >
electronRequireIndex && quitGuardIndex - electronRequireIndex < 1000), otherwise
proceed with the module-scope injection so codexLinuxIsQuitInProgress() and the
top-level tray/launch helpers are defined in the correct scope.

In `@tests/scripts_smoke.sh`:
- Line 813: The smoke test sets CODEX_APP_ID to the upstream name
"codex-desktop" but per our fork policy it must remain "codex-app"; update the
assignment of the variable CODEX_APP_ID in tests/scripts_smoke.sh (the line
currently setting CODEX_APP_ID="codex-desktop") to use "codex-app" so the
fixture preserves the fork's intentional app name.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: b7a227bb-ca63-4e90-a8b5-6146f9dec2b5

📥 Commits

Reviewing files that changed from the base of the PR and between aa2c3af and 0c62183.

📒 Files selected for processing (3)
  • scripts/lib/bundled-plugins.sh
  • scripts/patch-linux-window-ui.js
  • tests/scripts_smoke.sh

Comment thread scripts/lib/bundled-plugins.sh
Comment thread scripts/patch-linux-window-ui.js Outdated
Handle dnf5 installs before falling back to raw RPM paths, bound Browser Use runtime downloads, and scope ASAR patcher idempotency to the intended module-level and Browser Use node_repl targets.

Co-authored-by: Codex <noreply@openai.com>
Copilot AI review requested due to automatic review settings May 3, 2026 09:00
Copy link
Copy Markdown

@greptile-apps greptile-apps Bot left a comment

Choose a reason for hiding this comment

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

nisavid has reached the 50-review limit for trial accounts. To continue receiving code reviews, upgrade your plan.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 13 out of 13 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@Makefile`:
- Around line 22-56: The fallback logic in NATIVE_PKG_FORMAT_CMD uses rpmbuild
(in the series of command -v checks) which is a build tool and mismatches the
updater's runtime detection; update the fallback checks inside
NATIVE_PKG_FORMAT_CMD (the command -v branches that currently test for rpmbuild)
to test for actual RPM install/runtime tools such as dnf, dnf5, zypper, or rpm
instead so the format variable is set to "rpm" when an RPM package manager is
available; keep os_release_token_match and the format variable usage unchanged,
only replace the rpmbuild occurrences in the fallback detection to align with
updater/src/install.rs behavior.
- Around line 257-263: The Makefile install branch for DEB packages uses sudo
dpkg -i which doesn't resolve dependencies; update the deb install logic (the
block using variables DEB and DEB_GLOB and the "$$deb" selection) to first
attempt a dependency-resolving install with sudo apt install -y "./$$deb" (or
sudo apt install -y /path/to/$$deb) and, if that fails or apt is unavailable,
fall back to sudo dpkg -i "$$deb" followed by sudo apt-get -f install -y to fix
missing dependencies; ensure the echo/log lines remain descriptive and preserve
the same variable names (DEB, DEB_GLOB, $$deb) so the change integrates cleanly.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 5e2f0b5b-9856-46c3-a8b0-7d2e4be20ac1

📥 Commits

Reviewing files that changed from the base of the PR and between 0c62183 and 687304a.

📒 Files selected for processing (6)
  • Makefile
  • computer-use-linux/src/server.rs
  • scripts/lib/bundled-plugins.sh
  • scripts/patch-linux-window-ui.js
  • scripts/patch-linux-window-ui.test.js
  • tests/scripts_smoke.sh

Comment thread Makefile
Comment thread Makefile Outdated
Detect RPM package formats through runtime install tools and prefer apt for Debian package installs before falling back to dpkg dependency repair.

Co-authored-by: Codex <noreply@openai.com>
Copy link
Copy Markdown

@greptile-apps greptile-apps Bot left a comment

Choose a reason for hiding this comment

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

nisavid has reached the 50-review limit for trial accounts. To continue receiving code reviews, upgrade your plan.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@Makefile`:
- Around line 43-55: The shell conditional that sets the format variable
contains unreachable duplicate branches; remove the redundant final elif blocks
that re-check rpm/pacman (the duplicate branches after the dpkg-deb check) and
keep a single, clear ordering of checks that sets format (e.g., check pacman
with !dpkg-deb, then rpm/dnf/zypper with !dpkg-deb, then dpkg-deb as the dpkg
case). Update the conditional that assigns format so there are no duplicated
rpm/pacman branches and the logic is deterministic.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 0f872999-ad91-4b82-86b2-8eab87c15eb7

📥 Commits

Reviewing files that changed from the base of the PR and between 687304a and 201a674.

📒 Files selected for processing (2)
  • Makefile
  • tests/scripts_smoke.sh

Comment thread Makefile
Remove unreachable duplicate RPM and pacman fallback branches after the Debian package-tool check.

Co-authored-by: Codex <noreply@openai.com>
Copilot AI review requested due to automatic review settings May 3, 2026 09:14
Copy link
Copy Markdown

@greptile-apps greptile-apps Bot left a comment

Choose a reason for hiding this comment

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

nisavid has reached the 50-review limit for trial accounts. To continue receiving code reviews, upgrade your plan.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@Makefile`:
- Around line 268-271: The Makefile recipe currently runs an unguarded sudo dpkg
-i "$$deb" (when $$installed equals 0) which will cause the shell to exit early
under -e if dependency errors occur; replace that single unguarded dpkg
invocation with a guarded conditional (keeping the same $$deb and $$installed
checks) so that a non-zero exit from dpkg does not stop the recipe and the
subsequent apt-get -f install -y repair step still runs (i.e., run dpkg in a
conditional or OR-fallback that swallows failure and allows the apt-get -f
install branch to execute).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 08f98125-2362-4e1e-a5ab-f1177c928fec

📥 Commits

Reviewing files that changed from the base of the PR and between 201a674 and c3ad728.

📒 Files selected for processing (1)
  • Makefile

Comment thread Makefile
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 13 out of 13 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread computer-use-linux/src/server.rs
Guard dpkg fallback so dependency repair can run, and recompute compacted accessibility node depths from their remapped parent chains.

Co-authored-by: Codex <noreply@openai.com>
Copy link
Copy Markdown

@greptile-apps greptile-apps Bot left a comment

Choose a reason for hiding this comment

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

nisavid has reached the 50-review limit for trial accounts. To continue receiving code reviews, upgrade your plan.

@nisavid nisavid merged commit 43669e6 into main May 3, 2026
14 checks passed
@nisavid nisavid deleted the fix-black-window-latest-build branch May 3, 2026 09:28
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.

5 participants