Add hierarchical workspace instructions
This commit is contained in:
@@ -1897,10 +1897,10 @@ mod sampling_tests {
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn bootstrap_key_is_the_prefix_before_dynamic_session_context() {
|
||||
let system = "System\n\nProject instructions from AGENTS.md:\n\nkeep this";
|
||||
fn workspace_instruction_identity_participates_in_append_only_kv_keys() {
|
||||
let system = "System";
|
||||
let bootstrap = conversation_key(system, ReasoningMode::High, &[]);
|
||||
let messages = vec![
|
||||
let mut messages = vec![
|
||||
ChatTurn {
|
||||
user: false,
|
||||
tool: false,
|
||||
@@ -1908,7 +1908,7 @@ mod sampling_tests {
|
||||
skip_previous_eos: false,
|
||||
reasoning: None,
|
||||
reasoning_complete: true,
|
||||
content: "current date and time".into(),
|
||||
content: "<system-reminder>\nWorkspace instruction identity: abc\nInstructions from: /project/AGENTS.md\nkeep this\n</system-reminder>".into(),
|
||||
},
|
||||
ChatTurn {
|
||||
user: true,
|
||||
@@ -1922,6 +1922,26 @@ mod sampling_tests {
|
||||
];
|
||||
|
||||
assert!(conversation_key(system, ReasoningMode::High, &messages).starts_with(&bootstrap));
|
||||
let mut changed_opening = messages[0].clone();
|
||||
changed_opening.content = changed_opening
|
||||
.content
|
||||
.replace("identity: abc", "identity: def");
|
||||
assert_ne!(
|
||||
conversation_tag(system, ReasoningMode::High, &messages[..1]),
|
||||
conversation_tag(system, ReasoningMode::High, &[changed_opening])
|
||||
);
|
||||
let baseline = conversation_key(system, ReasoningMode::High, &messages);
|
||||
messages.push(ChatTurn {
|
||||
user: false,
|
||||
tool: false,
|
||||
system: true,
|
||||
skip_previous_eos: false,
|
||||
reasoning: None,
|
||||
reasoning_complete: true,
|
||||
content: "<system-reminder>\nWorkspace instruction identity: def\nReplacement instructions from: /project/AGENTS.md\nkeep that\n</system-reminder>".into(),
|
||||
});
|
||||
let changed = conversation_key(system, ReasoningMode::High, &messages);
|
||||
assert!(changed.starts_with(&baseline));
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
Reference in New Issue
Block a user