chore: add .wt-pr37 Windsurf directory to gitignore
Also removes dead inject_openclaw_identity function and replaces unreachable macros with anyhow bail for cleaner error handling.
This commit is contained in:
parent
6725eb2995
commit
e89415fc9a
2 changed files with 3 additions and 36 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -2,3 +2,4 @@
|
||||||
*.db
|
*.db
|
||||||
*.db-journal
|
*.db-journal
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
.wt-pr37/
|
||||||
|
|
|
||||||
|
|
@ -192,38 +192,6 @@ pub fn build_system_prompt(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Inject `OpenClaw` (markdown) identity files into the prompt
|
|
||||||
fn inject_openclaw_identity(prompt: &mut String, workspace_dir: &std::path::Path) {
|
|
||||||
#[allow(unused_imports)]
|
|
||||||
use std::fmt::Write;
|
|
||||||
|
|
||||||
prompt.push_str("## Project Context\n\n");
|
|
||||||
prompt
|
|
||||||
.push_str("The following workspace files define your identity, behavior, and context.\n\n");
|
|
||||||
|
|
||||||
let bootstrap_files = [
|
|
||||||
"AGENTS.md",
|
|
||||||
"SOUL.md",
|
|
||||||
"TOOLS.md",
|
|
||||||
"IDENTITY.md",
|
|
||||||
"USER.md",
|
|
||||||
"HEARTBEAT.md",
|
|
||||||
];
|
|
||||||
|
|
||||||
for filename in &bootstrap_files {
|
|
||||||
inject_workspace_file(prompt, workspace_dir, filename);
|
|
||||||
}
|
|
||||||
|
|
||||||
// BOOTSTRAP.md — only if it exists (first-run ritual)
|
|
||||||
let bootstrap_path = workspace_dir.join("BOOTSTRAP.md");
|
|
||||||
if bootstrap_path.exists() {
|
|
||||||
inject_workspace_file(prompt, workspace_dir, "BOOTSTRAP.md");
|
|
||||||
}
|
|
||||||
|
|
||||||
// MEMORY.md — curated long-term memory (main session only)
|
|
||||||
inject_workspace_file(prompt, workspace_dir, "MEMORY.md");
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Inject a single workspace file into the prompt with truncation and missing-file markers.
|
/// Inject a single workspace file into the prompt with truncation and missing-file markers.
|
||||||
fn inject_workspace_file(prompt: &mut String, workspace_dir: &std::path::Path, filename: &str) {
|
fn inject_workspace_file(prompt: &mut String, workspace_dir: &std::path::Path, filename: &str) {
|
||||||
use std::fmt::Write;
|
use std::fmt::Write;
|
||||||
|
|
@ -257,12 +225,10 @@ fn inject_workspace_file(prompt: &mut String, workspace_dir: &std::path::Path, f
|
||||||
pub fn handle_command(command: crate::ChannelCommands, config: &Config) -> Result<()> {
|
pub fn handle_command(command: crate::ChannelCommands, config: &Config) -> Result<()> {
|
||||||
match command {
|
match command {
|
||||||
crate::ChannelCommands::Start => {
|
crate::ChannelCommands::Start => {
|
||||||
// Handled in main.rs (needs async), this is unreachable
|
anyhow::bail!("Start must be handled in main.rs (requires async runtime)")
|
||||||
unreachable!("Start is handled in main.rs")
|
|
||||||
}
|
}
|
||||||
crate::ChannelCommands::Doctor => {
|
crate::ChannelCommands::Doctor => {
|
||||||
// Handled in main.rs (needs async), this is unreachable
|
anyhow::bail!("Doctor must be handled in main.rs (requires async runtime)")
|
||||||
unreachable!("Doctor is handled in main.rs")
|
|
||||||
}
|
}
|
||||||
crate::ChannelCommands::List => {
|
crate::ChannelCommands::List => {
|
||||||
println!("Channels:");
|
println!("Channels:");
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue