Repository navigation
feat(limrun): capture session traffic into a live HAR and report tunnel failures - #4043
Conversation
Evidence for an upstream Limrun report (
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
All reported issues were addressed across 35 files
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
…-network-logs The opt-in opens the instance's one destination tunnel with Limrun's own inspection and rewrites a HAR 1.2 file under the daemon state dir on every completed request, so the artifact stays valid while the session runs and after it. The Metro/companion localhost route rides the same tunnel. The HAR path is reported at allocate, listed by artifacts, and printed at disconnect.
… close The SDK logs per-connection dial failures only to the console, so a hung page under --provider-network-logs left no trace an agent could read. The capture now records the typed inspection failures (failed requests with host and port, inspection errors, stream gaps) per kind, reads the tunnel's last typed dial failure, and reports them in the HAR artifact metadata and as the artifacts/close summary. A tunnel conflict is now classified by the SDK's typed session error code instead of its message text. Docs state that captured traffic exits through the agent-device host, that the HAR is sensitive, that hosts without HTTP/2 fail under capture, and that agents should pass --provider-network-hosts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…he capture Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…HAR file A capture that failed to start was dropped with the allocate result, so artifacts reported no provider support at all. Each lease now keeps one capture state (capturing, stopped, unavailable): artifacts and close report an unavailable capture with its typed reason, and a release retry reports the stopped capture again. Completed requests share one coalesced HAR rewrite, a write failure is recorded as har-write-failed, the file is owner-only, and it is named per lease so attached instances do not overwrite each other. The tmpdir fallback is gone; without a capture directory the opt-in refuses with capture-dir-unset. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
f1ca675 to
7de97ba
Compare
Size Report
Startup median (7 runs, lower is better):
|
|
Thanks for this. I reviewed f1ca675 and found one problem that must be fixed before merge: the HAR capture has no bound. The 8 checks reported at f1ca675 are green. network-har.ts:301 keeps every completed entry for the whole session (L145, L169). Bodies are captured, and the SDK assembler allows 10 MiB per body by default. Each 250 ms window then runs Could a smaller design work here? Keep capture in provider-limrun, but hold a bounded in-memory ring of assembled entries (small Not blocking, and fine to take or leave: nothing deletes the The live Limrun run is reported in the PR body only. I could not reproduce it, so I have not seen The newer head 7de97ba rebases onto main and drops the Of the open inline threads from other reviewers, these still stand: the close-before-flush ordering, the dial-only failure summary, the repeat allocation early return, and the state-dir owner (narrower than described: the default CLI route works, and the owner is |
- Bound memory and per-write cost: bodies are cut to 64 KiB by the tunnel and the assembler, each entry is serialized once into a ring capped at 8 MiB, the oldest entries are dropped with a typed har-truncated failure, and writes are async with one in flight through exclusive temp files. - close() is async: it writes the HAR even when the tunnel refuses to close, and a later call retries the tunnel. - A repeat allocation starts the capture it newly asks for; a dial-only failure reaches the summary; a stopped capture's HAR is deleted when its record is evicted. - The capture directory comes from the daemon's resolved state dir, and doctor counts an enabled opt-in boolean as provider scope. - Docs: opt-in artifacts wording, allocation timing, retention, size bounds, the data wrapper, the daemon host in flag help, help remote, and the skill as a one-line pointer. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thanks. 31cf8cd bounds the capture. The live file is an explicit requirement for this change: an agent reads the HAR with
All inline threads are fixed or answered. The status read can't be aborted because the SDK exposes no signal; that is on the upstream list. Live Limrun iOS at 31cf8cd (rebuilt). The cases you couldn't reproduce: After each run, no Limrun instances were left running and the trial daemons were stopped. Validation: |
There was a problem hiding this comment.
All reported issues were addressed across 12 files (changes from recent commits).
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
…e file in UTF-8 bytes The first publication of the HAR now has to succeed before the tunnel opens, so an unwritable capture path is an unavailable capture instead of a ready artifact pointing at a missing file. The size cap counts UTF-8 bytes plus the document wrapper and commas, and an entry that cannot fit alone is dropped. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
At 31cf8cd I found no new code problems, but two open review threads still need a fix or an answer before merge: the first HAR write failure still opens the tunnel and the size cap counts UTF-16 units. Both hold. In the first, a failed first write still reports a The third thread, on the help example, does not apply: the example matches Smoke Tests is still running. The diff touches no local platform dispatch, and its shared-route changes only add lines when the provider returns cloud artifacts, so a failure there is unlikely to relate to this PR. There are no conflicts. I could not reproduce the live Limrun run, so the mid-session read, the close summary, the 0600 mode and the artifact states are as the author reported them for 31cf8cd. I did not measure a long or media-heavy session against the new bounds. Not blocking, and you can take or leave these: |
…e dir, and pin HAR retention Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thanks. Both blocking threads were fixed at 44b0e2d:
The help-example thread is answered and resolved. e812372 takes the four take-or-leave notes:
Live: Limrun iOS at e812372 (rebuilt). The Validation at e812372: |
There was a problem hiding this comment.
All reported issues were addressed across 4 files (changes from recent commits).
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The code looks good at a597bf4: the issues from the earlier review (#4043 (comment)) are fixed at this commit, and nothing new blocks it. The 20 checks are green, and there are no conflicts. Not blocking, take or leave: in All three earlier cubic-dev-ai threads, already resolved, are fixed at this commit: the I did not reproduce the live Limrun iOS run, so the mid-session HAR, the close summary, the 0600 mode and the unavailable state are as the author reported them. I did not run the provider-limrun tests locally, and I did not measure a long or media-heavy session against the 8 MiB cap. |
|
This merged with the live-file design. #4080 replaces it with the simplest version that meets the goal: completed requests stay in memory (500 requests, 64 KiB bodies), and |
Summary
connect limrun --provider-network-logswrites a live HAR 1.2 file of device traffic through Limrun's tunnel inspection.--provider-network-hostsnarrows the capture to named hosts. The SDK logged tunnel failures only to the console. The capture now records typed failure kinds (request-failedwith host:port,inspection-error,inspection-gap,inspection-stream-error,har-write-failed,har-truncated) plus the tunnel's typedlastDialFailure.reason.artifactsandcloseprint a summary, andartifacts --jsoncarries the report. A capture that can't start is anunavailableartifact with its reason.The capture is bounded: bodies are cut to 64 KiB, the file to 8 MiB, and writes are async with one in flight. The HAR is owner-only, named per lease, and deleted when its record is evicted. The docs cover the egress, sensitivity, pinning, DoH and HTTP/2-only limits. 36 files, 10 commits. Follow-up: #4064. Upstream evidence is in a comment.
agent-device connect limrun --platform ios --provider-network-logs --provider-network-hosts "api.example.com,localhost:8081" agent-device artifactsValidation
check:affected --runat a597bf4 failed only onios-record-tracetimeouts (they also fail on base; host load average about 70). 14 static gates pass viapnpm gate. CI was all green at e812372.--provider-network-hosts httpbin.org,agent-device-missing-q7z.com.jqread mid-session:closeprinted the same summary, and HAR mode is-rw-------. An invalid host showedunavailable. No instances were left.🤖 Generated with Claude Code