[BUG] Proxy byte counters remain zero after routed session traffic

Author: m2moizCreated Jul 31, 2026Updated Aug 7, 2026

What I was trying to do

I was validating an explicit proxy-backed agent session and using Steel's final traffic counters for operational accounting after the session was released.

Versions tested

  • Steel API 0.5.2 runtime; current main inspected for counter/close ordering
  • Chromium 150.0.7871.124
  • Node 22.13.0
  • Docker on Debian 12, host macOS arm64

Describe the bug

A session configured with proxyUrl routes document, subresource, favicon, and browser background requests through the proxy, but Steel reports proxyTxBytes: 0 and proxyRxBytes: 0.

To reproduce

  1. Start a loopback HTTP proxy that records byte totals.
  2. Create a Steel session with proxyUrl pointing at that proxy.
  3. Navigate to a local fixture with HTML, CSS, JavaScript, and an image.
  4. Confirm the proxy saw the document and subresources.
  5. Release the session and inspect the returned/live session details.

Actual behavior

The proxy log proves routed traffic, but Steel returns:

json
{
  "proxyTxBytes": 0,
  "proxyRxBytes": 0
}

Expected behavior

The final session record should include the proxy's transmitted and received byte totals after all proxy streams have closed.

Screenshots

Not applicable. The reduced API response and proxy request count are sufficient.

Desktop

  • OS: Docker on Debian 12, host macOS arm64
  • Browser: Chromium 150.0.7871.124
  • Steel API: 0.5.2; current main reads counters before closing the proxy
  • Node: 22.13.0

Smartphone

N/A

Additional context

The current release path reads txBytes and rxBytes before the proxy is closed. Moving the snapshot after await proxyServer.close(true) produced non-zero final totals locally and passed the session-service regression.