config: move user_name/assistant_name to AppConfig (top level)
These are identity settings, not memory-graph settings. Sat inside the \`memory\` section only because that's where Config started life. Move to AppConfig alongside the other top-level stuff. Readers now pull from \`config::app()\` instead of \`config::get()\`. subconscious/defs.rs's conversation-building pass still needs Config for surface_conversation_bytes, so both guards coexist there — AppConfig's guard is dropped before the per-step await loop so we don't stall the config-watcher's writer. show_config picks up the two new fields at the top of its output. Kent's config already has them hoisted to the top level. Co-Authored-By: Proof of Concept <poc@bcachefs.org>
This commit is contained in:
parent
dd551fe551
commit
592a3e2e52
6 changed files with 29 additions and 18 deletions
|
|
@ -374,7 +374,7 @@ impl AstNode {
|
|||
|
||||
/// Short label for the UI.
|
||||
pub fn label(&self) -> String {
|
||||
let cfg = crate::config::get();
|
||||
let app = crate::config::app();
|
||||
match self {
|
||||
Self::Branch { role, children, .. } => {
|
||||
let preview = children.first()
|
||||
|
|
@ -383,8 +383,8 @@ impl AstNode {
|
|||
.unwrap_or_default();
|
||||
match role {
|
||||
Role::System => "system".into(),
|
||||
Role::User => format!("{}: {}", cfg.user_name, preview),
|
||||
Role::Assistant => format!("{}: {}", cfg.assistant_name, preview),
|
||||
Role::User => format!("{}: {}", app.user_name, preview),
|
||||
Role::Assistant => format!("{}: {}", app.assistant_name, preview),
|
||||
}
|
||||
}
|
||||
Self::Leaf(leaf) => match &leaf.body {
|
||||
|
|
|
|||
|
|
@ -183,8 +183,8 @@ fn resolve_prompt(
|
|||
state: &std::collections::BTreeMap<String, String>,
|
||||
recently_written: &[String],
|
||||
) -> String {
|
||||
let cfg = crate::config::get();
|
||||
let template = template.replace("{assistant_name}", &cfg.assistant_name);
|
||||
let template = template.replace("{assistant_name}",
|
||||
&crate::config::app().assistant_name);
|
||||
let mut result = String::with_capacity(template.len());
|
||||
let mut rest = template.as_str();
|
||||
while let Some(start) = rest.find("{{") {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue