From e075ecd0fe43624ea28a096d30e4f8e234f8cd89 Mon Sep 17 00:00:00 2001 From: Hunter Bown Date: Mon, 27 Apr 2026 19:57:53 -0500 Subject: [PATCH] chore: add #[allow(dead_code)] for v0.6.6 additions not yet wired MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - ClientError, StreamError, and their impl blocks in error_taxonomy.rs - ApprovalCache in approval_cache.rs (pending #66 follow-up wiring) - Legacy prompt constants in prompts.rs (backward compat) - with_mcp_tools and McpToolAdapter in registry.rs (pending MCP migration) - Fix rlm_query → rlm in when_not_to_use_sections_present test --- crates/tui/src/error_taxonomy.rs | 4 ++++ crates/tui/src/prompts.rs | 3 ++- crates/tui/src/prompts/base.md | 8 +++++--- crates/tui/src/tools/approval_cache.rs | 1 + crates/tui/src/tools/registry.rs | 2 ++ 5 files changed, 14 insertions(+), 4 deletions(-) diff --git a/crates/tui/src/error_taxonomy.rs b/crates/tui/src/error_taxonomy.rs index 16cd984b..d56d110c 100644 --- a/crates/tui/src/error_taxonomy.rs +++ b/crates/tui/src/error_taxonomy.rs @@ -305,6 +305,7 @@ impl From for ErrorEnvelope { /// /// Carries a full `ErrorEnvelope` so the TUI can render category‑specific /// styling instead of a generic `Event::Error { message, recoverable }`. +#[allow(dead_code)] #[derive(Debug, Clone)] pub enum ClientError { /// Transport / HTTP / auth error from the LLM provider. @@ -322,6 +323,7 @@ pub enum ClientError { Internal { envelope: ErrorEnvelope }, } +#[allow(dead_code)] impl ClientError { /// Unwrap the inner envelope regardless of variant. #[must_use] @@ -407,6 +409,7 @@ impl std::error::Error for ClientError {} /// /// Each variant maps to an `ErrorCategory` so the UI can render /// stream‑specific icons or formatting. +#[allow(dead_code)] #[derive(Debug, Clone)] pub enum StreamError { /// Stream stalled — no chunk received within the idle timeout. @@ -421,6 +424,7 @@ pub enum StreamError { Transport { message: String }, } +#[allow(dead_code)] impl StreamError { /// Convert into a `ClientError` for emission. #[must_use] diff --git a/crates/tui/src/prompts.rs b/crates/tui/src/prompts.rs index cda8bff0..59a40fd7 100644 --- a/crates/tui/src/prompts.rs +++ b/crates/tui/src/prompts.rs @@ -1,3 +1,4 @@ +#![allow(dead_code)] //! System prompts for different modes. //! //! Prompts are assembled from composable layers loaded at compile time: @@ -375,7 +376,7 @@ mod tests { assert!(prompt.contains("### `edit_file`")); assert!(prompt.contains("### `exec_shell`")); assert!(prompt.contains("### `agent_spawn`")); - assert!(prompt.contains("### `rlm_query`")); + assert!(prompt.contains("### `rlm`")); } #[test] diff --git a/crates/tui/src/prompts/base.md b/crates/tui/src/prompts/base.md index f3791131..896fd0e8 100644 --- a/crates/tui/src/prompts/base.md +++ b/crates/tui/src/prompts/base.md @@ -79,13 +79,15 @@ Don't reach for `agent_spawn` when: - The work can be done with a fast `exec_shell` pipeline or a `grep_files` call. - You haven't first laid out a plan with `todo_write`. Sub-agents are implementation, not exploration. -### `rlm_query` -Don't reach for `rlm_query` when: +### `rlm` +Don't reach for `rlm` (the recursive language model tool) when: - The input fits comfortably in your context window — just read it directly with `read_file`. - A simple `grep_files` or `exec_shell` pipeline can answer the question. -- You need interactive, iterative exploration of the data — RLM is batch-oriented. +- You need interactive, iterative exploration of the data — `rlm` is batch-oriented (the sub-LLM writes Python in one shot, then returns). - The task is a simple classification or extraction on short text — your own reasoning is faster and cheaper. +Inside the `rlm` REPL, the sub-LLM has access to `llm_query()`, `llm_query_batched()`, `rlm_query()`, and `rlm_query_batched()` as Python helpers for further sub-LLM work — those are not standalone tools you call directly. + ## Sub-agent completion sentinel When you spawn a sub-agent via `agent_spawn` (or `agent_swarm`), the child runs independently in its own context. You will receive a `` element in the transcript when it finishes. This sentinel carries: diff --git a/crates/tui/src/tools/approval_cache.rs b/crates/tui/src/tools/approval_cache.rs index 2c2c7af3..c0879c99 100644 --- a/crates/tui/src/tools/approval_cache.rs +++ b/crates/tui/src/tools/approval_cache.rs @@ -1,3 +1,4 @@ +#![allow(dead_code)] //! Per‑call approval cache with fingerprint keys (§5.A). //! //! Instead of caching by tool name alone (which would let an approved diff --git a/crates/tui/src/tools/registry.rs b/crates/tui/src/tools/registry.rs index 76123411..eccb4331 100644 --- a/crates/tui/src/tools/registry.rs +++ b/crates/tui/src/tools/registry.rs @@ -414,6 +414,7 @@ impl ToolRegistryBuilder { /// MCP tools are marked `defer_loading` by default (except discovery /// helpers) to keep the model-visible catalog compact. #[must_use] + #[allow(dead_code)] pub fn with_mcp_tools( mut self, mcp_pool: std::sync::Arc>, @@ -592,6 +593,7 @@ impl Default for ToolRegistryBuilder { /// Adapter that wraps an MCP tool definition so it can live in the /// unified `ToolRegistry` alongside native tools (§5.B). +#[allow(dead_code)] struct McpToolAdapter { name: String, tool: crate::mcp::McpTool,