diff --git a/src/app/runtime/actions/mod.rs b/src/app/runtime/actions/mod.rs index d9202ce..46bf8d8 100644 --- a/src/app/runtime/actions/mod.rs +++ b/src/app/runtime/actions/mod.rs @@ -556,7 +556,7 @@ pub fn apply_action(state: &mut AppStateRest, action: Action) { .map(str::len) .sum(); let token_estimate = total_chars / 3; - rt.messages = crate::app::runtime::shortsend::shape_messages(&rt.messages, token_estimate, max_wire_tokens, true, None); + rt.messages = crate::app::runtime::context::shaping::shape_messages(&rt.messages, token_estimate, max_wire_tokens, true, None); state.push_toast(Toast::new(ToastKind::Success, "Conversation history compacted.".to_string())); state.dirty = true; } @@ -1154,10 +1154,10 @@ fn run_agent_turn( // Skip message compaction if abort was requested — the non-streaming // LLM call for summarization would block without checking abort_flag. let wire_msgs = if !tc.abort_flag.load(std::sync::atomic::Ordering::SeqCst) - && crate::app::runtime::shortsend::should_shape(token_estimate, max_wire_tokens, prev_shaped) + && crate::app::runtime::context::shaping::should_shape(token_estimate, max_wire_tokens, prev_shaped) { prev_shaped = true; - let compacted = crate::app::runtime::shortsend::shape_messages(&msgs, token_estimate, max_wire_tokens, false, Some(&tc.client)); + let compacted = crate::app::runtime::context::shaping::shape_messages(&msgs, token_estimate, max_wire_tokens, false, Some(&tc.client)); // Dispatch the compacted messages to the main thread so the local session history // is permanently compacted and doesn't trigger shaping again immediately on next turn. diff --git a/src/app/runtime/context/dedup.rs b/src/app/runtime/context/dedup.rs index ca01fa2..42d389a 100644 --- a/src/app/runtime/context/dedup.rs +++ b/src/app/runtime/context/dedup.rs @@ -1,3 +1,4 @@ +#![allow(dead_code)] //! Cross-call tool-result deduplication: when a read-only tool is called //! again with identical arguments, the earlier result is replaced with a //! placeholder so only the latest copy occupies context. diff --git a/src/app/runtime/context/mod.rs b/src/app/runtime/context/mod.rs index a0181f6..99afb61 100644 --- a/src/app/runtime/context/mod.rs +++ b/src/app/runtime/context/mod.rs @@ -11,6 +11,7 @@ //! `TurnEvent::Compacted`. pub mod dedup; +pub mod shaping; pub mod squash; pub mod tokens; pub mod window; diff --git a/src/app/runtime/context/squash.rs b/src/app/runtime/context/squash.rs index 06a4930..22ff12d 100644 --- a/src/app/runtime/context/squash.rs +++ b/src/app/runtime/context/squash.rs @@ -1,3 +1,4 @@ +#![allow(dead_code)] //! Per-tool-result compression: shrink large tool outputs before they //! ever enter conversation history, dispatching by content shape. //! diff --git a/src/app/runtime/context/tokens.rs b/src/app/runtime/context/tokens.rs index eeb0ae5..7069c00 100644 --- a/src/app/runtime/context/tokens.rs +++ b/src/app/runtime/context/tokens.rs @@ -28,6 +28,7 @@ pub fn count_tokens(text: &str) -> usize { /// /// Return: 0 for a message with no `content` (e.g. an assistant message /// that only carries `tool_calls`). +#[allow(dead_code)] pub fn count_message_tokens(msg: &ChatMessage) -> usize { msg.content.as_deref().map_or(0, count_tokens) } diff --git a/src/app/runtime/context/window.rs b/src/app/runtime/context/window.rs index 307cd92..bf748cf 100644 --- a/src/app/runtime/context/window.rs +++ b/src/app/runtime/context/window.rs @@ -1,3 +1,4 @@ +#![allow(dead_code)] //! Single source of truth for resolving the active model's context //! window size, replacing three copies of the same lookup that had //! drifted (`Action::Compact`, `spawn_turn`, and `view/status.rs` each diff --git a/src/app/runtime/mod.rs b/src/app/runtime/mod.rs index 9c4dce8..d239c62 100644 --- a/src/app/runtime/mod.rs +++ b/src/app/runtime/mod.rs @@ -3,5 +3,4 @@ pub mod actions; pub mod commands; pub mod context; -pub mod shortsend; pub mod stream;