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:
@@ -319,8 +319,10 @@ impl RuleView {
|
||||
.on_click(|ctx| ctx.dispatch_typed_action(RuleViewAction::InitializeProject))
|
||||
});
|
||||
|
||||
// Seed predefined rules on first launch if no global rules exist
|
||||
if ai_rules.is_empty() && !AISettings::as_ref(ctx).has_seeded_predefined_rules() {
|
||||
// Seed predefined rules on first launch if no global rules exist.
|
||||
// Also re-seed if the flag was set but rules are empty (e.g., prior bug
|
||||
// where the flag was set but creation failed due to missing owner).
|
||||
if ai_rules.is_empty() {
|
||||
if let Some(owner) = owner {
|
||||
let update_manager = UpdateManager::handle(ctx);
|
||||
update_manager.update(ctx, |update_manager, ctx| {
|
||||
|
||||
Reference in New Issue
Block a user