feat: inject global rules into AI system prompt and fix Rules UI seeding

- Load global rules (AIFact/AIMemory) from local CloudModel and inject
  them into the Bedrock/OpenAI system prompt as a '## Global Rules' section
  when memory is enabled.
- Fix rule seeding: always re-seed predefined rules when the CloudModel has
  none, regardless of the has_seeded_predefined_rules flag (handles case
  where flag was set but rules never persisted due to prior missing owner).
- Rename /context slash command to /copy-context: dumps the full context
  window (global rules, progressive summary, message history) to the
  clipboard for debugging.
This commit is contained in:
Ryan Ward
2026-07-16 12:25:56 -05:00
parent 66ef451115
commit 3d2d90fd4e
10 changed files with 188 additions and 15 deletions
+3 -7
View File
@@ -28,7 +28,6 @@ use warpui::platform::OperatingSystem;
use warpui::{AppContext, Entity, ModelContext, SingletonEntity, UpdateModel};
use crate::ai::request_usage_model::RequestLimitInfo;
use crate::auth::AuthStateProvider;
use crate::report_if_error;
use crate::settings::PrivacySettings;
use crate::terminal::CLIAgent;
@@ -1903,13 +1902,10 @@ impl AISettings {
}
pub fn is_any_ai_enabled(&self, app: &AppContext) -> bool {
// Disable AI for anonymous and logged-out users.
let is_anonymous_or_logged_out = AuthStateProvider::as_ref(app)
.get()
.is_anonymous_or_logged_out();
// Galaxy does not require Warp authentication for AI.
// AI is enabled as long as the user hasn't explicitly disabled it
// and there's no org policy blocking it.
*self.is_any_ai_enabled
&& !is_anonymous_or_logged_out
&& !self.is_ai_disabled_due_to_remote_session_org_policy(app)
}