v1.4.0: Auto-compact streaming, Bedrock summarization support, subagent orchestration, and Galaxy rebrand continuation

Major features:
- Auto-compact: triggers conversation summarization when context window >= 85%,
  compacts Bedrock message history to a summary pair, and tracks live context tokens
- Bedrock summarization: plumbs `is_summarization` flag through translator/client/response
  pipeline, handles SummarizeConversation input type, and marks `summarized` in metadata
- Session restore: rebuilds bedrock_message_history from persisted task messages via
  newly-public `convert_proto_message`, preventing empty history on reconnect
- Subagent orchestration: adds SubagentQuestion/Answer/CompletionSummary event types,
  parent-child question routing with depth limits, retry counting, and drain methods
- Summarization UI: inline SummarizationView in AI blocks with progress/finished states

Refactors:
- Rename WarpTheme → GalaxyTheme across ~100 files (rebrand continuation)
- Rename warp_home_config_dir → galaxy_home_config_dir and related path functions
- Predefined rules: replace "System Defined Rule #N" with descriptive names
  (e.g. "Correctness Over Speed", "Never Guess") and add lookup helpers
- Usage view: replace cumulative input/output token display with live context tokens,
  cache hit rate calculation, and separate cache read/write stats
- Telemetry: remove verbose doc comments, simplify trait definitions
- Facts view: simplify delete permission check (always allow local deletion)
- Remove warp_managed_paths_watcher.rs (dead code)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Ryan Ward
2026-05-21 11:59:37 -05:00
co-authored by Claude Opus 4.6
parent eaa2ddc75e
commit 6f54e2cb30
229 changed files with 2506 additions and 2634 deletions
@@ -33,11 +33,14 @@ pub struct ConversationUsageInfo {
pub lines_added: i32,
pub lines_removed: i32,
pub commands_executed: i32,
pub total_input_tokens: u32,
pub total_output_tokens: u32,
pub total_cache_read_tokens: u32,
pub total_cache_write_tokens: u32,
/// Live context window token count (from most recent Bedrock response).
pub current_context_tokens: u32,
/// Cumulative cost across all requests.
pub estimated_cost_cents: f32,
/// Cumulative cache read tokens (session total).
pub total_cache_read_tokens: u32,
/// Cumulative cache write tokens (session total).
pub total_cache_write_tokens: u32,
}
/// Timing information for the last set of agent responses
@@ -246,32 +249,21 @@ impl ConversationUsageView {
);
}
// Token usage section
let total_tokens = self.usage_info.total_input_tokens
+ self.usage_info.total_output_tokens
+ self.usage_info.total_cache_read_tokens
// Context tokens (live state — current context window size)
if self.usage_info.current_context_tokens > 0 {
labels.push(render_label_text("Context tokens", appearance));
values.push(render_value_text(
format_token_count(self.usage_info.current_context_tokens),
appearance,
));
}
// Cache usage (cumulative session totals)
let total_cache = self.usage_info.total_cache_read_tokens
+ self.usage_info.total_cache_write_tokens;
if total_tokens > 0 {
labels.push(render_label_text("Total tokens", appearance));
values.push(render_value_text(
format_token_count(total_tokens),
appearance,
));
labels.push(render_label_text(" Input", appearance));
values.push(render_value_text(
format_token_count(self.usage_info.total_input_tokens),
appearance,
));
labels.push(render_label_text(" Output", appearance));
values.push(render_value_text(
format_token_count(self.usage_info.total_output_tokens),
appearance,
));
if total_cache > 0 {
if self.usage_info.total_cache_read_tokens > 0 {
labels.push(render_label_text(" Cache read", appearance));
labels.push(render_label_text("Cache read", appearance));
values.push(render_value_text(
format_token_count(self.usage_info.total_cache_read_tokens),
appearance,
@@ -279,12 +271,25 @@ impl ConversationUsageView {
}
if self.usage_info.total_cache_write_tokens > 0 {
labels.push(render_label_text(" Cache write", appearance));
labels.push(render_label_text("Cache write", appearance));
values.push(render_value_text(
format_token_count(self.usage_info.total_cache_write_tokens),
appearance,
));
}
// Cache hit rate
let cache_miss = self.usage_info.current_context_tokens
.saturating_sub(self.usage_info.total_cache_read_tokens);
let total_input = self.usage_info.total_cache_read_tokens + cache_miss;
if total_input > 0 {
let hit_rate = (self.usage_info.total_cache_read_tokens as f32 / total_input as f32) * 100.0;
labels.push(render_label_text("Cache hit rate", appearance));
values.push(render_value_text(
format!("{:.0}%", hit_rate),
appearance,
));
}
}
labels.push(render_label_text("Context window used", appearance));
+2 -2
View File
@@ -1,4 +1,4 @@
use galaxy_core::ui::theme::{Fill, WarpTheme};
use galaxy_core::ui::theme::{Fill, GalaxyTheme};
use galaxy_core::ui::Icon;
use galaxyui::Element;
@@ -33,7 +33,7 @@ pub fn icon_for_context_window_usage(context_window_usage: f32) -> Icon {
pub fn render_context_window_usage_icon(
context_window_usage: f32,
theme: &WarpTheme,
theme: &GalaxyTheme,
color_override: Option<Fill>,
) -> Box<dyn Element> {
let icon = icon_for_context_window_usage(context_window_usage);