mirror of
https://github.com/block/buzz.git
synced 2026-11-08 10:21:46 +00:00
test(desktop): cover local relay skill spawn wiring
Co-authored-by: Rizz <302abe414ca6e3134763d2539bfcf145aea2a63fe5f8455204ed602fd40cf381@buzz.block.builderlab.xyz> Signed-off-by: Taylor Ho <taylorkmho@gmail.com>
This commit is contained in:
@@ -27,6 +27,19 @@ const MAX_MY_RELAY_SKILL_NOTES: usize = 500;
|
||||
const MAX_RELAY_SKILL_TITLE_BYTES: usize = 280;
|
||||
const ASSIGNED_RELAY_SKILLS_ENV: &str = "BUZZ_ACP_ASSIGNED_RELAY_SKILLS";
|
||||
|
||||
pub(crate) fn resolve_and_apply_assigned_relay_skills_env<'a>(
|
||||
command: &mut std::process::Command,
|
||||
record: &'a crate::managed_agents::ManagedAgentRecord,
|
||||
personas: &'a [crate::managed_agents::AgentDefinition],
|
||||
) -> Result<&'a [String], String> {
|
||||
let assigned =
|
||||
crate::managed_agents::effective_config::resolve_effective_assigned_relay_skills(
|
||||
record, personas,
|
||||
)?;
|
||||
apply_assigned_relay_skills_env(command, assigned);
|
||||
Ok(assigned)
|
||||
}
|
||||
|
||||
pub(crate) fn apply_assigned_relay_skills_env(
|
||||
command: &mut std::process::Command,
|
||||
coordinates: &[String],
|
||||
@@ -736,12 +749,9 @@ mod tests {
|
||||
|
||||
let definitions = [definition];
|
||||
let assigned =
|
||||
crate::managed_agents::effective_config::resolve_effective_assigned_relay_skills(
|
||||
&record,
|
||||
&definitions,
|
||||
)
|
||||
.unwrap();
|
||||
apply_assigned_relay_skills_env(&mut command, assigned);
|
||||
resolve_and_apply_assigned_relay_skills_env(&mut command, &record, &definitions)
|
||||
.unwrap();
|
||||
assert_eq!(assigned, definitions[0].assigned_relay_skills);
|
||||
|
||||
let env = command
|
||||
.get_envs()
|
||||
|
||||
@@ -15,6 +15,7 @@ use crate::{
|
||||
};
|
||||
|
||||
use super::claude_config::{apply_claude_model_env, apply_effort_env};
|
||||
use super::relay_skills::resolve_and_apply_assigned_relay_skills_env;
|
||||
mod path;
|
||||
pub(in crate::managed_agents) use path::build_augmented_path;
|
||||
pub(crate) use path::{compose_path_entries, should_skip_claude_executable, should_use_inherited};
|
||||
@@ -695,8 +696,7 @@ pub fn spawn_agent_child(
|
||||
command.env_remove("BUZZ_ACP_TEAM_INSTRUCTIONS");
|
||||
}
|
||||
let assigned_relay_skills =
|
||||
super::effective_config::resolve_effective_assigned_relay_skills(record, &personas)?;
|
||||
super::relay_skills::apply_assigned_relay_skills_env(&mut command, assigned_relay_skills);
|
||||
resolve_and_apply_assigned_relay_skills_env(&mut command, record, &personas)?;
|
||||
|
||||
// Prompt, model, and provider all come from the single `effective_cfg`
|
||||
// resolved at the top of this function — the SAME resolve the spawn-config
|
||||
|
||||
@@ -18,9 +18,12 @@ fn restart_stamp_uses_live_shared_instructions_and_clears_diff() {
|
||||
let effective = resolve_effective_config(&rec, &personas, &global)
|
||||
.require_resolved()
|
||||
.unwrap();
|
||||
let mut command = std::process::Command::new("buzz-acp");
|
||||
let assigned =
|
||||
crate::managed_agents::effective_config::resolve_effective_assigned_relay_skills(
|
||||
&rec, &personas,
|
||||
crate::managed_agents::relay_skills::resolve_and_apply_assigned_relay_skills_env(
|
||||
&mut command,
|
||||
&rec,
|
||||
&personas,
|
||||
)
|
||||
.unwrap();
|
||||
let stamped = SpawnConfigSnapshot::from_inputs(SpawnConfigInputs {
|
||||
|
||||
Reference in New Issue
Block a user