Shrink binary size for the standalone oz cli (#9301)

## Description
Reduces the `oz` CLI tarball size by adapting two techniques the WASM
build already uses for the standalone CLI artifact.

**Measured results**:

| Platform | Before (gzipped) | After (gzipped) | Reduction |
|---|---|---|---|
| macOS aarch64 | ~120 MiB | ~48 MiB | **~−60%** |
| Linux x86_64 | 121.5 MiB | ~49 MiB | **~−60%** |

There are two primary changes:
1. No longer bundle any of the async assets into the headless binary
(this drops ~57 MiB of incompressible PNG/JPG bytes from the binary)

2. Introduce a `release-ci` profile that uses `opt-level = s` and `lto =
fat`. This mirrors the release profile we use on wasm. For the CLI
specifically, this should be a no-op for user-perceived latency: `oz
agent run` is wall-clock-dominated by network round-trips to the LLM API
and file I/O, not by CPU-bound inner loops. The 5–15% slowdown that
`-Os` typically incurs on tight numeric loops is invisible next to a
multi-second model response, and a smaller binary actually loads faster
on cold start.


## Agent Mode
- [x] Warp Agent Mode - This PR was created via Warp's AI Agent Mode

## Changelog Entries for Stable

CHANGELOG-OZ: Reduced the `oz` CLI tarball download size by ~60% on both
macOS and Linux.

---------

Co-authored-by: Oz <oz-agent@warp.dev>
This commit is contained in:
Aloke Desai
2026-04-28 17:20:51 -05:00
committed by GitHub
co-authored by Oz
parent 24a96d60c9
commit 929944198c
4 changed files with 42 additions and 5 deletions
+7 -1
View File
@@ -311,7 +311,13 @@ use warpui::{AppContext, SingletonEntity, WindowId};
#[folder = "assets"]
#[include = "bundled/**"] // Should be kept in sync with BUNDLED_ASSETS_DIR.
#[include = "async/**"] // Should be kept in sync with ASYNC_ASSETS_DIR.
#[cfg_attr(target_family = "wasm", exclude = "async/**")] // Excludes take precedence.
#[cfg_attr(target_family = "wasm", exclude = "async/**")]
// Excludes take precedence.
// Standalone CLI builds (the `oz` tarball) are headless and never render the
// onboarding/theme imagery in `async/`, so we exclude those bytes from the
// embedded asset set to keep the CLI binary small — mirroring the carve-out
// already applied for the WASM target above.
#[cfg_attr(feature = "standalone", exclude = "async/**")]
pub struct Assets;
pub static ASSETS: Assets = Assets;