@runuai/host 0.9.123 → 0.9.124
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.
- package/lib/container-runtime.ts +2 -0
- package/lib/task-environment/index.ts +15 -2
- package/package.json +1 -1
- package/src/index.ts +5 -1
package/lib/container-runtime.ts
CHANGED
|
@@ -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 (
|
|
@@ -230,7 +230,15 @@ export function reconstructTaskEnvironment(
|
|
|
230
230
|
export async function reconstructPersistedTaskEnvironment(
|
|
231
231
|
task: HostTask,
|
|
232
232
|
): Promise<TaskEnvironmentHandle<TaskDownResult> | null> {
|
|
233
|
-
|
|
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
|
-
|
|
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
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;
|