diff --git a/CHANGELOG.md b/CHANGELOG.md index ddc68d0..ea20a56 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] -## [0.26.0] - 2026-06-14 +## [0.26.1] - 2026-06-14 + +### Fixed +- **No more Windows stack overflows from the CLI dispatch.** The command + dispatch sits near Windows' 1 MiB main-thread stack limit (a single added + branch overflowed it). `main` now runs the real work on a 16 MiB worker + thread, so the dispatch can grow safely and a `STATUS_STACK_OVERFLOW` at + startup can't recur. Exit codes and panics still propagate. ### Added - **`/clear` no longer drops the last segment.** A new `SessionEnd` hook (wired diff --git a/Cargo.lock b/Cargo.lock index 9f1a6ef..92c22ed 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2572,7 +2572,7 @@ dependencies = [ [[package]] name = "task-journal-cli" -version = "0.26.0" +version = "0.26.1" dependencies = [ "anyhow", "assert_cmd", @@ -2596,7 +2596,7 @@ dependencies = [ [[package]] name = "task-journal-core" -version = "0.26.0" +version = "0.26.1" dependencies = [ "anyhow", "chrono", @@ -2621,7 +2621,7 @@ dependencies = [ [[package]] name = "task-journal-mcp" -version = "0.26.0" +version = "0.26.1" dependencies = [ "anyhow", "chrono", diff --git a/Cargo.toml b/Cargo.toml index 4a7e783..25733a8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,7 +7,7 @@ members = [ ] [workspace.package] -version = "0.26.0" +version = "0.26.1" edition = "2021" rust-version = "1.88" license = "MIT" diff --git a/crates/tj-cli/Cargo.toml b/crates/tj-cli/Cargo.toml index 3e01243..6d4afd3 100644 --- a/crates/tj-cli/Cargo.toml +++ b/crates/tj-cli/Cargo.toml @@ -23,7 +23,7 @@ default = ["embed"] embed = ["tj-core/embed"] [dependencies] -tj-core = { package = "task-journal-core", version = "0.26.0", path = "../tj-core", default-features = false } +tj-core = { package = "task-journal-core", version = "0.26.1", path = "../tj-core", default-features = false } anyhow = { workspace = true } clap = { workspace = true } tracing = { workspace = true } diff --git a/crates/tj-cli/src/main.rs b/crates/tj-cli/src/main.rs index 3c5a0ca..3b92702 100644 --- a/crates/tj-cli/src/main.rs +++ b/crates/tj-cli/src/main.rs @@ -1076,7 +1076,25 @@ enum PendingCmd { const PENDING_MAX_ATTEMPTS: u32 = 3; +/// Windows' default main-thread stack is 1 MiB and our command dispatch in +/// [`real_main`] sits near that limit — a single added branch overflowed it +/// (STATUS_STACK_OVERFLOW on every command; see `run_session_end_catchup`). +/// Run the real work on a thread with a generous stack so the dispatch can +/// grow safely and this can't recur. Errors and the panic case propagate so +/// the process still exits non-zero on failure. fn main() -> Result<()> { + let handle = std::thread::Builder::new() + .name("tj-main".into()) + .stack_size(16 * 1024 * 1024) + .spawn(real_main) + .context("spawn main worker thread")?; + match handle.join() { + Ok(result) => result, + Err(_) => anyhow::bail!("main worker thread panicked"), + } +} + +fn real_main() -> Result<()> { let cli = Cli::parse(); match cli.command { Commands::Create { diff --git a/crates/tj-mcp/Cargo.toml b/crates/tj-mcp/Cargo.toml index 892f2f0..74b6df6 100644 --- a/crates/tj-mcp/Cargo.toml +++ b/crates/tj-mcp/Cargo.toml @@ -17,7 +17,7 @@ path = "src/main.rs" [dependencies] # Lean: the MCP server doesn't embed yet, so it skips the model2vec backend. -tj-core = { package = "task-journal-core", version = "0.26.0", path = "../tj-core", default-features = false } +tj-core = { package = "task-journal-core", version = "0.26.1", path = "../tj-core", default-features = false } anyhow = { workspace = true } tokio = { workspace = true } tracing = { workspace = true } diff --git a/plugin/.claude-plugin/plugin.json b/plugin/.claude-plugin/plugin.json index 28edd76..ff33e69 100644 --- a/plugin/.claude-plugin/plugin.json +++ b/plugin/.claude-plugin/plugin.json @@ -1,6 +1,6 @@ { "name": "task-journal", - "version": "0.26.0", + "version": "0.26.1", "description": "Append-only journal of AI-coding task reasoning chains: hypotheses, decisions, rejections, evidence. Renders compact resume packs so an agent can pick up a 2-week-old task with full context.", "author": { "name": "Mher Shahinyan"