fix: abort hung OG metadata fetches and archive metrics - #3471
Conversation
Public /og/skill, /og/plugin, and /og/profile now abort metadata fetches after 1.5s, matching trusted OG image fetches. Hosted archive download metrics are fire-and-forget with the same abort so a hung metric POST cannot block the first zip byte. Signed-off-by: Sebastien Tardif <sebtardif@ncf.ca>
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
@SebTardif is attempting to deploy a commit to the OpenClaw Foundation Team on Vercel. A member of the Team first needs to authorize it. |
|
Codex review: needs real behavior proof before merge. Reviewed August 15, 2026, 6:35 PM ET / 22:35 UTC. ClawSweeper reviewWhat this changesAdds 1.5-second bounds to Open Graph metadata lookups and records archive-download metrics asynchronously so a stalled metric request cannot delay ZIP bytes. Merge readiness⛔ Blocked until real behavior proof from a real setup is added - 4 items remain Keep open: the archive metric change is non-blocking, but the prior P2 finding remains—OG timeouts end after response headers, so a stalled JSON body can still hold the public card route. The PR also needs real server-boundary proof before merge. Priority: P2 Review scores
Verification
How this fits togetherPublic Open Graph routes obtain live skill, plugin, or publisher metadata before rendering social-card PNGs. The archive proxy streams ZIP bytes from signed storage manifests and separately records a best-effort download metric. flowchart LR
A[Browser OG request] --> B[OG route]
B --> C[Metadata service]
C --> D[Deadline handling]
D --> E[Social-card PNG]
F[Browser archive request] --> G[Archive proxy]
G --> H[ZIP byte stream]
G --> I[Best-effort metric]
Before merge
Findings
Agent review detailsSecurityNone. Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep one shared deadline around each complete metadata operation—including response-body parsing—and add a stalled-body regression test for both public HTTP metadata helpers. Do we have a high-confidence way to reproduce the issue? Yes, from source: make fetch resolve an OK response whose json() never settles, then advance past 1.5 seconds; the skill and plugin helpers remain pending because parsing is outside the timeout. Is this the best way to solve the issue? No. The proposed helper bounds only header acquisition; it should wrap the full fetch-and-parse operation, following the existing image-fetch pattern that keeps its deadline active during body consumption. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 4117154ecac4. LabelsLabel justifications:
EvidenceAcceptance criteria:
What I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
History |
TypeScript lib.dom types RequestInit.signal as AbortSignal | null. Assigning init?.signal into AbortSignal | undefined failed tsc. Signed-off-by: Sebastien Tardif <sebtardif@ncf.ca>
What Problem This Solves
Public OG routes (
/og/skill,/og/plugin,/og/profile) fetched registry/Convex metadata with no abort. A stalled backend parks the OG function until the platform kills it. Sibling image fetch already aborts at 1.5s.Archive downloads awaited an untimed metric POST before returning the first zip byte, so a hung Convex metric blocked the download. The comment already said metrics must not interrupt bytes.
Evidence
Red: hanging fetch never settled / zip first byte blocked at 500ms. Green: abort at 1.5s; zip first chunk is not delayed by a hanging metric POST.
Real behavior proof
Behavior addressed: OG metadata fetches abort at 1.5s; archive metric POST is fire-and-forget with the same abort and cannot delay first zip byte.
Real environment tested: macOS, Bun from the worktree, clawhub
/tmp/oc-impl-clawhub-oghead536df529.Exact steps or command run after this patch:
bunx vitest runon the four files above.Evidence after fix: 24 tests passed.
Observed result after fix: hung fetch returns null after 1.5s; zip stream starts without waiting for metrics.
What was not tested: A live production Convex outage.