Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
b9809aa
docs: propose Cua Driver environment convergence RFC
Jul 23, 2026
6d3bec1
docs: link Cua Driver convergence RFC review
Jul 23, 2026
7b9251f
docs: keep RFC tracking public
Jul 23, 2026
e307d02
docs(rfc): scope the typed Driver Python Fleet first slice
f-trycua Sep 8, 2026
b630fbf
Merge main into Driver convergence RFC review branch
f-trycua Sep 8, 2026
3b6128d
Merge refreshed RFC parent into typed Driver Phase A
f-trycua Sep 8, 2026
5afd726
docs(rfc): clarify baseline after parent branch refresh
f-trycua Sep 8, 2026
56fdcde
docs(rfc): reuse Fleet authorization for typed Driver slice
f-trycua Sep 8, 2026
54d8ebe
feat(cua-driver): add bounded typed guest envelope receiver
f-trycua Sep 8, 2026
a989072
feat(cua-driver): expose foreign remote envelope channels
f-trycua Sep 8, 2026
0ad4455
Merge commit '54d8ebe75' into feat/driver-python-channel-20260907
f-trycua Sep 8, 2026
704add5
feat(cua-driver): add private loopback envelope HTTP carrier
f-trycua Sep 8, 2026
9f5e0f9
Merge commit '0ad4455e5' into feat/driver-private-http-20260907
f-trycua Sep 8, 2026
44f6ea5
docs(cua-driver): specify private typed HTTP carrier limits
f-trycua Sep 8, 2026
eef8602
fix(cua-driver): own remote callback loops and rejected bindings
f-trycua Sep 8, 2026
5e704fb
Merge commit 'eef8602d7393e28a6386fd08c38bfbe6261bdd6b' into feat/dri…
f-trycua Sep 8, 2026
3ddc1ee
fix(cua-driver): export canonical Python action targets
f-trycua Sep 8, 2026
122ef30
Merge commit '3ddc1eed7' into feat/driver-private-http-20260907
f-trycua Sep 8, 2026
c1dc529
Merge main into accepted typed Driver slice
f-trycua Sep 9, 2026
ac75db6
Merge branch 'docs/typed-driver-phase-a-20260907' into feat/driver-en…
f-trycua Sep 9, 2026
48ee2b0
Merge branch 'main' into feat/driver-envelope-receiver-20260907
f-trycua Sep 9, 2026
9e35646
Merge branch 'feat/driver-envelope-receiver-20260907' into feat/drive…
f-trycua Sep 9, 2026
5b88d2d
Merge branch 'feat/driver-python-channel-20260907' into feat/driver-p…
f-trycua Sep 9, 2026
8b4fe60
Merge receiver landing into generated Driver bridge
f-trycua Sep 9, 2026
2ae53d3
Merge branch 'feat/driver-python-channel-20260907' into feat/driver-p…
f-trycua Sep 9, 2026
347d2c0
Merge branch 'main' into feat/driver-python-channel-20260907
f-trycua Sep 9, 2026
e9999f2
Merge branch 'feat/driver-python-channel-20260907' into feat/driver-p…
f-trycua Sep 9, 2026
973c6a5
Merge branch 'main' into feat/driver-private-http-20260907
f-trycua Sep 9, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 73 additions & 0 deletions libs/cua-driver/docs/private-envelope-http.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# Private typed envelope HTTP carrier

This carrier connects unary HTTP requests to `DriverEnvelopeReceiver`. It is
disabled unless the trusted launcher sets `CUA_DRIVER_ENVELOPE_HTTP_PORT` to a
nonzero port. It binds only to `127.0.0.1` and fails startup if binding fails.
No non-loopback binding option is provided.

This is an implementation contract, not a released Fleet setup guide. A later
image/service change must connect the loopback endpoint to Fleet's existing
authorized private named-service route. Do not expose this endpoint directly:
it does not authenticate callers. IDs and generations are lifecycle markers,
not credentials. The carrier introduces no bearer token or pairing scheme.

## Wire contract

All requests use HTTP/1.1. POST bodies require one valid `Content-Length`.
Responses are JSON with `Connection: close`; pipelined requests are not executed.
Browser-origin requests, transfer encoding, duplicate lengths, and query strings
are refused. There is no CORS support.

| Request | Body | Result |
| ------------------------------------ | --------------------------------- | ------------------------------------------------------------------- |
| `POST /v1/connections` | `{}` | `connection_id`, `generation`, `public_session`, and `capabilities` |
| `POST /v1/connections/{id}/exchange` | Canonical `DriverRequestEnvelope` | Canonical `DriverResponseEnvelope` |
| `POST /v1/connections/{id}/cancel` | `{"request_id":"REQUEST_ID"}` | `{"ok":true}` |
| `DELETE /v1/connections/{id}` | Empty or `{}` | `{"ok":true}` |

Every connection-specific request requires `X-Cua-Driver-Generation` with the
value returned at creation. Missing generations fail with HTTP 400, absent
connections with 404, and mismatches with 409. A client must not reopen a
connection automatically after those failures.

Creation binds a Standard session with a one-hour maximum lifetime and a
five-minute idle lifetime. The immutable runtime ceiling still applies:
incompatible runtimes refuse creation. This slice does not inherit unrestricted
mode or accept permission modes, manifests, or arbitrary session options from
the wire. Ordinary typed calls use `session=None`; operations requiring a
session label use the returned `public_session`.

`capabilities` contains `minimum_envelope_version`, `maximum_envelope_version`,
and `supports_cancellation`. This carrier supports envelope version 1 and
cancellation. Independent `bind_session` requests are not implemented; the
returned canonical Driver root already owns one bound session.

## Resource and cleanup limits

- Request headers: 16 KiB; request body: 1 MiB.
- Response body: 16 MiB. An oversized exchange closes its session and returns
`response_too_large` with unknown completion; it must not be replayed.
- Live connection entries: 64, reaped after five idle minutes.
- HTTP tasks: 64; exchanges: 32, admitted without an unbounded wait queue.
Remaining task capacity permits cancellation and close during action load.
- Request reading and response writing: ten-second limits. Exchange deadlines
and per-connection replay prevention are enforced by the receiver.

Close is idempotent and retains the closed request ledger until idle removal.
Idle reaping skips active exchanges. Shutdown cancels the listener and its
connection tasks and closes owned sessions. It does not shut down the shared
Driver runtime or computer-server, release a Fleet claim, or delete a pool.

## Verification boundary

Synthetic parser/routing tests cover malformed input, limits, generation
checks, raw results, close, active-session reaping, cancellation under full
exchange load, and oversized responses. Run them from `libs/cua-driver/rust`:

```sh
cargo test -p cua-driver --bin cua-driver driver_service_http --locked
```

These tests do not establish guest network isolation, Fleet authorization,
image packaging, real desktop effects, or compatibility with a released Python
client. Those remain explicit integration and qualification gates.
1 change: 1 addition & 0 deletions libs/cua-driver/rust/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions libs/cua-driver/rust/crates/cua-driver/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ cua-driver-sdk = { path = "../cua-driver-sdk" }
cursor-overlay = { path = "../cursor-overlay" }
pip-preview = { path = "../pip-preview" }
async-trait = "0.1"
httparse = "1.10.1"
base64 = { workspace = true }
uuid = { workspace = true }
zeroize = { workspace = true }
Expand Down
Loading
Loading