Skip to content

Infrastructure: Add scoped runner grants and drain-confirmed desktop controller handoff #4448

Open

Description

@JasonVMo

Current status - 2026-11-09

Unblocked. F2 #4442 is closed (#4463); F1 #4436 merged earlier (#4455). Input-lane selection (#4464) and the F16 session input policy (#4468) do not provide controller ownership transfer.

Agent-served mode and ordinary WDIO still exclude each other. The remaining behavior to implement:

  • Bounded busy, relinquish, and operator-authorized preemption
  • On handoff, stop new work, await cancellation/settlement and session DELETE, and invalidate old references, cursors, proofs and artifact links; only then grant the runner a session
  • Worker-crash drain and credential confinement, which remain acceptance requirements
  • Record launched applications as claim resources. The 2026-11-08 Windows probe showed that the claim and settlement journal do not name an uncontained packaged survivor (ledger).

F9 #4449 gates only the Storybook phase. F10-M #4446 and F10-W #4447 gate only opt-in retained supervisor-owned applications; attach-only handoff does not need them. Cross-MCP-connection resume and automatic replay are not supported.

Goal

Agent-served mode (serve --agent) and WDIO runs currently exclude one another, so moving between MCP control and suite execution requires restarting services. Add scoped runner grants and a handoff that waits for the previous controller to drain before a runner opens its own session.

Part of #4435 (plan item F11).

Scope

  • Owner: WDIO and CSF runner integration.
  • Paths (under packages/agentic/): desktop-test/src/wdio/*, the driver's grant transport and drain contracts, and storybook-desktop/src/testing/{runWdioTests,worker}.ts.
  • Default to a bounded busy result. An explicit relinquish or operator-authorized preempt stops new work, cancels and awaits settlement, confirms session deletion, invalidates references, cursors, proofs, and artifact links, and only then authorizes a new runner session. Grant revocation callbacks are not a drain barrier.
  • Keep the documented CSF exception, where the runner owns the session and an isolated Node worker borrows it, unless it is deliberately migrated.

Dependencies

Acceptance

  • MCP and WDIO cannot control the same reserved target concurrently.
  • A worker crash drains its session.
  • Stale references, cursors, and artifact links fail after handoff.
  • Credentials never enter capabilities, generated config, logs, or model output.

Validation

  • Iterate with focused yarn test <name> in each changed package, then run its yarn format, yarn lint, yarn build, and yarn test. Finish with yarn clean-lage-cache then yarn lage buildci; run yarn lage test-links --verbose --grouped after markdown changes.
  • Add a patch changeset for each changed published package. Update the owning references/current-status.md rows (done, work in progress, unsupported) and affected README/AGENTS guidance in the same change.
  • Native, provider, or process-topology changes need matching-OS native contracts and the affected consumer lane. JavaScript tests and bundles do not qualify native behavior; hosted capability skips are not passes. Report each check as passed, failed, skipped, not run, or unsupported.

Evidence

  • Current state: "MCP/WDIO handoff" and "Standalone WDIO/Jasmine execution" in packages/agentic/desktop-test/references/current-status.md.
  • Retired plan: driver-next.md at 0569e1b86, sections 6 (cancellation, handoff, and recovery) and 8 (F11).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions