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
-128
View File
@@ -1,129 +1 @@
use super::telemetry::rudder_message::{
BatchMessage as RudderBatchMessage, BatchMessageItem as RudderBatchMessageItem,
Identify as RudderIdentify, Track as RudderTrack,
};
use super::telemetry::secret_redaction::redact_secrets_in_value;
use crate::auth::UserUid;
use chrono::{DateTime, Utc};
use galaxy_core::{
channel::{Channel, ChannelState},
execution_mode,
};
use galaxyui::telemetry::EventPayload;
use serde_json::{json, Value};
use super::telemetry::telemetry_context;
pub trait TelemetryExt {
fn to_rudder_batch_message(self) -> RudderBatchMessage;
}
impl TelemetryExt for galaxyui::telemetry::Event {
fn to_rudder_batch_message(self) -> RudderBatchMessage {
let message = match self.payload {
EventPayload::IdentifyUser {
user_id,
anonymous_id,
} => RudderBatchMessageItem::Identify(RudderIdentify {
user_id: Some(UserUid::new(user_id.as_str())),
anonymous_id: Some(anonymous_id),
original_timestamp: Some(self.timestamp),
integrations: Some(json!({
"Amplitude": {
"session_id": self.session_created_at.timestamp(),
}
})),
context: Some(telemetry_context().as_value()),
..Default::default()
}),
EventPayload::AppActive {
user_id,
anonymous_id,
} => form_rudder_track_message(
user_id.map(|uid| UserUid::new(uid.as_str())),
anonymous_id,
"Active App Usage".to_string(),
None,
self.timestamp,
self.session_created_at,
),
EventPayload::NamedEvent {
user_id,
anonymous_id,
name,
mut value,
} => {
// For events that may contain user-generated content, run a
// best-effort secret-redaction pass on the payload before
// sending. This is independent of the user's safe-mode setting:
// visual obfuscation is a UX preference, while telemetry-side
// redaction is a defence-in-depth measure for data leaving the
// device. See `secret_redaction.rs` for details.
if self.contains_ugc {
if let Some(value) = value.as_mut() {
redact_secrets_in_value(value);
}
}
form_rudder_track_message(
user_id.map(|uid| UserUid::new(uid.as_str())),
anonymous_id,
name.to_string(),
value,
self.timestamp,
self.session_created_at,
)
}
};
RudderBatchMessage {
message,
contains_ugc: self.contains_ugc,
}
}
}
fn form_rudder_track_message(
user_id: Option<UserUid>,
anonymous_id: String,
name: String,
payload: Option<Value>,
timestamp: DateTime<Utc>,
session_created_at: DateTime<Utc>,
) -> RudderBatchMessageItem {
RudderBatchMessageItem::Track(RudderTrack {
user_id,
anonymous_id: Some(anonymous_id),
event: name,
properties: Some(json!({
"release_mode": release_mode(ChannelState::channel()),
"tag": ChannelState::app_version().unwrap_or("<no tag>"),
"client_id": execution_mode::current_client_id(),
"payload": payload
})),
original_timestamp: Some(timestamp),
integrations: Some(json!({
"Amplitude": {
"session_id": session_created_at.timestamp(),
}
})),
context: Some(telemetry_context().as_value()),
})
}
fn release_mode(channel: Channel) -> &'static str {
match channel {
Channel::Stable => "stable_release",
Channel::Preview => "preview_release",
Channel::Local => "local",
Channel::Integration => "integration_test",
Channel::Dev => "dev_release",
// We don't ever expect to send telemetry for the OSS build, but
// until we have some time to clean things up here, we'll set a valid
// value that we never intend to receive.
Channel::Oss => "oss_release",
}
}
#[cfg(test)]
#[path = "telemetry_ext_tests.rs"]
mod tests;