//! Covers role composition and attribution for captured model instructions. use super::*; use akode_context_fragments::AnnotatedContent; use akode_context_fragments::RenderedFragment; use akode_protocol::models::ContentItemMetadata; use pretty_assertions::assert_eq; #[test] fn role_segment_filters_base_and_appends_bundled_guidance() { let shared = DEFAULT_MULTI_AGENT_V2_SHARED_USAGE_HINT_TEXT; let wait = DEFAULT_MULTI_AGENT_V2_WAIT_AGENT_USAGE_HINT_TEXT; let model_override = DEFAULT_MULTI_AGENT_V2_MODEL_OVERRIDE_USAGE_HINT_TEXT; let expected_body = format!( "Role.\n## Work\nContinue.\n{shared}\n{wait}\n\nThere are 2 available concurrency slots, meaning that up to 2 agents can be active at once, including you.\n\n{model_override}" ); for marked in [false, true] { let instructions = MultiAgentRoleInstructions::Composed { base: "Role.\n## Plan tool\nOmit role checklist guidance.\n## Work\nContinue." .to_string(), marked, omit_update_plan_instructions: true, max_concurrency: 2, wait_agent_enabled: true, expose_model_overrides: true, }; let expected_text = if marked { format!("{expected_body}") } else { expected_body.clone() }; assert_eq!( instructions.render_fragment(), RenderedFragment::new( "developer", AnnotatedContent::text( expected_text, ContentItemKind("multi_agent.role_instructions".to_string()), ContentItemMetadata::harness(), ), ), ); } }