From 2d2c29a775a2c2ba2ab8aa3b948e592f3b25ae28 Mon Sep 17 00:00:00 2001 From: Hare Date: Sat, 11 Jul 2026 15:22:23 +0900 Subject: [PATCH] workspace: remove worker status field --- .yoi/tickets/00001KX7WG3QF/item.md | 4 +-- .yoi/tickets/00001KX7WG3QF/thread.md | 31 +++++++++++++++++++ crates/workspace-server/src/hosts.rs | 29 +++++++---------- crates/workspace-server/src/server.rs | 9 +++--- .../WorkersNavSection.svelte | 2 +- .../src/lib/workspace-sidebar/types.ts | 1 - .../workers/[workerId]/console/+page.svelte | 2 +- .../w/[workspaceId]/workers/+page.svelte | 2 +- 8 files changed, 51 insertions(+), 29 deletions(-) diff --git a/.yoi/tickets/00001KX7WG3QF/item.md b/.yoi/tickets/00001KX7WG3QF/item.md index bbf5b763..c6dca6cb 100644 --- a/.yoi/tickets/00001KX7WG3QF/item.md +++ b/.yoi/tickets/00001KX7WG3QF/item.md @@ -1,8 +1,8 @@ --- title: 'Remove duplicate Worker status field' -state: 'inprogress' +state: 'done' created_at: '2026-07-11T06:05:38Z' -updated_at: '2026-07-11T06:06:13Z' +updated_at: '2026-07-11T06:22:05Z' assignee: null queued_by: 'yoi ticket' queued_at: '2026-07-11T06:06:13Z' diff --git a/.yoi/tickets/00001KX7WG3QF/thread.md b/.yoi/tickets/00001KX7WG3QF/thread.md index 0779a554..f8286682 100644 --- a/.yoi/tickets/00001KX7WG3QF/thread.md +++ b/.yoi/tickets/00001KX7WG3QF/thread.md @@ -39,4 +39,35 @@ Ticket を `yoi ticket` が queued にしました。 State changed to `inprogress`. +--- + + + +## Implementation report + +Removed duplicate Workspace Worker `status` from browser-facing Worker summaries. + +- `WorkerSummary` now exposes `state` only for Worker state. +- Backend Worker projections populate only `state`; registry-only Workers remain `state: archived`. +- Frontend Worker type, sidebar, Workers page, and Console header no longer reference `worker.status`. +- Runtime/Host/Workdir/protocol statuses are unchanged where they are distinct domain concepts. + +Validation: +- cargo test -q -p yoi-workspace-server +- cd web/workspace && deno task check +- cd web/workspace && deno task test +- cargo test -q +- git diff --check +- nix build .#yoi --no-link + + +--- + + + +## State changed + +State changed to `done`. + + --- diff --git a/crates/workspace-server/src/hosts.rs b/crates/workspace-server/src/hosts.rs index 66b9fef5..9793e799 100644 --- a/crates/workspace-server/src/hosts.rs +++ b/crates/workspace-server/src/hosts.rs @@ -238,7 +238,6 @@ pub struct WorkerSummary { pub profile: Option, pub workspace: WorkerWorkspaceSummary, pub state: String, - pub status: String, pub last_seen_at: Option, #[serde(default)] pub pinned: bool, @@ -1191,8 +1190,7 @@ impl EmbeddedWorkerRuntime { visibility: "backend_internal".to_string(), identity: "runtime_registry_worker".to_string(), }, - state: embedded_worker_status_label(summary.status).to_string(), - status: embedded_worker_execution_status_label(summary.status, &summary.execution) + state: embedded_worker_execution_status_label(summary.status, &summary.execution) .to_string(), last_seen_at: None, pinned: false, @@ -1228,8 +1226,7 @@ impl EmbeddedWorkerRuntime { visibility: "backend_internal".to_string(), identity: "runtime_registry_worker".to_string(), }, - state: embedded_worker_status_label(detail.status).to_string(), - status: embedded_worker_execution_status_label(detail.status, &detail.execution) + state: embedded_worker_execution_status_label(detail.status, &detail.execution) .to_string(), last_seen_at: None, pinned: false, @@ -1931,8 +1928,7 @@ impl RemoteWorkerRuntime { visibility: "remote_runtime".to_string(), identity: "runtime_registry_worker".to_string(), }, - state: embedded_worker_status_label(summary.status).to_string(), - status: embedded_worker_execution_status_label(summary.status, &summary.execution) + state: embedded_worker_execution_status_label(summary.status, &summary.execution) .to_string(), last_seen_at: None, pinned: false, @@ -1967,8 +1963,7 @@ impl RemoteWorkerRuntime { visibility: "remote_runtime".to_string(), identity: "runtime_registry_worker".to_string(), }, - state: embedded_worker_status_label(detail.status).to_string(), - status: embedded_worker_execution_status_label(detail.status, &detail.execution) + state: embedded_worker_execution_status_label(detail.status, &detail.execution) .to_string(), last_seen_at: None, pinned: false, @@ -3104,7 +3099,6 @@ pub fn placeholder_worker(host_id: impl Into) -> WorkerSummary { identity: "unsupported".to_string(), }, state: "unsupported".to_string(), - status: "Worker runtime control is not wired yet".to_string(), last_seen_at: None, pinned: false, retention_state: "transient".to_string(), @@ -3431,8 +3425,7 @@ mod tests { visibility: "opaque".to_string(), identity: host_id.to_string(), }, - state: "running".to_string(), - status: "available".to_string(), + state: "available".to_string(), last_seen_at: None, pinned: false, retention_state: "transient".to_string(), @@ -3673,7 +3666,7 @@ mod tests { .worker(&worker.worker_id) .worker .expect("worker detail"); - if detail.status == "idle" { + if detail.state == "idle" { assert!(detail.capabilities.can_accept_input); break; } @@ -4078,15 +4071,15 @@ mod tests { worker.worker_id ); } - assert_eq!(workers.items[0].status, "stale"); - assert_eq!(workers.items[1].status, "unconnected"); - assert_eq!(workers.items[2].status, "rejected"); - assert_eq!(workers.items[3].status, "errored"); + assert_eq!(workers.items[0].state, "stale"); + assert_eq!(workers.items[1].state, "unconnected"); + assert_eq!(workers.items[2].state, "rejected"); + assert_eq!(workers.items[3].state, "errored"); let stale_detail = registry.worker("remote:primary", "worker-stale").unwrap(); assert!(!stale_detail.capabilities.can_accept_input); assert!(!stale_detail.capabilities.can_stop); - assert_eq!(stale_detail.status, "stale"); + assert_eq!(stale_detail.state, "stale"); server.join().expect("mock remote server finished"); } diff --git a/crates/workspace-server/src/server.rs b/crates/workspace-server/src/server.rs index 0899dab8..a897d05c 100644 --- a/crates/workspace-server/src/server.rs +++ b/crates/workspace-server/src/server.rs @@ -1583,7 +1583,7 @@ fn build_runtime_cleanup_plan( let live_running_worker_ids: HashSet = workers .items .iter() - .filter(|worker| worker.status == "running" || worker.state == "running") + .filter(|worker| worker.state == "running") .map(|worker| backend_worker_id(worker.runtime_id.as_str(), worker.worker_id.as_str())) .collect(); let (workdir_summaries, mut diagnostics) = @@ -3939,7 +3939,6 @@ fn worker_summary_from_registry(record: &WorkerRegistryRecord) -> WorkerSummary host_id: "backend-registry".to_string(), role: None, label: record.display_name.clone(), - status: "archived".to_string(), state: "archived".to_string(), last_seen_at: Some(record.updated_at.clone()), pinned: record.retention_state == "pinned", @@ -4820,7 +4819,7 @@ mod tests { let projected = merge_worker_registry_projection(None, &worker, vec![link], &[workdir]); - assert_eq!(projected.status, "archived"); + assert_eq!(projected.state, "archived"); assert_eq!(projected.state, "archived"); assert_eq!( projected.working_directory.as_ref().unwrap().status, @@ -6891,7 +6890,7 @@ mod tests { .runtime .worker("embedded-worker-runtime", &worker_id) .expect("worker detail"); - if detail.status == "idle" { + if detail.state == "idle" { break; } assert!( @@ -6913,7 +6912,7 @@ mod tests { .runtime .worker("embedded-worker-runtime", &worker_id) .expect("restored worker"); - assert_eq!(restored_worker.status, "stale"); + assert_eq!(restored_worker.state, "stale"); assert!(!restored_worker.capabilities.can_accept_input); assert!(!restored_worker.capabilities.can_stop); assert!( diff --git a/web/workspace/src/lib/workspace-sidebar/WorkersNavSection.svelte b/web/workspace/src/lib/workspace-sidebar/WorkersNavSection.svelte index 8fb1d9df..4cdbc4b3 100644 --- a/web/workspace/src/lib/workspace-sidebar/WorkersNavSection.svelte +++ b/web/workspace/src/lib/workspace-sidebar/WorkersNavSection.svelte @@ -106,7 +106,7 @@ - - {worker.role ? `${worker.role} · ` : ''}{worker.state} · {worker.status} · 🖥 {worker.host_id} + {worker.role ? `${worker.role} · ` : ''}{worker.state} · 🖥 {worker.host_id} {worker.working_directory ? ` · wd:${worker.working_directory.repository_id}@${worker.working_directory.resolved_commit.slice(0, 8)}` : ''} diff --git a/web/workspace/src/lib/workspace-sidebar/types.ts b/web/workspace/src/lib/workspace-sidebar/types.ts index fefd7e74..3f34af1e 100644 --- a/web/workspace/src/lib/workspace-sidebar/types.ts +++ b/web/workspace/src/lib/workspace-sidebar/types.ts @@ -84,7 +84,6 @@ export type Worker = { profile?: string | null; workspace: { visibility: string; identity: string }; state: string; - status: string; pinned?: boolean; retention_state?: string; last_seen_at?: string | null; diff --git a/web/workspace/src/routes/w/[workspaceId]/runtimes/[runtimeId]/workers/[workerId]/console/+page.svelte b/web/workspace/src/routes/w/[workspaceId]/runtimes/[runtimeId]/workers/[workerId]/console/+page.svelte index 3e340160..6397465e 100644 --- a/web/workspace/src/routes/w/[workspaceId]/runtimes/[runtimeId]/workers/[workerId]/console/+page.svelte +++ b/web/workspace/src/routes/w/[workspaceId]/runtimes/[runtimeId]/workers/[workerId]/console/+page.svelte @@ -324,7 +324,7 @@
- {worker?.state ?? 'unknown'} · {worker?.status ?? 'loading'} · stream {streamState} + {worker?.state ?? 'loading'} · stream {streamState}