tui: filter panel pods by workspace
This commit is contained in:
@@ -1108,6 +1108,7 @@ mod tests {
|
||||
let parent = PodMetadata {
|
||||
pod_name: "parent".into(),
|
||||
active: None,
|
||||
workspace_root: None,
|
||||
spawned_children: vec![
|
||||
child("child-live", &live_socket),
|
||||
child("child-stale", &stale_socket),
|
||||
@@ -1127,6 +1128,7 @@ mod tests {
|
||||
session_id,
|
||||
active_child_segment,
|
||||
)),
|
||||
workspace_root: None,
|
||||
spawned_children: Vec::new(),
|
||||
reclaimed_children: Vec::new(),
|
||||
peers: Vec::new(),
|
||||
@@ -1140,6 +1142,7 @@ mod tests {
|
||||
session_id,
|
||||
active_child_segment,
|
||||
)),
|
||||
workspace_root: None,
|
||||
spawned_children: Vec::new(),
|
||||
reclaimed_children: Vec::new(),
|
||||
peers: Vec::new(),
|
||||
@@ -1150,6 +1153,7 @@ mod tests {
|
||||
.write(&PodMetadata {
|
||||
pod_name: "child-pending".into(),
|
||||
active: Some(PodActiveSegmentRef::pending_segment(pending_session_id)),
|
||||
workspace_root: None,
|
||||
spawned_children: Vec::new(),
|
||||
reclaimed_children: Vec::new(),
|
||||
peers: Vec::new(),
|
||||
@@ -1163,6 +1167,7 @@ mod tests {
|
||||
session_id,
|
||||
new_segment_id(),
|
||||
)),
|
||||
workspace_root: None,
|
||||
spawned_children: Vec::new(),
|
||||
reclaimed_children: Vec::new(),
|
||||
peers: Vec::new(),
|
||||
@@ -1173,6 +1178,7 @@ mod tests {
|
||||
.write(&PodMetadata {
|
||||
pod_name: "peer".into(),
|
||||
active: None,
|
||||
workspace_root: None,
|
||||
spawned_children: Vec::new(),
|
||||
reclaimed_children: Vec::new(),
|
||||
peers: vec![pod_store::PodPeer {
|
||||
@@ -1366,6 +1372,7 @@ mod tests {
|
||||
.write(&PodMetadata {
|
||||
pod_name: "source".into(),
|
||||
active: None,
|
||||
workspace_root: None,
|
||||
spawned_children: Vec::new(),
|
||||
reclaimed_children: Vec::new(),
|
||||
peers: vec![pod_store::PodPeer {
|
||||
@@ -1405,6 +1412,7 @@ mod tests {
|
||||
.write(&PodMetadata {
|
||||
pod_name: "source".into(),
|
||||
active: None,
|
||||
workspace_root: None,
|
||||
spawned_children: Vec::new(),
|
||||
reclaimed_children: Vec::new(),
|
||||
peers: vec![pod_store::PodPeer {
|
||||
@@ -1417,6 +1425,7 @@ mod tests {
|
||||
.write(&PodMetadata {
|
||||
pod_name: "target".into(),
|
||||
active: None,
|
||||
workspace_root: None,
|
||||
spawned_children: Vec::new(),
|
||||
reclaimed_children: Vec::new(),
|
||||
peers: vec![pod_store::PodPeer {
|
||||
@@ -1519,6 +1528,7 @@ mod tests {
|
||||
.write(&PodMetadata {
|
||||
pod_name: "source".into(),
|
||||
active: None,
|
||||
workspace_root: None,
|
||||
spawned_children: Vec::new(),
|
||||
reclaimed_children: Vec::new(),
|
||||
peers: vec![pod_store::PodPeer {
|
||||
@@ -1531,6 +1541,7 @@ mod tests {
|
||||
.write(&PodMetadata {
|
||||
pod_name: "target".into(),
|
||||
active: None,
|
||||
workspace_root: None,
|
||||
spawned_children: Vec::new(),
|
||||
reclaimed_children: Vec::new(),
|
||||
peers: vec![pod_store::PodPeer {
|
||||
@@ -1631,6 +1642,7 @@ mod tests {
|
||||
.write(&PodMetadata {
|
||||
pod_name: "source".into(),
|
||||
active: None,
|
||||
workspace_root: None,
|
||||
spawned_children: vec![child("target", &socket)],
|
||||
reclaimed_children: Vec::new(),
|
||||
peers: Vec::new(),
|
||||
|
||||
@@ -924,7 +924,7 @@ impl<C: LlmClient, St: Store> Pod<C, St> {
|
||||
}
|
||||
|
||||
fn pod_metadata(&self, active: Option<PodActiveSegmentRef>) -> PodMetadata {
|
||||
pod_metadata_for_manifest(&self.manifest, active)
|
||||
pod_metadata_for_manifest(&self.manifest, &self.workspace_root, active)
|
||||
}
|
||||
|
||||
fn write_pod_metadata_pending(&self) -> Result<(), PodError> {
|
||||
@@ -4319,9 +4319,11 @@ fn request_config_from_worker_manifest(wm: &WorkerManifest) -> RequestConfig {
|
||||
|
||||
fn pod_metadata_for_manifest(
|
||||
manifest: &PodManifest,
|
||||
workspace_root: &Path,
|
||||
active: Option<PodActiveSegmentRef>,
|
||||
) -> PodMetadata {
|
||||
let mut metadata = PodMetadata::new(manifest.pod.name.clone(), active);
|
||||
let mut metadata = PodMetadata::new(manifest.pod.name.clone(), active)
|
||||
.with_workspace_root(workspace_root.to_path_buf());
|
||||
if should_persist_resolved_manifest_snapshot(manifest) {
|
||||
metadata.resolved_manifest_snapshot = serde_json::to_value(manifest).ok();
|
||||
}
|
||||
@@ -5328,7 +5330,7 @@ permission = "read"
|
||||
.unwrap();
|
||||
assert!(manifest.profile.is_none());
|
||||
assert!(
|
||||
pod_metadata_for_manifest(&manifest, None)
|
||||
pod_metadata_for_manifest(&manifest, Path::new("/snapshot/workspace"), None)
|
||||
.resolved_manifest_snapshot
|
||||
.is_none()
|
||||
);
|
||||
@@ -5361,7 +5363,7 @@ permission = "read"
|
||||
config: None,
|
||||
}];
|
||||
|
||||
let metadata = pod_metadata_for_manifest(&manifest, None);
|
||||
let metadata = pod_metadata_for_manifest(&manifest, Path::new("/snapshot/workspace"), None);
|
||||
let snapshot = metadata
|
||||
.resolved_manifest_snapshot
|
||||
.expect("plugin-resolved manifest should be snapshotted");
|
||||
|
||||
@@ -378,6 +378,7 @@ mod tests {
|
||||
.write(&PodMetadata {
|
||||
pod_name: "orchestrator".into(),
|
||||
active: None,
|
||||
workspace_root: None,
|
||||
spawned_children: Vec::new(),
|
||||
reclaimed_children: Vec::new(),
|
||||
peers: Vec::new(),
|
||||
@@ -388,6 +389,7 @@ mod tests {
|
||||
.write(&PodMetadata {
|
||||
pod_name: "companion".into(),
|
||||
active: None,
|
||||
workspace_root: None,
|
||||
spawned_children: Vec::new(),
|
||||
reclaimed_children: Vec::new(),
|
||||
peers: Vec::new(),
|
||||
|
||||
Reference in New Issue
Block a user