Skip to content

Expose execHost and migrate process callers - #1899

Closed
eric8810 wants to merge 31 commits into
mainfrom
eric/1292-domain-exec
Closed

eric8810 wants to merge 31 commits into
mainfrom
eric/1292-domain-exec

Conversation

@eric8810

@eric8810 eric8810 commented Nov 20, 2026 •

Copy link
Copy Markdown
Collaborator

Refs #1292 · Refs #1295

Final API: execHost

All methods are asynchronous. Paths are absolute on the execution node. outputDir is required: WorkspaceTools passes its Session command-output directory to start; ShellSession passes its branch output directory to shell.

Method Request Reply
start {taskId, command, cwd, workspace, roots, outputDir} {outputPath}
retainOutput {taskId} {outputPath}
shell {taskId, cwd, workspace, roots, outputDir, cols, rows} {outputPath}
wait {taskId, timeoutMs?} {status, exitCode?, signal?, durationMs, outputPath, outputBytes, outputTruncated, preview, previewTruncated, failureNote?}
kill {taskId} {}
settle {taskId} {}
output {taskId, cursor?, limit?} or {outputPath, cursor?, limit?} {text, bytes, nextCursor?, truncated, retainedFrom, reset?}
tail {taskId} {text, totalBytes, truncated}
write {taskId, data} (base64 bytes) {}
resize {taskId, cols, rows} {}
removeOutputDirectory {path} {}
info {} {os, arch, home, timezone?, execRoot, platformRoots, backend, execShell}
confined {program, args, read, write, env?, timeoutMs, outputLimit, services} {status, stdout, stderr, confined, stdoutTruncated, stderrTruncated}
configured {command, cwd, env?, stdin?, timeoutMs, limits: {stdout, stderr}} {status, exitCode?, signal?, durationMs, stdout, stderr, stdoutTruncated, stderrTruncated}
  • start returns the planned log path. Short foreground output stays in memory. Oversized output spills to the log. Background handoff calls retainOutput before registering the log.
  • info.arch: string is the execution node’s existing CPU architecture, e.g. arm64 or x64.
  • info.backend is {state: "available"} or {state: "unavailable", reason}. info.execShell is {state: "available", executable, edition, source, outputEncoding} or {state: "unavailable", code, reason}.
  • wait.status is one of exited, signaled, timed_out, cancelled, failed. Service errors carry {code, message}.

@eric8810 eric8810 mentioned this pull request Nov 20, 2026
6 of 45 tasks
# Conflicts:
#	docs/architecture/rust-agent/generated/modules.json
#	docs/architecture/rust-agent/generated/modules.mmd
@eric8810
eric8810 requested a review from yyhhyyyyyy November 21, 2026 15:07

@zerob13 zerob13 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two regressions on the exact merge need fixes before approval:

  1. crates/dim-agent-capabilities/src/host_platform/face.rs:34: background paging rejects an output file created by the same execution profile when the configured output directory does not match the reader's default. The typed test reads the live tail and confirms the file exists before paging returns Unavailable; transport paging fails too. Keep ExecHost as the reader and bind it to the exact authorized output location recorded by the writer, including restore. Do not broaden allowed roots.
  2. xtask/src/scenario_eval.rs:9618: pooled/rejudge fixtures provide a legacy native HostPlatform value after ExecHost has switched to a shared face. Both providers now claim the same native key and fixture assembly fails. Pass isolated home through server configuration and let HostPlatform own both bindings.

The same cases pass on the baseline tree. Exact failing Linux job · Baseline.

@eric8810
eric8810 marked this pull request as ready for review November 22, 2026 00:01
@eric8810
eric8810 marked this pull request as draft November 22, 2026 00:06
@eric8810

Copy link
Copy Markdown
Collaborator Author

Closing in favor of a corrected design from main.

This branch implements a separate execHost face as an object: a hand-written HostDispatch in host_platform/face.rs, an ExecHost wrapper, a HostPlatform rename, and a process-scope move of command/PTY ownership. rutis already serves a service's public &self methods by name through #[rutis::service] and ctx.provide; business code does not write a HostDispatch. Scope is orthogonal to exposure: a service is served in the scope it is provided, and a leaf mounts part copies in the host's instances.

The corrected design keeps the existing services:

  • hostPlatform (process): its own data methods (info, exec_shell, sandbox_backend, exec_root); handle methods stay #[service(skip)].
  • toolHost (session): execute remains the exec entry.
  • backgroundExec (branch): output, outputPage, wait, stop; start stays skip.
  • sessionMethods.shell (branch): the shell operations.

No ownership move, no rename, no HostFacts, no hand-written plugin.d.ts; xtask types generates the declarations. Cancellation uses the existing cancelled: CancelledFn callback. The design update is in #1295; the replacement PR follows from main.

@eric8810

Copy link
Copy Markdown
Collaborator Author

The replacement is #2002 (from main): it withdraws the execHost face, keeps hostPlatform's own data methods, and leaves the task/shell operations on toolHost, backgroundExec and sessionMethods.shell. No ownership move, no rename, no hand-written dispatch or TypeScript.

@eric8810
eric8810 deleted the eric/1292-domain-exec branch November 22, 2026 07:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants