Repository navigation
feat(website): record a website env's traffic as PCAP, served through traffic/v1 (FD-4683) - #469
williamloo-scale wants to merge 8 commits into
Conversation
a767a25 to
d160d31
Compare
194572e to
3b757da
Compare
d160d31 to
5953d5a
Compare
3b757da to
73241f9
Compare
5953d5a to
9f2a5ca
Compare
73241f9 to
0192f08
Compare
0192f08 to
77c1ede
Compare
4283738 to
0cca3db
Compare
77c1ede to
965deb7
Compare
0cca3db to
a1ec8b4
Compare
965deb7 to
9ac178a
Compare
a1ec8b4 to
d044c00
Compare
9ac178a to
0e9e82d
Compare
d044c00 to
f813a59
Compare
0e9e82d to
dcc3d9f
Compare
f813a59 to
faf8e7c
Compare
dcc3d9f to
bdec057
Compare
faf8e7c to
27a865f
Compare
bdec057 to
46aa361
Compare
27a865f to
1f97138
Compare
… traffic/v1 (FD-4683) This PR's change, rebased as one commit onto #448. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…refix of its own, and capture loopback too (FD-4683) - The gateway's traffic/v1 get copies a capture before sending any of it, copying again when tcpdump truncates the file to reuse it, and answers 503 when every copy was rewritten. - collect_traffic_capture writes each collection under its own attempt prefix, and the upload owns its temp file (finish_on_thread), so a cancelled collection never removes a file an upload still reads. - tcpdump captures every interface of the container, its loopback among them. - The read size and error limits are named. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
… the env closes (FD-4683) Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…collects a retry's rolled-back deployments too (FD-4683) Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…time runs out partway (FD-4683) Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
… stored linked to the run as partial (FD-4683) Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…thread, so teardown's time limit holds (FD-4683) Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…nd from just after each starts, not before (FD-4683) Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
ffa4b7b to
01650f0
Compare
|
🤖 Automated Claude routine — Env Pod PR Context Review. This is a bot, not Edgar Arakelyan; not a human review. Context from outside this diff: #492 ("fix(env): the gateway's control routes take the deploy's control token") is also open against Both add
On the natural keep-both merge the strip lands first, so by the time #492's gate looks the header is gone and Two smaller divergences in the same pair, if they're settled together:
Not a review of this diff — only that the two halves are in flight at once and the merge order decides the behaviour. Generated by Claude Code |
A website env can record every packet its websites' server and frontend containers send and receive, as PCAP, and serve the files through its card. This is opt-in.
Turning it on:
deploy_envtakescapture_traffic, andagent-env env deploytakes--capture-traffic. It works for a website env, or a multi env with a website, on a VM. Any other env, and container mode, refuse it.Capture: each website container gets a tcpdump service beside it.
network_mode: "service:<container>").NET_RAW/NET_ADMIN.Protocol: the new
agentenv_protocol.trafficdefinesurn:agentenv:traffic/v1with two ops:listreturns aTrafficCaptureListing, oldest file first;getstreams one file asapplication/vnd.tcpdump.pcap.Client helpers:
list_traffic_captures,fetch_traffic_capture,serves_traffic. The gateway'sconstants.pymirrors the names, with a test keeping them equal.Access: both ops require the per-deploy control token (
DeployedEnv.control_token). The gateway removesAuthorizationfrom a proxied request only when it carries that token (compared withhmac.compare_digest), so no site can read the token, and a site's own bearer auth still reaches it.Collection: the new
collect_traffic_capturestep stores each capture as a pcapFileArtifactin oneFileArtifactUniverse, recorded undercontext.metadata["traffic_captures"][env_id]. It's best effort unlessfail_task_on_erroris set. Teardown also collects any capturing env the run didn't collect, before the env closes, so a capture isn't lost with its VM.Before merging
Test
Rebased onto main after #444, #508, #510 and #514. Unit tests over packages/agentenv-protocol and tst/unit/{env,providers,task_step,task,cli}: 8,207 passed; the two failures, in test_disk_recipe.py, fail on main on the local machine too. Lint clean.
🤖 Generated with Claude Code


Confidence Score: 5/5
No new blocking finding was established; this does not clear the earlier unnumbered threads.Summary
Adds opt-in website packet capture, token-protected
traffic/v1downloads, and artifact collection before teardown.Diagram
%%{init: {'theme': 'neutral'}}%% flowchart LR Website[Website container] --> Capture[tcpdump sidecar] Capture --> Volume[Rotating capture files] Volume --> Gateway[Gateway reads files] Client[Collector with control token] --> Gateway Gateway --> Artifacts[File artifacts and universe] Artifacts --> Run[Saved run reference]Reviews (12) · Last reviewed commit: "docs(website): traffic capture records w..." · Reviewed by Greptile