Skip to content

feat(commandbridge): support host-owned process environments - #28

Merged
chicoxyzzy merged 8 commits into
mainfrom
feat/host-owned-process-env
Jul 17, 2026
Merged

feat(commandbridge): support host-owned process environments#28
chicoxyzzy merged 8 commits into
mainfrom
feat/host-owned-process-env

Conversation

@chicoxyzzy

@chicoxyzzy chicoxyzzy commented Jul 17, 2026

Copy link
Copy Markdown
Member

What changed

  • Adds command runners that accept a host-owned base environment while preserving existing standalone defaults.
  • Renders ACP resource links only into the current provider command.
  • Retains attachment name and MIME context, but removes full paths, parent paths and URIs, ephemeral directory basenames, JSON spellings, and Windows drive/UNC variants from retained assistant history.
  • Refuses already-cancelled launches before allocating command pipes.
  • Runs launched commands in owned Unix process groups or Windows kill-on-close Job Objects.
  • On Windows, starts the provider suspended, assigns it to the Job Object, and resumes only after containment succeeds, closing the descendant-spawn race.
  • Cancels the complete process unit on context cancellation, stream-consumer failure, and normal leader exit; inherited-pipe drain stays bounded.
  • Preserves typed missing-command errors across native run, streaming, and started-child APIs.

Why

An embedding runtime must own the exact executable path, sanitized child environment, private attachment lifetime, and complete provider process tree. Those boundaries prevent deleted staged paths from reappearing, prevent cancelled work from starting, and prevent helper descendants from surviving cancellation on supported platforms.

Impact

Existing standalone adapters retain their defaults. Embedders can inject process policy without replacing the toolkit's ordered ACP transport. Later turns retain useful attachment metadata without retaining private filesystem locations.

Validation

  • go test ./...
  • go vet ./...
  • go test -race -timeout 10m ./...
  • Real Windows CI process suite with descendant-marker regression
  • Windows process and command-bridge cross-builds and vet
  • Two-turn URI, decoded-path, parent-directory, basename, JSON, and Windows path replay regressions
  • Pre-cancelled no-launch regressions for run, streaming run, and started-child APIs
  • Synchronized stubborn-descendant tests for cancellation, stream failure, and leader-exit races
  • Typed missing-command regressions for every process entry point
  • Focused concurrency regressions repeated ten times

Stacked on #27.

Base automatically changed from feat/native-session-loss-contract to main July 17, 2026 08:31
@chicoxyzzy
chicoxyzzy marked this pull request as ready for review July 17, 2026 08:32
@chicoxyzzy
chicoxyzzy merged commit 8510f61 into main Jul 17, 2026
2 checks passed
@chicoxyzzy
chicoxyzzy deleted the feat/host-owned-process-env branch July 17, 2026 08:33
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.

1 participant