Skip to content

fix(sandbox): remove double response relay in passthrough credential path#610

Merged
johntmyers merged 1 commit intomainfrom
fix/relay-passthrough-double-response
Mar 25, 2026
Merged

fix(sandbox): remove double response relay in passthrough credential path#610
johntmyers merged 1 commit intomainfrom
fix/relay-passthrough-double-response

Conversation

@johntmyers
Copy link
Collaborator

Summary

  • Fixes a deadlock in relay_passthrough_with_credentials that caused all HTTP/1.1 keep-alive clients (e.g. npm install) to hang indefinitely when proxied through the sandbox without L7 rules configured.

Related Issue

None — discovered during live debugging of npm install hanging inside a sandbox.

Changes

relay_passthrough_with_credentials called relay_http_request_with_resolver (which internally relays the upstream response back to the client via relay_response at rest.rs:194) and then immediately called relay_response_to_client a second time. The second call blocked forever waiting for a response that would never arrive because the upstream was waiting for the next request — deadlocking every CONNECT tunnel after its first request/response pair.

The fix removes the duplicate relay_response_to_client call and uses the reusable flag already returned by relay_http_request_with_resolver. This matches how relay_rest (the L7-inspection path) already works correctly.

The now-unused relay_response_to_client function becomes dead code (confirmed by compiler warning).

Testing

  • All 99 existing L7 unit tests pass (cargo test -p openshell-sandbox --lib l7)
  • Verified manually: npm install -g openclaw@latest completes successfully in a sandbox after the fix
  • Compiler confirms relay_response_to_client is now unused, proving it was only called from the buggy site

Checklist

  • Tests pass locally
  • No unrelated changes
  • Commit message follows Conventional Commits

…path

relay_passthrough_with_credentials called relay_http_request_with_resolver
(which internally relays the upstream response back to the client) and then
immediately called relay_response_to_client a second time. The second call
blocked forever waiting for a response that would never arrive, deadlocking
every CONNECT tunnel after its first request/response pair.

This caused npm install (and any HTTP/1.1 keep-alive client) to hang
indefinitely when routed through the sandbox proxy without L7 rules.

The L7-inspection path (relay_rest) was not affected — it correctly makes
a single call to relay_http_request_with_resolver.
@johntmyers johntmyers requested a review from a team as a code owner March 25, 2026 14:51
@johntmyers johntmyers self-assigned this Mar 25, 2026
@johntmyers johntmyers added the test:e2e Requires end-to-end coverage label Mar 25, 2026
@johntmyers johntmyers merged commit bd7b388 into main Mar 25, 2026
15 of 16 checks passed
@johntmyers johntmyers deleted the fix/relay-passthrough-double-response branch March 25, 2026 15:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test:e2e Requires end-to-end coverage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants