@runuai/host 0.9.123 → 0.9.125

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -283,6 +283,8 @@ export function pinnedContainerRuntimeMachineIdentity(): {
283
283
  /** Failure message for TEARDOWN admission: only a truly absent/unpinned
284
284
  * runtime refuses teardown. `checking` with a pin admits it. */
285
285
  export function containerRuntimeTeardownProblem(): string | null {
286
+ // ADR-133 sidecar mode: teardown is the cloud terminating this machine.
287
+ if (sidecarMode()) return null;
286
288
  if (state.status === "no-runtime") return state.message;
287
289
  if (pinnedContainerRuntimeMachineIdentity() === null) {
288
290
  return (
@@ -45,6 +45,7 @@ import {
45
45
  standardImagePullCommands,
46
46
  standardImagePullDigest,
47
47
  } from "./standard-image-pin";
48
+ import { sidecarMode } from "./sidecar";
48
49
 
49
50
  /** Pinned, host-wide constants (must match task-up.sh and the compose gen). */
50
51
  export const STANDARD_IMAGE_TAG = "uai-standard:dev";
@@ -1138,6 +1139,14 @@ function markAgentClisReady(): void {
1138
1139
  export function ensureStandardImage(
1139
1140
  opts: { maxAgeMs?: number } = {},
1140
1141
  ): Promise<StandardImageResult> {
1142
+ // ADR-133 sidecar mode: a task machine has no container image to keep —
1143
+ // its agent CLIs are baked into the machine image. Live 2026-09-10
1144
+ // (hostless smoke 4): task-up refused with "could not prepare the host
1145
+ // base image uai-standard:dev … Docker is not available".
1146
+ if (sidecarMode()) {
1147
+ markAgentClisReady();
1148
+ return Promise.resolve({ ok: true });
1149
+ }
1141
1150
  // A task-up passes maxAgeMs: a pass that succeeded recently for the same
1142
1151
  // engine configuration is reused instead of spending ~15 s spinning a
1143
1152
  // maintenance container per task (live 2026-09-09: 16 s of every task
@@ -230,7 +230,15 @@ export function reconstructTaskEnvironment(
230
230
  export async function reconstructPersistedTaskEnvironment(
231
231
  task: HostTask,
232
232
  ): Promise<TaskEnvironmentHandle<TaskDownResult> | null> {
233
- const locator = persistedTaskEnvironmentLocator(task, requireMachineIdentity());
233
+ // ADR-133: a machine or sidecar row carries its own locator and never
234
+ // needs the container runtime's identity — on a task machine there is
235
+ // none, and demanding it here would strand every session after task-up.
236
+ const locator = persistedTaskEnvironmentLocator(
237
+ task,
238
+ isEnvironmentTransportProvider(task.environmentProvider)
239
+ ? null
240
+ : requireMachineIdentity(),
241
+ );
234
242
  if (locator === null) return null;
235
243
  const handle = await registry.reconstruct(locator);
236
244
  if (handle.descriptor.taskId !== task.taskId) {
@@ -255,7 +263,9 @@ export function persistedTaskEnvironmentLocator(
255
263
  | "codeServerPort"
256
264
  | "previewPorts"
257
265
  >,
258
- machine: HostMachineIdentity,
266
+ /** Null only for rows whose provider is reached over the environment
267
+ * transport (machine, self): their locator is self-contained. */
268
+ machine: HostMachineIdentity | null,
259
269
  ): TaskEnvironmentLocator | null {
260
270
  const provider = task.environmentProvider;
261
271
  const raw = task.environmentLocator;
@@ -273,6 +283,9 @@ export function persistedTaskEnvironmentLocator(
273
283
  if (task.composeProject === null || task.worktreePath === null) {
274
284
  throw new Error("legacy task runtime persistence is incomplete");
275
285
  }
286
+ if (machine === null) {
287
+ throw new Error("legacy task runtime cannot be adopted on a task machine");
288
+ }
276
289
  throw new Error(
277
290
  machine.backend === "docker"
278
291
  ? "legacy Docker resources have not passed safe adoption"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@runuai/host",
3
- "version": "0.9.123",
3
+ "version": "0.9.125",
4
4
  "description": "Uai host — runs ephemeral AI tasks in containers on a machine you control.",
5
5
  "license": "MIT",
6
6
  "author": "Uai Tech <team@runuai.com>",
package/src/index.ts CHANGED
@@ -185,7 +185,7 @@ export type {
185
185
  PreviewPortRuntime,
186
186
  } from "../lib/preview-ports";
187
187
  import { isEnvironmentTransportProvider } from "../lib/task-environment/types";
188
- import { awaitSidecarReady } from "../lib/sidecar";
188
+ import { awaitSidecarReady, sidecarMode } from "../lib/sidecar";
189
189
 
190
190
  export const hostEvents: HostEventStream = {
191
191
  subscribe(handler) {
@@ -1638,6 +1638,10 @@ const RUNTIME_TASK_ADMISSION_WAIT_MS = 3_000;
1638
1638
  async function prepareContainerRuntimeForTask(): Promise<
1639
1639
  HostCommandResult<never> | null
1640
1640
  > {
1641
+ // ADR-133 sidecar mode: the task runs on this machine; there is no
1642
+ // container runtime to prepare (live 2026-09-10, hostless smoke 3: this
1643
+ // step answered with the no-runtime message before the gated check ran).
1644
+ if (sidecarMode()) return null;
1641
1645
  let prepared:
1642
1646
  | Awaited<ReturnType<typeof ensureContainerRuntimeForTask>>
1643
1647
  | null;