Optimize native system prompt - 48% size reduction
Removed redundant and vague content from prompts/system/native.md: - Simplified intro from 17 lines to 3 lines - Reduced Code Search section to one line - Removed duplicate Plan Mode example (kept one) - Removed Action Envelope section (rarely used correctly) - Removed verbose Memory Format details (tool description covers it) - Removed Response Guidelines (obvious to modern LLMs) Size: 8,620 chars -> 4,498 chars Also updated: - G3_IDENTITY_LINE constant for agent mode compatibility - Test assertions to check for new prompt markers - System prompt validation to use new marker string
This commit is contained in:
@@ -438,12 +438,12 @@ impl<W: UiWriter> Agent<W> {
|
||||
|
||||
// Check for system prompt markers that are present in both standard and agent mode
|
||||
// Check for system prompt markers that are present in both native and non-native prompts
|
||||
// Both prompts contain "You have access to tools" as a common marker
|
||||
// Both prompts contain "Use tools to accomplish tasks" as a common marker
|
||||
let has_tool_instructions = first_message
|
||||
.content
|
||||
.contains("You have access to tools");
|
||||
.contains("Use tools to accomplish tasks");
|
||||
if !has_tool_instructions {
|
||||
panic!("FATAL: First system message does not contain the system prompt marker 'You have access to tools'. This likely means the README was added before the system prompt.");
|
||||
panic!("FATAL: First system message does not contain the system prompt marker 'Use tools to accomplish tasks'. This likely means the README was added before the system prompt.");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user