Route Bedrock through Rig and improve agent observability

This commit is contained in:
2026-08-22 12:02:45 -05:00
parent 1f1d0737a9
commit f291cfe803
28 changed files with 519 additions and 938 deletions
+24 -22
View File
@@ -915,6 +915,24 @@ fn run_internal(mut launch_mode: LaunchMode) -> Result<()> {
);
let _enter = span.enter();
// Load the TOML-backed preferences before logging so the opt-in session log can capture the
// complete application startup. The same backends are registered with AppContext below.
let private_preferences = settings::init_private_user_preferences();
let (public_preferences, startup_toml_parse_error) = settings::init_public_user_preferences();
let session_logs_enabled = FeatureFlag::SettingsFile.is_enabled()
&& crate::settings::SessionLogsEnabled::read_from_preferences(public_preferences.as_ref())
.unwrap_or_default();
// When the SettingsFile feature flag is enabled, public settings live in
// the TOML-backed store. When disabled, they live in the platform-native
// store (same backend as private). Use the correct one for pre-app reads.
let prefs_for_public_settings: &dyn galaxyui_extras::user_preferences::UserPreferences =
if FeatureFlag::SettingsFile.is_enabled() {
public_preferences.as_ref()
} else {
private_preferences.deref()
};
let log_destination = launch_mode.log_destination();
let is_cli = log_destination.is_some();
@@ -926,6 +944,7 @@ fn run_internal(mut launch_mode: LaunchMode) -> Result<()> {
galaxy_logging::init(galaxy_logging::LogConfig {
is_cli,
log_destination,
session_logs_enabled,
..Default::default()
})?;
}
@@ -933,6 +952,7 @@ fn run_internal(mut launch_mode: LaunchMode) -> Result<()> {
galaxy_logging::init(galaxy_logging::LogConfig {
is_cli,
log_destination,
session_logs_enabled,
..Default::default()
})?;
}
@@ -943,6 +963,10 @@ fn run_internal(mut launch_mode: LaunchMode) -> Result<()> {
}
timer.mark_interval_end("LOG_FILE_SETUP_COMPLETE");
if let Some(error) = &startup_toml_parse_error {
log::warn!("Settings file has syntax errors and could not be parsed: {error}");
}
#[cfg(windows)]
platform::windows::check_redirection_guard();
@@ -1015,28 +1039,6 @@ fn run_internal(mut launch_mode: LaunchMode) -> Result<()> {
#[cfg(windows)]
command::windows::init();
let private_preferences = settings::init_private_user_preferences();
let (public_preferences, startup_toml_parse_error) = settings::init_public_user_preferences();
// When the SettingsFile feature flag is enabled, public settings live in
// the TOML-backed store. When disabled, they live in the platform-native
// store (same backend as private). Use the correct one for pre-app reads.
#[cfg_attr(
not(any(
enable_crash_recovery,
target_os = "linux",
target_os = "freebsd",
target_os = "macos"
)),
expect(unused)
)]
let prefs_for_public_settings: &dyn galaxyui_extras::user_preferences::UserPreferences =
if FeatureFlag::SettingsFile.is_enabled() {
public_preferences.as_ref()
} else {
private_preferences.deref()
};
#[cfg(enable_crash_recovery)]
let crash_recovery =
crash_recovery::CrashRecovery::new(&launch_mode, prefs_for_public_settings);