fix: remove misleading runtime capability projections

This commit is contained in:
2026-08-26 06:19:33 +09:00
parent 8c075de147
commit f7852e8034
12 changed files with 97 additions and 278 deletions
@@ -32,7 +32,7 @@ export type RuntimeConnectionSummary = {
built_in: boolean;
config_managed: boolean;
active: boolean;
can_spawn_worker: boolean;
worker_creation_available: boolean;
restart_required: boolean;
status: string;
diagnostics: Diagnostic[];
@@ -29,30 +29,15 @@ export type Diagnostic = {
message: string;
};
export type RuntimeCapabilities = {
can_list_hosts: boolean;
can_list_workers: boolean;
can_get_worker: boolean;
can_spawn_worker: boolean;
can_stop_worker: boolean;
has_workspace_fs: boolean;
has_shell: boolean;
has_git: boolean;
supports_worktrees: boolean;
supports_backend_internal_tools: boolean;
workspace_scope: string;
os: string;
arch: string;
max_workers: number;
};
export type Runtime = {
runtime_id: string;
label: string;
kind: string;
status: string;
host_ids: string[];
capabilities: RuntimeCapabilities;
worker_creation_available: boolean;
os: string;
arch: string;
diagnostics: Diagnostic[];
};
@@ -64,7 +49,8 @@ export type Host = {
status: string;
observed_at: string;
last_seen_at: string | null;
capabilities: RuntimeCapabilities;
os: string;
arch: string;
diagnostics: Diagnostic[];
};
@@ -100,7 +86,7 @@ export type WorkerLaunchRuntimeOption = {
runtime_id: string;
display_name: string;
built_in: boolean;
can_spawn_worker: boolean;
worker_creation_available: boolean;
working_directory_required: boolean;
status: string;
diagnostics: Diagnostic[];
@@ -23,7 +23,7 @@ const options: WorkerLaunchOptionsResponse = {
runtime_id: "remote",
display_name: "Remote",
status: "active",
can_spawn_worker: true,
worker_creation_available: true,
built_in: false,
working_directory_required: true,
diagnostics: [],
@@ -32,7 +32,7 @@ const options: WorkerLaunchOptionsResponse = {
runtime_id: "embedded",
display_name: "Embedded",
status: "active",
can_spawn_worker: true,
worker_creation_available: true,
built_in: true,
working_directory_required: false,
diagnostics: [],
@@ -30,9 +30,9 @@ export function defaultWorkerLaunchForm(
): WorkerLaunchFormState {
const preferredRuntime =
options?.runtimes.find((runtime) =>
runtime.can_spawn_worker && runtime.status === "active"
runtime.worker_creation_available && runtime.status === "active"
) ??
options?.runtimes.find((runtime) => runtime.can_spawn_worker) ??
options?.runtimes.find((runtime) => runtime.worker_creation_available) ??
options?.runtimes[0];
const preferredProfile = options?.profiles.find((candidate) =>
candidate.id === options.default_profile
@@ -88,7 +88,7 @@
</div>
<div>
<dt>Platform</dt>
<dd>{host.capabilities.os} / {host.capabilities.arch}</dd>
<dd>{host.os} / {host.arch}</dd>
</div>
</dl>
</article>
@@ -183,7 +183,7 @@
built_in: true,
config_managed: false,
active: false,
can_spawn_worker: false,
worker_creation_available: false,
restart_required: false,
status: 'unknown',
diagnostics: []
@@ -5,7 +5,7 @@
let { data }: PageProps = $props();
function runtimePlatform(runtime: Runtime): string {
return `${runtime.capabilities.os} / ${runtime.capabilities.arch}`;
return `${runtime.os} / ${runtime.arch}`;
}
</script>
@@ -37,7 +37,6 @@
<th>Kind</th>
<th>Status</th>
<th>Platform</th>
<th>Capacity</th>
<th>Workdirs</th>
</tr>
</thead>
@@ -51,7 +50,6 @@
<td>{runtime.kind}</td>
<td>{runtime.status}</td>
<td>{runtimePlatform(runtime)}</td>
<td>{runtime.capabilities.max_workers} workers</td>
<td>
<a class="inline-link" href={`/w/${data.workspaceId}/settings/runtimes/${encodeURIComponent(runtime.runtime_id)}/workdirs`}>
Open workdirs
@@ -313,7 +313,7 @@
<select class="worker-inline-select runtime-select" bind:value={runtimeId} required aria-label="Runtime">
{#if options?.runtimes.length}
{#each options.runtimes as runtime}
<option value={runtime.runtime_id} disabled={!runtime.can_spawn_worker}>
<option value={runtime.runtime_id} disabled={!runtime.worker_creation_available}>
{runtime.display_name}
</option>
{/each}