use crate::agent::context::ConversationContext;
use crate::api::models::Message;
pub(super) fn apply_worker_instruction(
instr: crate::agent::swarm::knowledge::WorkerInstruction,
context: &mut ConversationContext,
) {
use crate::agent::swarm::knowledge::WorkerInstruction;
let msg = match instr {
WorkerInstruction::Redirect { new_focus } => format!(
"[SYSTEM] Your task focus has been redirected by the user. \
New focus: {new_focus}\n\
Adjust your approach accordingly. Do not continue the previous direction."
),
WorkerInstruction::Hint { text } => format!("[SYSTEM] Hint from user: {text}"),
WorkerInstruction::Resume => {
return;
}
WorkerInstruction::Pause => {
return;
}
};
context.push(Message {
role: "user".to_string(),
content: Some(crate::api::Content::text(msg)),
reasoning_content: None,
tool_calls: None,
tool_call_id: None,
});
}