feat(tui): enhance system prompt with workspace structure information
This commit is contained in:
@@ -120,15 +120,21 @@ fn run_turn(params: TurnParams) {
|
||||
let tools = all_tools();
|
||||
let defs = tool_defs(&tools);
|
||||
|
||||
let sys_msg = ChatMessage::system(
|
||||
"You are Zesdex, an AI coding assistant. You have access to various tools via native function calling to help the user. \
|
||||
let mut sys_prompt = "You are Zesdex, an AI coding assistant. You have access to various tools via native function calling to help the user. \
|
||||
For complex problems, use `seq_think` to reason step-by-step. \
|
||||
For any non-trivial tasks, you MUST prioritize creating a structured plan (using `plan_enter`) and a list of TODOs (using `todowrite`) BEFORE executing any other tools or modifying files. \
|
||||
For large multi-step operations or delegating tasks, you MUST prioritize using `workflow_run` (to run a yaml workflow script) or `hive_mind` (to orchestrate multiple agents) to complete the task efficiently. \
|
||||
Use other tools when necessary. If a tool returns an error, fix the issue before retrying. \
|
||||
Respond conversationally, concisely, and helpfully."
|
||||
.to_string(),
|
||||
);
|
||||
Respond conversationally, concisely, and helpfully.".to_string();
|
||||
|
||||
if let Some(root) = params.workspace_roots.first() {
|
||||
let tree = zesdex_infrastructure::utils::build_workspace_tree(root, 800);
|
||||
sys_prompt.push_str("\n\nWorkspace structure:\n```\n");
|
||||
sys_prompt.push_str(&tree);
|
||||
sys_prompt.push_str("\n```\n");
|
||||
}
|
||||
|
||||
let sys_msg = ChatMessage::system(sys_prompt);
|
||||
params.messages.insert(0, sys_msg);
|
||||
|
||||
let tool_ctx = ToolCtx::builder()
|
||||
|
||||
Reference in New Issue
Block a user