Refactor system prompts to eliminate duplication; upgrade embedded provider

- Refactor prompts.rs: extract shared sections (intro, TODO, workspace memory,
  web research, response guidelines) used by both native and non-native prompts
- Fix typo in native prompt: "save them.." -> "save them."
- Fix non-native prompt: add missing closing braces in JSON examples,
  add IMPORTANT steps section, align with native prompt quality
- Add 9 unit tests to verify both prompts contain required sections
- Upgrade llama-cpp-2 dependency and refactor embedded provider
- Update config.example.toml with embedded model examples
- Update workspace memory
This commit is contained in:
Dhanji R. Prasanna
2026-01-28 09:56:39 +11:00
parent 585684a86e
commit a902be1562
9 changed files with 1027 additions and 851 deletions

View File

@@ -40,7 +40,7 @@ async fn test_context_window_initial_structure() {
// First message should be system prompt
let system_msg = &context.conversation_history[0];
assert!(system_msg.content.contains("IMPORTANT: You must call tools to achieve goals"),
assert!(system_msg.content.contains("You have access to tools"),
"First message should be system prompt with tool instructions");
// Second message should be README content
@@ -285,7 +285,7 @@ async fn test_full_context_order() {
// Message 0: System prompt
let system = &context.conversation_history[0].content;
assert!(system.contains("IMPORTANT: You must call tools"),
assert!(system.contains("You have access to tools"),
"Message 0 should be system prompt");
// Message 1: Combined content with project appended