test(orchestrator): inject SkillStore into LaunchAgent after skills merge
The orchestrator branch predated the skills feature; its LaunchAgent test construction lagged the new 8-arg signature. Add an empty FakeSkills to both the service and watcher tests. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@ -22,11 +22,13 @@ use domain::markdown::MarkdownDoc;
|
|||||||
use domain::ports::{
|
use domain::ports::{
|
||||||
AgentContextStore, AgentRuntime, ContextInjectionPlan, DirEntry, EventBus, EventStream,
|
AgentContextStore, AgentRuntime, ContextInjectionPlan, DirEntry, EventBus, EventStream,
|
||||||
ExitStatus, FileSystem, FsError, IdGenerator, OutputStream, PreparedContext, ProfileStore,
|
ExitStatus, FileSystem, FsError, IdGenerator, OutputStream, PreparedContext, ProfileStore,
|
||||||
PtyError, PtyHandle, PtyPort, RemotePath, RuntimeError, SpawnSpec, StoreError,
|
PtyError, PtyHandle, PtyPort, RemotePath, RuntimeError, SkillStore, SpawnSpec, StoreError,
|
||||||
};
|
};
|
||||||
|
use domain::ids::SkillId;
|
||||||
use domain::profile::{AgentProfile, ContextInjection};
|
use domain::profile::{AgentProfile, ContextInjection};
|
||||||
use domain::project::{Project, ProjectPath};
|
use domain::project::{Project, ProjectPath};
|
||||||
use domain::remote::RemoteRef;
|
use domain::remote::RemoteRef;
|
||||||
|
use domain::skill::{Skill, SkillScope};
|
||||||
use domain::{OrchestratorCommand, OrchestratorRequest, PtySize, SessionId};
|
use domain::{OrchestratorCommand, OrchestratorRequest, PtySize, SessionId};
|
||||||
use uuid::Uuid;
|
use uuid::Uuid;
|
||||||
|
|
||||||
@ -152,6 +154,35 @@ impl ProfileStore for FakeProfiles {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Empty skill store: the orchestrator tests spawn agents with no assigned skills.
|
||||||
|
#[derive(Default)]
|
||||||
|
struct FakeSkills;
|
||||||
|
#[async_trait]
|
||||||
|
impl SkillStore for FakeSkills {
|
||||||
|
async fn list(&self, _scope: SkillScope, _root: &ProjectPath) -> Result<Vec<Skill>, StoreError> {
|
||||||
|
Ok(Vec::new())
|
||||||
|
}
|
||||||
|
async fn get(
|
||||||
|
&self,
|
||||||
|
_scope: SkillScope,
|
||||||
|
_root: &ProjectPath,
|
||||||
|
_id: SkillId,
|
||||||
|
) -> Result<Skill, StoreError> {
|
||||||
|
Err(StoreError::NotFound)
|
||||||
|
}
|
||||||
|
async fn save(&self, _skill: &Skill, _root: &ProjectPath) -> Result<(), StoreError> {
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
async fn delete(
|
||||||
|
&self,
|
||||||
|
_scope: SkillScope,
|
||||||
|
_root: &ProjectPath,
|
||||||
|
_id: SkillId,
|
||||||
|
) -> Result<(), StoreError> {
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
struct FakeRuntime;
|
struct FakeRuntime;
|
||||||
impl AgentRuntime for FakeRuntime {
|
impl AgentRuntime for FakeRuntime {
|
||||||
fn detect(&self, _profile: &AgentProfile) -> Result<bool, RuntimeError> {
|
fn detect(&self, _profile: &AgentProfile) -> Result<bool, RuntimeError> {
|
||||||
@ -337,6 +368,7 @@ fn fixture(contexts: FakeContexts) -> Fixture {
|
|||||||
Arc::new(FakeRuntime),
|
Arc::new(FakeRuntime),
|
||||||
Arc::new(FakeFs),
|
Arc::new(FakeFs),
|
||||||
Arc::new(pty.clone()),
|
Arc::new(pty.clone()),
|
||||||
|
Arc::new(FakeSkills),
|
||||||
Arc::clone(&sessions),
|
Arc::clone(&sessions),
|
||||||
Arc::new(bus.clone()),
|
Arc::new(bus.clone()),
|
||||||
));
|
));
|
||||||
|
|||||||
@ -21,11 +21,13 @@ use domain::markdown::MarkdownDoc;
|
|||||||
use domain::ports::{
|
use domain::ports::{
|
||||||
AgentContextStore, AgentRuntime, ContextInjectionPlan, DirEntry, EventBus, EventStream,
|
AgentContextStore, AgentRuntime, ContextInjectionPlan, DirEntry, EventBus, EventStream,
|
||||||
ExitStatus, FileSystem, FsError, IdGenerator, OutputStream, PreparedContext, ProfileStore,
|
ExitStatus, FileSystem, FsError, IdGenerator, OutputStream, PreparedContext, ProfileStore,
|
||||||
PtyError, PtyHandle, PtyPort, RemotePath, RuntimeError, SpawnSpec, StoreError,
|
PtyError, PtyHandle, PtyPort, RemotePath, RuntimeError, SkillStore, SpawnSpec, StoreError,
|
||||||
};
|
};
|
||||||
|
use domain::ids::SkillId;
|
||||||
use domain::profile::{AgentProfile, ContextInjection};
|
use domain::profile::{AgentProfile, ContextInjection};
|
||||||
use domain::project::{Project, ProjectPath};
|
use domain::project::{Project, ProjectPath};
|
||||||
use domain::remote::RemoteRef;
|
use domain::remote::RemoteRef;
|
||||||
|
use domain::skill::{Skill, SkillScope};
|
||||||
use domain::{PtySize, SessionId};
|
use domain::{PtySize, SessionId};
|
||||||
use uuid::Uuid;
|
use uuid::Uuid;
|
||||||
|
|
||||||
@ -142,6 +144,35 @@ impl ProfileStore for FakeProfiles {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Empty skill store: the watcher tests spawn agents with no assigned skills.
|
||||||
|
#[derive(Default)]
|
||||||
|
struct FakeSkills;
|
||||||
|
#[async_trait]
|
||||||
|
impl SkillStore for FakeSkills {
|
||||||
|
async fn list(&self, _scope: SkillScope, _root: &ProjectPath) -> Result<Vec<Skill>, StoreError> {
|
||||||
|
Ok(Vec::new())
|
||||||
|
}
|
||||||
|
async fn get(
|
||||||
|
&self,
|
||||||
|
_scope: SkillScope,
|
||||||
|
_root: &ProjectPath,
|
||||||
|
_id: SkillId,
|
||||||
|
) -> Result<Skill, StoreError> {
|
||||||
|
Err(StoreError::NotFound)
|
||||||
|
}
|
||||||
|
async fn save(&self, _skill: &Skill, _root: &ProjectPath) -> Result<(), StoreError> {
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
async fn delete(
|
||||||
|
&self,
|
||||||
|
_scope: SkillScope,
|
||||||
|
_root: &ProjectPath,
|
||||||
|
_id: SkillId,
|
||||||
|
) -> Result<(), StoreError> {
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
struct FakeRuntime;
|
struct FakeRuntime;
|
||||||
impl AgentRuntime for FakeRuntime {
|
impl AgentRuntime for FakeRuntime {
|
||||||
fn detect(&self, _p: &AgentProfile) -> Result<bool, RuntimeError> {
|
fn detect(&self, _p: &AgentProfile) -> Result<bool, RuntimeError> {
|
||||||
@ -267,6 +298,7 @@ fn build_service(contexts: FakeContexts) -> Arc<OrchestratorService> {
|
|||||||
Arc::new(FakeRuntime),
|
Arc::new(FakeRuntime),
|
||||||
Arc::new(FakeFs),
|
Arc::new(FakeFs),
|
||||||
Arc::new(FakePty),
|
Arc::new(FakePty),
|
||||||
|
Arc::new(FakeSkills),
|
||||||
Arc::clone(&sessions),
|
Arc::clone(&sessions),
|
||||||
bus.clone(),
|
bus.clone(),
|
||||||
));
|
));
|
||||||
|
|||||||
Reference in New Issue
Block a user