diff --git a/crates/pi-shell/src/coreutils.rs b/crates/pi-shell/src/coreutils.rs index 6151842be..7bd6fca9c 100644 --- a/crates/pi-shell/src/coreutils.rs +++ b/crates/pi-shell/src/coreutils.rs @@ -151,10 +151,12 @@ fn run_caught(run: UutilRun, argv: Vec) -> i32 { let name = argv .first() .map_or_else(|| String::from("command"), |arg| arg.to_string_lossy().into_owned()); - if let Ok(code) = catch_unwind(|| run(argv)) { code } else { - let _ = writeln!(pi_uutils_ctx::stderr(), "{name}: internal error"); - 1 - } + if let Ok(code) = catch_unwind(|| run(argv)) { + code + } else { + let _ = writeln!(pi_uutils_ctx::stderr(), "{name}: internal error"); + 1 + } } /// Minimal help/usage content for a uutils-backed builtin. The full utility @@ -211,8 +213,10 @@ uutil_builtin!(pub fn uniq_builtin => uu_uniq::run); #[cfg(test)] mod tests { use std::{ + collections::HashMap, ffi::OsString, io::{self, Write}, + path::PathBuf, sync::{Arc, atomic::AtomicBool, mpsc}, }; @@ -226,6 +230,7 @@ mod tests { let _ = self.0.send(buf.to_vec()); Ok(buf.len()) } + fn flush(&mut self) -> io::Result<()> { Ok(()) } @@ -233,21 +238,20 @@ mod tests { fn scope_io(stderr: Box) -> pi_uutils_ctx::ScopeIo { pi_uutils_ctx::ScopeIo { - stdin: Box::new(io::empty()), - stdin_fd: None, + stdin: Box::new(io::empty()), + stdin_fd: None, stdin_is_search_input: false, - stdout: Box::new(io::sink()), + stdout: Box::new(io::sink()), stderr, - cwd: std::path::PathBuf::from("."), - env: std::collections::HashMap::new(), - cancel: Arc::new(AtomicBool::new(false)), + cwd: PathBuf::from("."), + env: HashMap::new(), + cancel: Arc::new(AtomicBool::new(false)), } } fn run_in_scope(run: UutilRun, argv: Vec) -> (i32, String) { let (tx, rx) = mpsc::channel(); - let code = - pi_uutils_ctx::scope(scope_io(Box::new(ChanWriter(tx))), || run_caught(run, argv)); + let code = pi_uutils_ctx::scope(scope_io(Box::new(ChanWriter(tx))), || run_caught(run, argv)); let mut err = Vec::new(); while let Ok(chunk) = rx.try_recv() { err.extend_from_slice(&chunk); diff --git a/crates/pi-uutils-ctx/src/lib.rs b/crates/pi-uutils-ctx/src/lib.rs index dcc7af07d..55d616ca5 100644 --- a/crates/pi-uutils-ctx/src/lib.rs +++ b/crates/pi-uutils-ctx/src/lib.rs @@ -331,14 +331,14 @@ mod tests { fn empty_io() -> ScopeIo { ScopeIo { - stdin: Box::new(std::io::empty()), + stdin: Box::new(io::empty()), stdin_fd: None, stdin_is_search_input: false, - stdout: Box::new(std::io::sink()), - stderr: Box::new(std::io::sink()), - cwd: std::path::PathBuf::from("."), - env: std::collections::HashMap::new(), - cancel: std::sync::Arc::new(std::sync::atomic::AtomicBool::new(false)), + stdout: Box::new(io::sink()), + stderr: Box::new(io::sink()), + cwd: PathBuf::from("."), + env: HashMap::new(), + cancel: Arc::new(AtomicBool::new(false)), } } diff --git a/packages/agent/CHANGELOG.md b/packages/agent/CHANGELOG.md index 8addf9979..aaec50bba 100644 --- a/packages/agent/CHANGELOG.md +++ b/packages/agent/CHANGELOG.md @@ -2,12 +2,15 @@ ## [Unreleased] +### Changed + +- Improved the reliability of remote compaction by introducing transient error retries, configurable timeouts, and immediate termination upon user-initiated aborts. + ### Fixed -- Fixed an issue where assistant responses and encrypted reasoning were lost during local history trimming prior to remote compaction. -- Improved reliability of remote compaction with transient error retries, configurable timeouts, and immediate termination upon user-initiated aborts. -- Added title_change session metadata to the compaction entry type union to maintain type compatibility for hosts with title audit entries. -- Fixed transient stream read failures after a completed tool call being treated as terminal errors; the agent now executes the completed tool call and continues the turn. +- Fixed an issue where assistant responses and encrypted reasoning could be lost during local history trimming prior to remote compaction. +- Fixed type compatibility for hosts with title audit entries by adding support for `title_change` session metadata. +- Fixed an issue where transient stream read failures after a completed tool call were treated as terminal errors, allowing the agent to successfully execute the tool and continue the turn. ## [16.2.3] - 2026-06-28 diff --git a/packages/ai/CHANGELOG.md b/packages/ai/CHANGELOG.md index 7d7901d2e..ead29e758 100644 --- a/packages/ai/CHANGELOG.md +++ b/packages/ai/CHANGELOG.md @@ -4,15 +4,13 @@ ### Added -- Added contract tests for `resolveUsedFraction` covering all four resolution paths (explicit fraction, used/limit, percent+used, inverted remaining) and their precedence ordering +- Enabled freeform tool patch support for Azure OpenAI and Codex models ### Fixed -- Fixed Antigravity usage reporting to surface named daily and weekly quota windows from Cloud Code Assist model metadata, so `/usage` can show weekly Antigravity limits instead of collapsing them into the default bucket. -- Fixed OpenAI Responses `stream_read_error` provider events being classified as non-transient, which prevented the coding agent's auto-retry path from continuing after a recoverable stream read failure. -- Enabled freeform tool patch support for Azure OpenAI and Codex models -- Fixed /usage show returning "No usage data available" when using a custom proxy base URL for Codex by routing usage and credit-reset requests to the canonical ChatGPT origin -- Fixed Z.AI usage reporting to preserve distinct 5-hour, weekly, and monthly quota windows instead of rendering duplicate token windows as separate accounts. +- Fixed usage reporting for Antigravity and Z.AI to correctly surface and preserve distinct quota windows (daily, weekly, monthly) instead of collapsing or duplicating them +- Fixed an issue where `/usage show` returned "No usage data available" when using a custom proxy base URL for Codex +- Fixed OpenAI stream read errors being incorrectly classified as non-transient, enabling the coding agent to automatically retry after recoverable stream failures ## [16.2.3] - 2026-06-28 diff --git a/packages/coding-agent/CHANGELOG.md b/packages/coding-agent/CHANGELOG.md index 96136ae19..4066ea6b1 100644 --- a/packages/coding-agent/CHANGELOG.md +++ b/packages/coding-agent/CHANGELOG.md @@ -4,12 +4,12 @@ ### Fixed -- Anchored the todo-reminder HUD outside durable chat history while preserving native Todo HUD collapsing and auto-clear behavior. -- Fixed goal-mode continuations losing sight of persisted todo progress by injecting the current todo state into hidden goal context, so autonomous goal turns reconcile stale `in_progress` items before moving to later work. -- Fixed `/move ` to relocate the current session file and artifacts into the target directory's resume bucket instead of switching to a new empty target session, so `/resume` from the target directory shows the moved conversation. -- Fixed `omp update` leaving older Bun install-cache copies of globally installed `omp` packages behind. After a successful Bun global install, the update command now prunes stale `pkg@version@@@N` cache directories and their marker entries for packages present in Bun's global `node_modules` tree, while leaving unrelated shared-cache packages untouched. -- Fixed `/collab` host disconnecting in a loop ("Collab relay connection lost (Connection ended), reconnecting…") when the live session held an oversized entry (typically a `read`/`bash`/`search` tool result that captured several megabytes of output). `CollabHost.#sendSnapshotChunks` packed entries into 512 KB-target batches but added the first entry of every batch unconditionally, so a single oversized entry shipped as its own oversized chunk; the relay closed the host's WebSocket with `1006 Received too big message`, `CollabSocket` reconnected on the non-fatal code, the next guest hello triggered the same oversized send, and the loop never broke. The host now runs every replicated entry and event through a `shrinkForReplication` helper that head-truncates long strings with an `[…N chars elided for collab session]` marker once a payload exceeds `MAX_REPLICATED_PAYLOAD_BYTES = 1 MB`; the snapshot chunk train, live `entry` broadcasts, and live `event` broadcasts (including large `tool_execution_end` results) all ride that cap, so single oversized entries no longer kill the host's WebSocket ([#3739](https://github.com/can1357/oh-my-pi/issues/3739)). -- Fixed autolearn and local memory writes mutating Anthropic prompt-cache prefixes mid-session by keeping passive capture guidance and learned-memory prompt injections session-stable. +- Fixed todo-reminder HUD rendering outside durable chat history while preserving native collapsing and auto-clear behavior. +- Fixed goal-mode continuations losing track of persisted todo progress, ensuring autonomous goal turns reconcile stale in-progress items before moving to subsequent tasks. +- Fixed the /move command to correctly relocate the current session and its artifacts to the target directory, allowing /resume to work seamlessly from the new location. +- Fixed omp update leaving behind stale Bun install-cache directories for globally installed packages. +- Fixed a reconnection loop issue in /collab sessions caused by oversized entries (such as large tool outputs) by truncating replicated payloads that exceed 1 MB. +- Fixed autolearn and local memory writes mutating Anthropic prompt-cache prefixes mid-session, ensuring prompt injections remain session-stable. ## [16.2.3] - 2026-06-28 diff --git a/packages/natives/CHANGELOG.md b/packages/natives/CHANGELOG.md index 413977c99..1d1faaf3d 100644 --- a/packages/natives/CHANGELOG.md +++ b/packages/natives/CHANGELOG.md @@ -4,7 +4,7 @@ ### Fixed -- Fixed the in-process `tail` builtin aborting the whole host process with a `BrokenPipe` panic when its stdout consumer closed the pipe early. The bounded (seekable, large-file) path `unwrap()`ed the `io::copy` write into the command's file descriptor; it now propagates the error through `bounded_tail`/`print_target_section` like the unbounded path and the sibling `cat` builtin, so a closed reader surfaces as a normal non-zero exit instead of `std::process::abort`. +- Fixed a crash in the in-process `tail` builtin where the host process would abort with a `BrokenPipe` panic if the stdout consumer closed the pipe early. ## [16.1.23] - 2026-06-26