Repository navigation
feat(runtime): establish DoubleAgent service foundation - #39
Conversation
|
Starting automated code review... |
There was a problem hiding this comment.
Review findings for ISL-1744 (current head 076b9f4):
-
Router ingress can be stalled by one connection —
crates/router/src/main.rs:42-54. The listener handles connections serially, andread_frameblocks onread_exactwithout an ingress timeout. A peer that opens the socket and sends no frame (or sends a slow frame) prevents every subsequent request and even health request from being served. Since this router sits on all evaluation egress, one stalled request blocks unrelated traffic. Handle connections independently and bound ingress reads so a stalled peer cannot monopolize the listener. -
Valid host authorities are rejected instead of preserved —
src/doubleagent/sdk/models.py:35-40andcrates/router/src/lib.rs:76-83.ProviderRequestrejects uppercase hosts and any host containing a port, while the router requires an exact match against the lowercase managed-host table. BothAPI.example.comandapi.example.com:443are valid HTTPS authorities, but this path returns a failure before classification. ISL-1744 requires the raw host to survive the local round trip, and the parent architecture keeps Sandbox A's outbound request contract unchanged. Keep the original authority in the request and use a normalized host key only for routing/host binding.
|
Starting automated code re-review... |
There was a problem hiding this comment.
Re-review of head 0b79b4f: the two findings from my prior review are addressed. The ingress handler now isolates peers and applies a total read deadline, and raw host authorities are preserved while routing uses a canonical key.
One remaining change is needed:
- Router health stays ready after the runtime is lost —
crates/router/src/main.rs:30-36andcrates/router/src/lib.rs:48-63. The router checks runtime health only once during startup. Its laterhealthresponse is a hard-codedready, so terminating the Python runtime leaves the router reporting healthy indefinitely even though every managed request returns 502. The parent architecture requires loss of Sandbox B health to block agent egress. Have router health probe the runtime (or track its liveness) and report unhealthy when the runtime is unavailable; cover the runtime-loss case in the health contract.
|
Starting automated code re-review... |
There was a problem hiding this comment.
Re-review of head 8140be7: the router now probes runtime health on every health request and reports unhealthy when the runtime is unavailable or incompatible. This addresses my remaining finding. The earlier ingress concurrency and raw-authority findings remain addressed. I found no further actionable issues; all current CI checks pass.
|
Starting E2E verification... |
Verification Report — PASSEDVerified PR head Scenario 1: Trusted health reports the protocol version and both explicitly loaded services — PASSEDLaunched Scenario 2: Managed requests preserve method, host, path, ordered duplicate query/header pairs, and binary bodies through a Rust-to-Python round trip — PASSEDWith Scenario 3: Services receive immutable, evaluation-bound task context; mismatched task IDs are rejected — PASSED
Scenario 4: Supported operations return raw provider responses, and virtual writes cannot use upstream transport — PASSED
Scenario 5: Unknown services and operations fail closed without upstream forwarding — PASSEDThe live router returned a raw 502 for Scenario 6: The SDK exposes no capture or checkpoint interface — PASSED
Scenario 7: Python and Rust CI checks pass — PASSED
Scenario 8: Runtime loss and stalled peers — PASSEDIn the live process run, router health changed from Evidence and scopeThe live run command was |
|
Starting automated code re-review... |
There was a problem hiding this comment.
Re-review of head 698bd54: I checked the new source-request binding, raw scheme/target round trip, strict launch validation, capability-aware health, managed-host negotiation, and router frame budget against ISL-1744 and the earlier fixes. I found no remaining actionable issues. All current CI checks pass; I did not run tests locally.
|
Starting E2E re-verification... |
Verification Report — PASSEDRe-verified PR #39 at head Scenario 1: Trusted health reports the protocol version and both explicitly loaded services — PASSED
Scenario 2: Managed requests preserve method, host, path, ordered duplicate query/header pairs, and binary bodies through a Rust-to-Python round trip — PASSED
Scenario 3: Services receive immutable, evaluation-bound task context; mismatched task IDs are rejected — PASSED
Scenario 4: Supported operations return raw provider responses, and virtual writes cannot use upstream transport — PASSEDWith recording capabilities, Scenario 5: Unknown services and operations fail closed without upstream forwarding — PASSEDThe live runtime socket returned 421 for Scenario 6: The SDK exposes no capture or checkpoint interface — PASSED
Scenario 7: Python and Rust CI checks pass — PASSED
Scenario 8: Source binding and exact target contract — PASSEDThe Rust-to-Python round trip asserted Scenario 9: Readiness and managed-host agreement — PASSEDThe live entrypoint returned Scenario 10: Strict launch and bounded protocol frames — PASSED
Scope
|
698bd54 to
255a58c
Compare
Refs: ISL-1744 Run genuine Test, Format, Clippy, and Build jobs matching the active repository ruleset.
ISL-1744 Co-authored-by: Cursor <cursoragent@cursor.com>
ISL-1744 Co-authored-by: Cursor <cursoragent@cursor.com>
Summary
source_request_idas a keyword argument; concurrent dispatches cannot overwrite a shared service context.Verification
cargo build -p doubleagent-router,uv run pytest(33 passed),uv run ruff check .,uv run ruff format --check ., anduv run pre-commit run --all-filespassed.cargo fmt --all -- --check,cargo clippy -p doubleagent-router --all-targets -- -D warnings, andcargo test -p doubleagent-router(7 passed) passed.Cross-ticket interface assumptions
modified_readframe carriessource_request_idfrom the original managed request and the exact request scheme/raw target. The Python router-backed transport owned by ISL-1745 must accept the boundsource_request_idkeyword argument and pass it intomodified_read_to_wire; the router uses it for protected-envelope lookup. Until that transport is installed, the runtime reports unhealthy and upstream reads fail closed.Refs: ISL-1744