Repository navigation
fix(tlon): stop image downloads that overrun or outlive inbound work - #203928
Conversation
Give Tlon media fetches a total deadline so a slowly trickling body cannot hold a conversation lane past the header and idle timeouts, and pass the ingress lifecycle abort signal so abandoned claims cancel in-flight downloads instead of leaving them running. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Codex review: needs maintainer review before merge. What this changesAdds a three-minute Tlon media download deadline and passes ingress cancellation to inbound image downloads. Example: An image response sends one chunk every second.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review This PR fixes two current-main media lifetime gaps with a focused change. No blocking defect remains, the prior upgrade-proof request is addressed, and exact-head checks report no failures. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe Tlon monitor converts message images into stored attachments through the guarded media runtime; outbound uploads share its Tlon timeout policy. flowchart TD
A[Tlon ingress lifecycle] --> B[Message monitor]
B --> C[Inbound media adapter]
D[Shared timeout policy] --> C
D --> E[Outbound upload adapter]
C --> F[Guarded media transport]
E --> F
F --> G[Attachment store or Tlon upload]
Technical reviewBest possible solution: Retain the existing shared timeout policy and media adapters with the total deadline and ingress signal propagation. Do we have a high-confidence way to reproduce the issue? Current-main source shows that a continuously trickling response avoids both existing timeouts and receives no ingress cancellation signal; no target code was executed during this review. Is this the best way to solve the issue? The patch uses existing transport capabilities, preserves attachment ordering and unavailable-media accounting, and is the smallest complete repair using the owners already present. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against a27b4e6f6bad. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +4, Tests +23. Total +27 across 5 files. Added test files: 0. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReviewed November 23, 2026, 12:59 AM ET / 05:59 UTC (Revision 3). |
ClawSweeper reviewReviewed November 23, 2026, 5:59 AM UTC. What this changesThis PR adds a three-minute Tlon media download deadline and forwards ingress cancellation to inbound image downloads. PR surface: Source +4, Tests +23. Total +27 across 5 files. Merge readinessResult: ready for maintainer review. Overall: 🐚 platinum hermit Reviewed head: Review scores
VerificationStatus: sufficient How this fits togetherThe Tlon monitor downloads inbound images through the guarded media runtime; outbound image uploads consume the same plugin-owned timeout policy. flowchart TD
A[Tlon ingress lifecycle] --> B[Message monitor]
B --> C[Inbound media adapter]
D[Tlon timeout policy] --> C
D --> E[Outbound upload adapter]
C --> F[Guarded media transport]
E --> F
F --> G[Attachment storage or Tlon upload]
Before merge
Review detailsBest possible solution: Keep the shared Tlon timeout policy and existing media adapters, adding the total deadline and ingress signal propagation as proposed. Do we have a high-confidence way to reproduce the issue? Current-main source shows that continuously trickling bodies evade the header and idle deadlines and that inbound downloads lack ingress cancellation; this review executed no target code. Is this the best way to solve the issue? The patch uses existing transport capabilities at the plugin-owned policy and adapter boundaries while preserving attachment ordering, size limits, unavailable-media accounting, and outbound fallback rules. AGENTS.md: found_applied Codex review notes: model internal, reasoning medium; reviewed against a27b4e6. Label detailsLabel justifications:
Evidence reviewedPR surface:
|
|
Behavior proof for Real environment: Linux, Node v24.20.0, isolated production media store, real HTTP sockets and clocks. The entry points were Tlon
Command, with Focused regression command: Fixture limits: an SDK alias grants only the fixture's loopback origin; fetch, body reading, timers, signals, storage and Tlon upload are real implementations. Eyre/S3 responses and credentials are synthetic. No live Urbit ship, model/Gateway round trip, or managed-service updater route is claimed. No configuration/state schema or migration changes are introduced. Latest-stable-to-head source upgrade also passed at this head: published |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
* fix(tlon): gate group DMs by club approval * fix(tlon): persist configured club grants * docs(config): record Tlon club policy surface * test(tlon): keep sender role cases under lint limit * fix(tlon): preserve direct settings events * fix(tlon): narrow settings event records without assertions (cherry picked from commit 6eb70d4) Release adaptation: regenerate stable config docs counts/hashes and bundled channel metadata; no source conflicts. Channel count +6, core/plugin unchanged. The assertion ratchet generator confirms the same Tlon-only shrink; unrelated pre-existing UI ratchet entries are excluded. Companion disposition: #204126 is a missing optional user-facing warning about later club invitees; existing prompts already disclose unverified participant input and future messages. #203928 is not applicable to approval/routing, only image download lifetime. #204219, #203470, #203901 and #203063 overlap only generated/ratchet files, not applicable; regenerate from stable inputs. No later PR or commit-SHA mentions. Co-authored-by: RomneyDa <[email protected]>
…penclaw#203928) * fix(tlon): bound and cancel inbound image downloads Give Tlon media fetches a total deadline so a slowly trickling body cannot hold a conversation lane past the header and idle timeouts, and pass the ingress lifecycle abort signal so abandoned claims cancel in-flight downloads instead of leaving them running. Co-Authored-By: Claude Opus 5.5 <[email protected]> * test(tlon): reject aborted media fetch with an Error --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
…203928) * fix(tlon): bound and cancel inbound image downloads Give Tlon media fetches a total deadline so a slowly trickling body cannot hold a conversation lane past the header and idle timeouts, and pass the ingress lifecycle abort signal so abandoned claims cancel in-flight downloads instead of leaving them running. Co-Authored-By: Claude Opus 5.5 <[email protected]> * test(tlon): reject aborted media fetch with an Error --------- Co-authored-by: Claude Opus 5.5 <[email protected]> (cherry picked from commit 606fb65) Companion audit: Pinned main scan found no later path/PR/SHA follow-ups. No required follow-up identified. Co-authored-by: RomneyDa <[email protected]>
What Problem This Solves
A Tlon image server that keeps sending small amounts of data can keep a download running indefinitely. Abandoned inbound work also leaves its image fetch running.
User Impact
Tlon media fetches now have a three-minute total deadline, and inbound image downloads are cancelled when ingress work is abandoned. Failed images continue to be reported as unavailable. The shared deadline also applies to outbound media downloads; transfers taking over three minutes will fail even if they are still making progress. No configuration or migration is required.
Why This Change Was Made
Reuse the existing shared Tlon media timeout policy and pass the ingress lifecycle signal into the existing media adapter. This keeps one timeout owner and removes redundant handling around empty message content. Existing URL and SSRF policy remains in effect; no new media-host restriction is introduced.
Evidence
At
0b5362988593855083f35cd01fd9c762535915e9, the focused monitor and media suites passed: 35 tests. The cancellation regression timed out on the base and passes with the fix; deadline assertions also failed on the base. Positive controls preserve image storage, byte caps, attachment ordering, and outbound downloads. Aborting a pending download returns unavailable-media results without saving attachments.Command:
pnpm test extensions/tlon/src/monitor/index.test.ts extensions/tlon/src/monitor/media.test.ts extensions/tlon/src/urbit/upload.test.ts.Formatting, focused oxlint, scoped Tlon TypeScript checking, the line-cap check, and
git diff --checkpassed.Real transport proof
A standalone production-adapter smoke at the same head exited 0 on Linux / Node v24.20.0, using an isolated media store, real HTTP sockets, and real clocks:
Command (with
PROOF_DIRset to the isolated fixture directory):OPENCLAW_STATE_DIR="$PROOF_DIR/runtime" pnpm exec tsx --tsconfig "$PROOF_DIR/tsconfig.json" "$PROOF_DIR/transport-proof.mts".The fixture SDK alias adds
ssrfPolicy.allowedOriginsfor its single loopback HTTP origin so local transport can be exercised. It does not replace fetch, response-body reading, timers, signals, storage, Tlon upload, authentication, or scry implementations. The exact production 180,000 ms deadline is used. Synthetic authentication and S3 configuration are fixed external I/O fixtures, not a live Urbit ship. This proves media transport lifetime and adapter behavior; the additional latest-stable-to-head source upgrade proof is below. It does not claim a model/Gateway message round trip. No configuration/state format or migration changes are made by this patch.The related CI typed-lint failure in the cancellation test was reproduced locally and fixed by rejecting with an
Error; production code was unchanged by that follow-up. Final-head focused validation passed all 35 tests in 38.71 seconds, plusnode scripts/run-oxlint.mjs --openclaw-focused-config --type-aware --tsconfig tsconfig.extensions.json extensions/tlon/src/monitor/media.test.ts, touched-file formatting, andgit diff --check.Latest-stable-to-head source upgrade proof
npm view openclaw dist-tags --jsonreportedlatest: 2026.11.7. That published package was installed into an isolated prefix. Its CLI wrote synthetic Tlon ship, URL, code, owner, and network settings usingopenclaw config set channels.tlon <fixture-settings> --strict-json, then passedopenclaw config validate --json.The candidate source CLI at
0b5362988593855083f35cd01fd9c762535915e9loaded the same state directory and passedpnpm openclaw config validate --json. The configuration remained byte-for-byte identical: before and after SHA-256 were bothb3296a7725d520af1431f13b5a981b33c57100ad4b13c483435314ddc5bfe07b.The candidate media adapters then used the preserved ship URL, ship name, login code, and network setting against the real HTTP fixture:
Command, with
PROOF_DIRidentifying the isolated fixture scripts and privateUPGRADE_STATE/PROOF_TMPdirectories:TMPDIR="$PROOF_TMP" OPENCLAW_STATE_DIR="$UPGRADE_STATE" pnpm exec tsx --tsconfig "$PROOF_DIR/tsconfig.json" "$PROOF_DIR/upgrade-proof.mts"— exit 0. The source CLI used its supported private-state temp fallback because the host's shared default temp-root ancestry failed permission checks; no shared permissions or guards were changed.This is a published-stable-configuration to candidate-source-runtime upgrade with real media transport. It does not claim a managed-service updater route, a released candidate package, a live Urbit ship, or a model/Gateway round trip. The patch changes no config/state schema or migration.