feat(desktop): land the desktop application stack on dev - #5318
Conversation
Consolidates the desktop stack that was carried as a GitHub native stack on top of the macOS menu bar companion. #5196 landed as 38a5ab9 by squash, which detached every child in the chain from its base, so the remaining work is applied here as one branch against the current dev instead of replayed through bases that no longer exist. Carries the standalone binary, the Tauri v2 cross-platform tray and webview shell, the GUI desktop shell integration, the WidgetKit appex bundle, and the signed desktop packaging for DMG, MSI, AppImage and deb. Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com>
|
✅ Deterministic PR hygiene checks passed. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configurationConfiguration used: Repository: lidge-jun/opencodex/.coderabbit.yaml Review profile: ASSERTIVE Plan: Advanced Run ID: ⛔ Files ignored due to path filters (18)
📒 Files selected for processing (143)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
⏳ DRAFT
What to do
Automatic draft conversion failed (token cannot change draft status). Please convert this pull request to a draft manually. The required |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 22175d9c39
ℹ️ 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".
| if [[ "$RUNNER_OS" == "Windows" ]]; then sha256sum "dist/ocx-${RELEASE_VERSION}-${STANDALONE_TARGET}.zip" > "dist/ocx-${RELEASE_VERSION}-${STANDALONE_TARGET}.sha256" | ||
| else sha256sum "dist/ocx-${RELEASE_VERSION}-${STANDALONE_TARGET}.tar.gz" > "dist/ocx-${RELEASE_VERSION}-${STANDALONE_TARGET}.sha256" |
There was a problem hiding this comment.
Generate standalone checksums with release-local paths
These commands hash dist/ocx-..., so each checksum records a filename beginning with dist/. The attachment job later downloads the files into dist/release, changes into that directory, and runs shasum -c; it therefore looks for dist/release/dist/ocx-..., fails before gh release upload, and leaves every non-dry-run release without the new assets. Generate the checksum after changing into dist, or otherwise record only the artifact basename.
Useful? React with 👍 / 👎.
| - name: Setup Rust | ||
| uses: dtolnay/rust-toolchain@02cb101ec7c40f2c49e1d9714d64511d8e1b74de # master | ||
| with: | ||
| toolchain: stable |
There was a problem hiding this comment.
Install both Rust targets before the universal macOS build
The Rust setup installs only the runner's host target, but the macOS matrix later invokes tauri build --target universal-apple-darwin, which compiles both aarch64-apple-darwin and x86_64-apple-darwin. On a fresh hosted runner, the non-host standard library is absent, so the macOS packaging leg fails instead of producing the DMG and updater archive; configure the toolchain action with both targets (or add them explicitly) before the build.
AGENTS.md reference: .github/AGENTS.md:L18-L18
Useful? React with 👍 / 👎.
| export async function handleCompanionRoutes(ctx: ManagementContext): Promise<Response | null> { | ||
| if (ctx.url.pathname === "/api/companion/open-in-browser" && ctx.req.method === "POST") { |
There was a problem hiding this comment.
Require a GUI session before opening the host browser
This new route is registered as session-only, but the handler never checks ctx.principal; in fact, its added test calls it as admin-token and expects success. Consequently, any caller holding the management token—including a remote administrator—can make the proxy host launch browser windows, contrary to the declared dashboard-only boundary. Reject non-gui-session principals before parsing or opening the URL, as the other session-only handlers do.
Useful? React with 👍 / 👎.
| let rendered = format!("{scaled:.decimals$}"); | ||
| return format!( | ||
| "{}{}", | ||
| rendered.trim_end_matches('0').trim_end_matches('.'), |
There was a problem hiding this comment.
Preserve integer trailing zeroes when abbreviating values
When decimals is zero, rendered has no decimal fraction, yet trim_end_matches('0') still removes significant integer zeroes. For example, 100,000 tokens becomes "100" and is rendered as 1K, while 500,000 becomes 5K; the same corruption affects count and high-cost tray/widget metrics. Only trim zeroes from a fractional portion, or skip trimming entirely when decimals == 0.
Useful? React with 👍 / 👎.
| pub async fn usage_summary(&self) -> Result<Value, ProxyError> { | ||
| self.get("/api/usage?range=7d").await | ||
| } |
There was a problem hiding this comment.
Use today's usage range for the tray headline
usage_summary is used exclusively by the tray-title refresh, but it requests seven days of usage. The default tokens headline—and the requests, cost, and template fields—therefore displays seven-day totals rather than today's totals, unlike the legacy companion and the documented desktop/widget behavior. Point this request at range=today (or reuse usage_today) so the tray metric matches its intended period.
Useful? React with 👍 / 👎.
Summary
devas one branch. The macOS menu bar companion landed first as feat(macos): menu bar companion + widget, with CodexBar-style usage monitor integrated into Usage #5196 (38a5ab9fc4eaa223d3d58982b0bc097279138fca), and squashing the bottom of a GitHub native stack detaches every child from its base, so the remaining work is applied against the currentdevrather than replayed through bases that no longer resolve.ocxbinary ([WRONG BRANCH] feat(standalone): compiled npm-freeocxbinary (desktop stack 1/5) #5256), the Tauri v2 cross-platform tray and webview shell (feat(desktop): Tauri v2 cross-platform tray + webview shell (desktop stack 2/5) #5260), the GUI desktop shell integration with shell detection and external launch (feat(gui): desktop shell integration — shell detection, external links, open-in-browser, per-OS install card (desktop stack 3/5) #5287), the WidgetKit appex bundled into the Tauri app (feat(desktop): bundle WidgetKit appex into the Tauri app, Rust snapshot writer, retire Swift menu bar (desktop stack 4/5) #5299), and the signed desktop packaging for DMG, MSI, AppImage and deb (feat(release): desktop packaging (DMG/MSI/AppImage/deb), signed updater, docs (desktop stack 5/5) #5309).Verification
dev; only one file conflicted.src/server/responses/codex-ws-wire.tshad an import collision wheredevadded the request-failure model types and the desktop branch replacedreadFileSyncwithpackageVersion. Both intents are kept: the type import stays andpackageVersionreplaces the now-unusedreadFileSync, which no longer appears in the file.Checklist