Remove find_context_files — identity comes from memory nodes
Deleted the directory-walking CLAUDE.md/POC.md loader. Identity now comes entirely from personality_nodes in the memory graph. Simplified: - assemble_context_message() takes just personality_nodes - Removed config_file_count/memory_file_count tracking - reload_for_model() → reload_context() (no longer model-specific) Co-Authored-By: Kent Overstreet <kent.overstreet@linux.dev> Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
parent
e847a313b4
commit
fc978e2f2e
14 changed files with 779 additions and 107 deletions
|
|
@ -383,10 +383,8 @@ pub struct SessionConfig {
|
|||
pub api_key: String,
|
||||
pub model: String,
|
||||
pub prompt_file: String,
|
||||
/// Identity/personality files as (name, content) pairs.
|
||||
/// Identity/personality nodes as (name, content) pairs.
|
||||
pub context_parts: Vec<(String, String)>,
|
||||
pub config_file_count: usize,
|
||||
pub memory_file_count: usize,
|
||||
pub session_dir: PathBuf,
|
||||
pub app: AppConfig,
|
||||
/// Disable background agents (surface, observe, scoring)
|
||||
|
|
@ -407,8 +405,6 @@ pub struct ResolvedModel {
|
|||
impl AppConfig {
|
||||
/// Resolve the active backend and assemble prompts into a SessionConfig.
|
||||
pub async fn resolve(&self, cli: &crate::user::CliArgs) -> Result<SessionConfig> {
|
||||
let cwd = std::env::current_dir().context("Failed to get current directory")?;
|
||||
|
||||
let (api_base, api_key, model, prompt_file);
|
||||
|
||||
if !self.models.is_empty() {
|
||||
|
|
@ -434,9 +430,7 @@ impl AppConfig {
|
|||
}
|
||||
|
||||
let personality_nodes = get().personality_nodes.clone();
|
||||
|
||||
let (context_parts, config_file_count, memory_file_count) =
|
||||
crate::mind::identity::assemble_context_message(&cwd, &prompt_file, self.memory_project.as_deref(), &personality_nodes).await?;
|
||||
let context_parts = crate::mind::identity::personality_nodes(&personality_nodes).await;
|
||||
|
||||
let session_dir = dirs::home_dir()
|
||||
.unwrap_or_else(|| PathBuf::from("."))
|
||||
|
|
@ -450,7 +444,6 @@ impl AppConfig {
|
|||
Ok(SessionConfig {
|
||||
api_base, api_key, model, prompt_file,
|
||||
context_parts,
|
||||
config_file_count, memory_file_count,
|
||||
session_dir,
|
||||
app: self.clone(),
|
||||
no_agents: cli.no_agents,
|
||||
|
|
@ -574,11 +567,10 @@ pub async fn load_session(cli: &crate::user::CliArgs) -> Result<(SessionConfig,
|
|||
Ok((config, figment))
|
||||
}
|
||||
|
||||
/// Re-assemble context for a specific model's prompt file.
|
||||
pub async fn reload_for_model(app: &AppConfig, prompt_file: &str) -> Result<Vec<(String, String)>> {
|
||||
let cwd = std::env::current_dir().context("Failed to get current directory")?;
|
||||
/// Re-assemble context (reload personality nodes).
|
||||
pub async fn reload_context() -> Result<Vec<(String, String)>> {
|
||||
let personality_nodes = get().personality_nodes.clone();
|
||||
let (context_parts, _, _) = crate::mind::identity::assemble_context_message(&cwd, prompt_file, app.memory_project.as_deref(), &personality_nodes).await?;
|
||||
let context_parts = crate::mind::identity::personality_nodes(&personality_nodes).await;
|
||||
Ok(context_parts)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue