Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions src/apps/desktop/src/api/storage_commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ pub async fn get_project_storage_paths(
runtime_root: path_manager.project_runtime_root(&workspace_path),
agents_dir: path_manager.project_agents_dir(&workspace_path),
sessions_dir: path_manager.project_sessions_dir(&workspace_path),
memory_dir: path_manager.project_memory_dir(&workspace_path),
plans_dir: path_manager.project_plans_dir(&workspace_path),
})
}
Expand All @@ -67,7 +66,6 @@ pub struct ProjectStoragePathsInfo {
pub runtime_root: PathBuf,
pub agents_dir: PathBuf,
pub sessions_dir: PathBuf,
pub memory_dir: PathBuf,
pub plans_dir: PathBuf,
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ impl Agent for ClawMode {
UserContextPolicy::empty()
.with_workspace_context()
.with_workspace_instructions()
.with_workspace_memory_files()
}

fn is_readonly(&self) -> bool {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,12 @@ use crate::agentic::tools::implementations::ExecCommandTool;
use crate::agentic::util::remote_workspace_layout::build_remote_workspace_layout_preview;
use crate::agentic::workspace::WorkspaceBackend;
use crate::agentic::WorkspaceBinding;
use crate::service::agent_memory::{
build_workspace_agent_memory_prompt, build_workspace_instruction_files_context,
build_workspace_memory_files_context,
};
use crate::service::bootstrap::build_workspace_persona_prompt;
use crate::service::config::get_app_language_code;
use crate::service::config::global::GlobalConfigManager;
use crate::service::filesystem::get_formatted_directory_listing;
use crate::service::i18n::LocaleId;
use crate::service::instruction_context::build_workspace_instruction_files_context;
use crate::service::remote_ssh::workspace_state::get_remote_workspace_manager;
use crate::service::workspace::get_global_workspace_service;
use crate::service::workspace::RelatedPath;
Expand All @@ -29,7 +26,6 @@ use std::path::Path;
/// Placeholder constants
const PLACEHOLDER_PERSONA: &str = "{PERSONA}";
const PLACEHOLDER_LANGUAGE_PREFERENCE: &str = "{LANGUAGE_PREFERENCE}";
const PLACEHOLDER_AGENT_MEMORY: &str = "{AGENT_MEMORY}";
const PLACEHOLDER_CLAW_WORKSPACE: &str = "{CLAW_WORKSPACE}";
const PLACEHOLDER_VISUAL_MODE: &str = "{VISUAL_MODE}";
const PLACEHOLDER_SESSION_ID: &str = "{SESSION_ID}";
Expand Down Expand Up @@ -328,17 +324,6 @@ impl PromptBuilder {
),
}
}
if policy.includes(UserContextSection::WorkspaceMemoryFiles) {
match build_workspace_memory_files_context(workspace).await {
Ok(Some(prompt)) => additional_sections.push(prompt),
Ok(None) => {}
Err(e) => warn!(
"Failed to build workspace memory context: path={} error={}",
workspace.display(),
e
),
}
}
}

if policy.includes(UserContextSection::ProjectLayout) {
Expand Down Expand Up @@ -424,7 +409,6 @@ Do not read from, modify, create, move, or delete files outside this workspace u
/// Supported placeholders:
/// - `{PERSONA}` - Workspace persona files (BOOTSTRAP.md, SOUL.md, USER.md, IDENTITY.md)
/// - `{LANGUAGE_PREFERENCE}` - User language preference (read from global config)
/// - `{AGENT_MEMORY}` - Agent memory instructions + auto-loaded memory index
/// - `{CLAW_WORKSPACE}` - Claw-specific workspace ownership and boundary rules
/// - `{VISUAL_MODE}` - Visual mode instruction (Mermaid diagrams, read from global config)
///
Expand Down Expand Up @@ -466,28 +450,6 @@ Do not read from, modify, create, move, or delete files outside this workspace u
result = result.replace(PLACEHOLDER_CLAW_WORKSPACE, &claw_workspace);
}

// Replace {AGENT_MEMORY}
if result.contains(PLACEHOLDER_AGENT_MEMORY) {
let agent_memory = if self.context.remote_execution.is_some() {
"# Agent memory\nSession memory under `.bitfun/` is stored on the **remote** host for this workspace. Use file tools with POSIX paths under the workspace root if you need to read it.\n\n"
.to_string()
} else {
let workspace = Path::new(&self.context.workspace_path);
match build_workspace_agent_memory_prompt(workspace).await {
Ok(prompt) => prompt,
Err(e) => {
warn!(
"Failed to build workspace agent memory prompt: path={} error={}",
workspace.display(),
e
);
String::new()
}
}
};
result = result.replace(PLACEHOLDER_AGENT_MEMORY, &agent_memory);
}

// Replace {VISUAL_MODE}
if result.contains(PLACEHOLDER_VISUAL_MODE) {
let visual_mode = self.get_visual_mode_instruction().await;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,3 @@ Keep narration brief and value-dense. For multi-step work, state the near-term p

{CLAW_WORKSPACE}
{PERSONA}
{AGENT_MEMORY}
Original file line number Diff line number Diff line change
Expand Up @@ -482,9 +482,6 @@ impl AgentRegistry {
bitfun_agent_runtime::prompt::UserContextSection::WorkspaceInstructions => {
"workspace_instructions"
}
bitfun_agent_runtime::prompt::UserContextSection::WorkspaceMemoryFiles => {
"workspace_memory_files"
}
bitfun_agent_runtime::prompt::UserContextSection::ProjectLayout => {
"project_layout"
}
Expand Down
22 changes: 5 additions & 17 deletions src/crates/assembly/core/src/agentic/agents/registry/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -583,9 +583,7 @@ async fn explicit_custom_mode_load_exposes_user_mode_metadata_in_modes_info() {
"PlannerPlus",
"Planner Plus",
vec!["Read".to_string(), "Grep".to_string()],
UserContextPolicy::empty()
.with_workspace_instructions()
.with_workspace_memory_files(),
UserContextPolicy::empty().with_workspace_instructions(),
"primary",
true,
);
Expand Down Expand Up @@ -674,9 +672,7 @@ async fn custom_mode_detail_reports_kind_level_model_path_and_policy() {
"PlannerPlus",
"Planner Plus",
vec!["Read".to_string(), "Grep".to_string()],
UserContextPolicy::empty()
.with_workspace_instructions()
.with_workspace_memory_files(),
UserContextPolicy::empty().with_workspace_instructions(),
"primary",
true,
);
Expand All @@ -696,10 +692,7 @@ async fn custom_mode_detail_reports_kind_level_model_path_and_policy() {
assert_eq!(detail.path, mode_path.to_string_lossy().to_string());
assert_eq!(
detail.user_context_policy,
vec![
"workspace_instructions".to_string(),
"workspace_memory_files".to_string(),
]
vec!["workspace_instructions".to_string()]
);
assert_eq!(detail.tools, vec!["Read".to_string(), "Grep".to_string()]);
assert!(detail.readonly);
Expand Down Expand Up @@ -778,8 +771,7 @@ async fn updating_custom_mode_definition_rewrites_file_and_preserves_mode_kind()
None,
Some(
UserContextPolicy::empty()
.with_workspace_context()
.with_workspace_memory_files(),
.with_workspace_context(),
),
Some("primary".to_string()),
)
Expand All @@ -800,16 +792,12 @@ async fn updating_custom_mode_definition_rewrites_file_and_preserves_mode_kind()
assert_eq!(detail.tools, vec!["Read".to_string(), "Grep".to_string()]);
assert_eq!(
detail.user_context_policy,
vec![
"workspace_context".to_string(),
"workspace_memory_files".to_string(),
]
vec!["workspace_context".to_string()]
);
assert!(saved.contains("kind: mode"));
assert!(saved.contains("name: Planner Pro"));
assert!(saved.contains("model: primary"));
assert!(saved.contains("- workspace_context"));
assert!(saved.contains("- workspace_memory_files"));
}

struct CustomAgentTestEnv {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6063,7 +6063,7 @@ mod tests {
.expect("session should be created");
let identity = SystemPromptCacheIdentity::new("template:agentic_mode");
let user_context_identity = UserContextCacheIdentity::new(
"workspace_context|workspace_instructions|workspace_memory_files|project_layout",
"workspace_context|workspace_instructions|project_layout",
);

manager
Expand Down Expand Up @@ -6278,7 +6278,7 @@ mod tests {
.expect("session should be created");
let identity = SystemPromptCacheIdentity::new("template:agentic_mode");
let user_context_identity = UserContextCacheIdentity::new(
"workspace_context|workspace_instructions|workspace_memory_files|project_layout",
"workspace_context|workspace_instructions|project_layout",
);

manager
Expand Down Expand Up @@ -6358,7 +6358,7 @@ mod tests {
.expect("target session should be created");
let identity = SystemPromptCacheIdentity::new("template:agentic_mode");
let user_context_identity = UserContextCacheIdentity::new(
"workspace_context|workspace_instructions|workspace_memory_files|project_layout",
"workspace_context|workspace_instructions|project_layout",
);

manager
Expand Down Expand Up @@ -6439,7 +6439,7 @@ mod tests {
.expect("session should be created");
let identity = SystemPromptCacheIdentity::new("template:agentic_mode");
let user_context_identity = UserContextCacheIdentity::new(
"workspace_context|workspace_instructions|workspace_memory_files|project_layout",
"workspace_context|workspace_instructions|project_layout",
);

manager
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -386,11 +386,6 @@ impl PathManager {
self.project_runtime_root(workspace_path).join("plans")
}

/// Get project memory directory: ~/.bitfun/projects/<workspace-slug>/memory/
pub fn project_memory_dir(&self, workspace_path: &Path) -> PathBuf {
self.project_runtime_root(workspace_path).join("memory")
}

fn project_runtime_slug(&self, workspace_path: &Path) -> String {
let requested_path = workspace_path.to_path_buf();
if let Some(slug) = self.cached_project_runtime_slug(&requested_path) {
Expand Down
Loading
Loading