Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

- The `rusty-alloc` cargo feature on `codewhale-tui` and `codewhale-cli`
opts the binaries into the `rusty_alloc` global allocator (the mimalloc
v2.4.5 architecture remade in pure Rust — no C compiler or build script
on that path) instead of the default mimalloc. It is off by default and
the default build is unchanged; build with
`cargo build -p codewhale-tui --features rusty-alloc` (#5872).
Comment on lines +51 to +56

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.

🔍 Changelog edits bypass merge workflow

Repository policy reserves both changelogs for batched commits on main. Remove these branch changes and regenerate the derived web changelog.

Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

- The `/theme` picker now discovers valid user-authored `custom:<name>`
overlays, previews their colors, highlights the active overlay, and preserves
it when the picker is opened and committed without navigation (#5901).
Expand Down
21 changes: 21 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,12 @@ tracing-appender = "0.2"
tracing-subscriber = { version = "0.3", features = ["env-filter", "fmt"] }
uuid = { version = "1.11", features = ["v4"] }
mimalloc = { version = "0.1", default-features = false }
# Off-by-default alternative to mimalloc behind the `rusty-alloc` feature in
# codewhale-tui / codewhale-cli (#5872): the pure-Rust mimalloc v2.4.5
# remake — no C compiler, no build script on that path. `rusty_alloc-api` is
# the crate's documented surface; it pulls the `rusty_alloc` core transitively
# at the same version.
rusty_alloc-api = "1.1.6"

# The everyday `--release` gate (AGENTS.md pre-push build): optimized but
# fast to produce. Shipping artifacts use `--profile dist` below — fat LTO on
Expand Down
8 changes: 8 additions & 0 deletions crates/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@ description = "Agentic terminal facade for open-source and open-weight coding mo
[lints]
workspace = true

[features]
# Opt-in global-allocator swap (#5872): build on rusty_alloc (the pure-Rust
# mimalloc v2.4.5 remake — no C compiler, no build script) instead of the
# default mimalloc. Off by default; the default build is unchanged.
# Build with: cargo build -p codewhale-cli --features rusty-alloc
rusty-alloc = ["dep:rusty_alloc-api"]

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.

🟡 Rust allocator still requires C toolchain

Enabling rusty-alloc still compiles mandatory mimalloc. Its libmimalloc-sys dependency runs the C build this feature intends to avoid. Builds without a C toolchain still fail.

Prompt for agents
The rusty-alloc feature in crates/cli/Cargo.toml and crates/tui/Cargo.toml only enables rusty_alloc-api. Both crates retain mimalloc as an unconditional dependency, so Cargo still builds mimalloc and libmimalloc-sys, including its C build script, when rusty-alloc is selected. Redesign the allocator features and dependency wiring so a rusty_alloc build excludes mimalloc and its native build dependency while the ordinary default build continues using mimalloc. Update the documented build command if selecting the C-free path requires disabling a default allocator feature, and ensure invalid allocator feature combinations fail clearly.
Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Make mimalloc optional when selecting rusty-alloc

When rusty-alloc is selected, this feature only enables rusty_alloc-api; the unconditional mimalloc dependency at line 51 is still built, and Cargo.lock shows that it pulls libmimalloc-sys, whose dependency on cc invokes the native C build. As a result, the advertised build path for environments without a C toolchain can still fail before using RustyAlloc. Make the allocator dependencies mutually exclusive in both the CLI and TUI manifests while retaining mimalloc as the default.

Useful? React with 👍 / 👎.

Comment on lines +14 to +18

[[bin]]
name = "codewhale"
path = "src/main.rs"
Expand Down Expand Up @@ -42,6 +49,7 @@ rustls.workspace = true
semver.workspace = true
tokio.workspace = true
mimalloc.workspace = true
rusty_alloc-api = { workspace = true, optional = true }
sha2.workspace = true
tempfile.workspace = true
tracing.workspace = true
Expand Down
8 changes: 8 additions & 0 deletions crates/cli/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
// Default allocator: mimalloc. `--features rusty-alloc` swaps it for
// rusty_alloc (pure-Rust mimalloc v2.4.5 remake, #5872); the default build
// is unchanged.
#[cfg(not(feature = "rusty-alloc"))]
#[global_allocator]
static GLOBAL: mimalloc::MiMalloc = mimalloc::MiMalloc;

#[cfg(feature = "rusty-alloc")]
#[global_allocator]
static GLOBAL: rusty_alloc_api::RustyAlloc = rusty_alloc_api::RustyAlloc;

fn main() -> std::process::ExitCode {
// Reset SIGPIPE to SIG_DFL so piping codewhale output into a command that
// exits early (e.g. `codewhale doctor | head`) terminates the process
Expand Down
6 changes: 6 additions & 0 deletions crates/tui/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

- The `rusty-alloc` cargo feature on `codewhale-tui` and `codewhale-cli`
opts the binaries into the `rusty_alloc` global allocator (the mimalloc
v2.4.5 architecture remade in pure Rust — no C compiler or build script
on that path) instead of the default mimalloc. It is off by default and
the default build is unchanged; build with
`cargo build -p codewhale-tui --features rusty-alloc` (#5872).
- The `/theme` picker now discovers valid user-authored `custom:<name>`
overlays, previews their colors, highlights the active overlay, and preserves
it when the picker is opened and committed without navigation (#5901).
Expand Down
6 changes: 6 additions & 0 deletions crates/tui/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ workspace = true
[features]
default = []
long-running-tests = []
# Opt-in global-allocator swap (#5872): build on rusty_alloc (the pure-Rust
# mimalloc v2.4.5 remake — no C compiler, no build script) instead of the
# default mimalloc. Off by default; the default build is unchanged.
# Build with: cargo build -p codewhale-tui --features rusty-alloc
rusty-alloc = ["dep:rusty_alloc-api"]
Comment on lines +17 to +21

[lib]
name = "codewhale_tui"
Expand Down Expand Up @@ -104,6 +109,7 @@ semver.workspace = true
rust-i18n = "4.1.0"
shell-words = "1.1.1"
mimalloc.workspace = true
rusty_alloc-api = { workspace = true, optional = true }

[build-dependencies]
codewhale-build-support = { path = "../build-support", version = "0.9.12" }
Expand Down
8 changes: 8 additions & 0 deletions crates/tui/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
// Default allocator: mimalloc. `--features rusty-alloc` swaps it for
// rusty_alloc (pure-Rust mimalloc v2.4.5 remake, #5872); the default build
// is unchanged.
#[cfg(not(feature = "rusty-alloc"))]
#[global_allocator]
static GLOBAL: mimalloc::MiMalloc = mimalloc::MiMalloc;

#[cfg(feature = "rusty-alloc")]
#[global_allocator]
static GLOBAL: rusty_alloc_api::RustyAlloc = rusty_alloc_api::RustyAlloc;

fn main() -> std::process::ExitCode {
codewhale_tui::run(std::env::args().collect())
}
4 changes: 3 additions & 1 deletion docs/BUILD_PERFORMANCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ Structural facts behind those numbers:
no default features). `cargo tree -d` shows only routine duplicates
(`toml` 0.8/1.1, `thiserror` 1/2, `strum` 0.27/0.28, `syn` 2/3,
`sha2` 0.10/0.11) that come from third-party crates, not from workspace
choices.
choices. The global allocator is mimalloc by default; the off-by-default
`rusty-alloc` cargo feature on `codewhale-tui`/`codewhale-cli` swaps it for
the pure-Rust `rusty_alloc` remake (no C toolchain on that path, #5872).
- `[profile.dev] debug = "line-tables-only"` is already set (#5246) and
Cargo already uses `split-debuginfo = unpacked` on macOS.
- `target/debug` grows past 50 GB only through accumulation across
Expand Down
6 changes: 3 additions & 3 deletions web/lib/changelog.generated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ export const CHANGELOG: ChangelogRelease[] = [
{
"heading": "Added",
"items": [
"The rusty-alloc cargo feature on codewhale-tui and codewhale-cli opts the binaries into the rusty_alloc global allocator (the mimalloc v2.4.5 architecture remade in pure Rust — no C compiler or build script on that path) instead of the default mimalloc. It is off by default and the default build is unchanged; build with cargo build -p codewhale-tui --features rusty-alloc (#5872).",
"The /theme picker now discovers valid user-authored custom:<name> overlays, previews their colors, highlights the active overlay, and preserves it when the picker is opened and committed without navigation (#5901).",
"Compaction has two standing knobs next to [context] in config.toml: [compaction] summary_instructions (appended to the summarizer prompt on every manual and automatic pass; /compact <focus> still composes after it) and [compaction] retained_user_message_tokens (default 20 000, clamped 2 000..=200 000) for the verbatim user-message budget. Both are absent by default and absent means the pre-existing behavior. The /compact receipt names the effective budget and whether…",
"[tools] user_input_max_questions (default 6, 1..=10) and [tools] user_input_max_options (default 4, 2..=10) replace the hard-coded request_user_input limits; the validator, the tool schema and its description read one value, spawned children inherit the parent's ceilings, and a rejected payload names the ceiling it hit and the key to raise (#5949).",
Expand All @@ -57,10 +58,9 @@ export const CHANGELOG: ChangelogRelease[] = [
"codewhale account api-keys create --scope now accepts models:infer alongside account:read and agent:run, and an omitted --scope sends all three explicitly. --use saves the new secret as this machine's local codewhale provider credential in the same secret store codewhale auth uses; nothing is uploaded.",
"sandbox_backend = \"shannon\": shell commands run as signed ShannonNet capability invocations (cap://sandbox/exec) on a worker that may live on another tailnet node. Codewhale opens a Task World per session for its durable codewhale Agent and every command leaves a receipt in shannon trace. New keys sandbox_shannon_home and sandbox_shannon_capability; tool metadata now reports the actual external backend kind instead of always opensandbox.",
"/shannon [world|trace|children] inspects the session's ShannonNet World: agent, projected capabilities, children, and receipts.",
"ShannonNet sub-agents get compiled context: the session's native-memory hits are imported with provenance and the child's projected World decides what it sees (confidential notes never cross); the session World is checkpointed and closed when the backend drops.",
"Sub-agents under delegated authority: with the ShannonNet backend the agent tool spawns a child identity with a World projected from the session World, the child's shell commands are signed as that child, and a join receipt is recorded when it finishes. SandboxBackend::for_child / child_joined default to sharing the parent backend for other backends."
"ShannonNet sub-agents get compiled context: the session's native-memory hits are imported with provenance and the child's projected World decides what it sees (confidential notes never cross); the session World is checkpointed and closed when the backend drops."
],
"itemCount": 13
"itemCount": 14
}
]
},
Expand Down
Loading