Repository navigation
improve(media): reduce metadata fetched during orphan cleanup - #148244
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review blockedAutomated review did not run, so no review verdict was produced. Reason: The input-safety check could not safely complete for this revision. ClawSweeper will not retry this unchanged revision. Next step: No contributor action is requested. Maintainers should inspect the linked workflow run. |
|
Codex review: blocked before merge. Reviewed September 14, 2026, 8:38 AM ET / 12:38 UTC. ClawSweeper reviewWhat this changesThe PR reduces metadata returned during managed-image orphan cleanup while preserving file retention and SQLite decoding safeguards. Merge readiness⛔ Blocked before merge - 2 items remain This remains a useful, focused optimization absent from the inspected main branch. No introduced correctness or security defect was found, and the maintainer-authored PR is protected from cleanup closure. Priority: P2 Review scores
Verification
How this fits togetherGateway maintenance uses stored attachment records to decide which outgoing media files remain referenced. Orphan cleanup reads those references and removes only sufficiently old, unreferenced files after checking for legacy metadata. flowchart TD
A[Gateway maintenance] --> B[Managed attachment cleanup]
B --> C[Legacy metadata check]
C -->|Clear| D[Fresh SQLite reference projection]
C -->|Present or unreadable| E[Keep orphan files]
D --> F[Reference and file age checks]
F --> G[Remove aged unreferenced files]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +16, Tests +133. Total +149 across 3 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep the narrower query in the existing record-store owner, preserving fresh reads, global references, integer decoding failures, and unchanged retention semantics. Do we have a high-confidence way to reproduce the issue? Not applicable as a functional bug reproduction: this is a metadata-read optimization, supported by source inspection and reported paired cleanup measurements. Is this the best way to solve the issue? Yes. A narrower projection at the existing fresh-read boundary removes unnecessary metadata without adding another owner, cache, schema, or configuration path. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 51c9122e1e9c. LabelsLabel changes:
Label justifications:
EvidenceWhat 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
|
ef7d64a to
341d476
Compare
|
Merged via squash.
|
* commit '3c08384584f57787a26da9998488233fc15ccf7e': (122 commits) fix(agents): keep tool result summaries when middleware details exceed shape limits (#147805) test: make full-suite fixtures portable across runtimes (#148247) refactor(qa): share unknown confidence results (#148200) chore(android): remove unused test dependencies and duplicate Wear settings (#148231) test: reuse compiled preflight in startup fixtures (#148330) test(wizard): route recovery integration through database forks (#148337) refactor(plugins): simplify provider auth patch recursion (#147933) fix(cli): drain failed web capability output (#148234) refactor(android): remove unused production helpers (#148233) fix(plugins): scope feed integrity to hosted ClawHub (#148220) test(qa): compare Telegram entities semantically (#148219) test(qa): recognize native Slack exec progress rows (#148217) test(cron): distinguish repeated delivery incidents (#148151) test(qa): preserve restart command ownership (#148218) test(qa): isolate bundled skill CLI gateway state (#148150) test(qa): align process lifecycle contracts (#148149) improve(media): reduce metadata fetched during orphan cleanup (#148244) fix(matrix): retain sync state runtime for deferred persistence (#148152) test: deduplicate gateway watch exit fixtures (#148237) refactor(cli): derive daemon status contract from gatherer (#148108) ...
…aw#148244) Co-authored-by: Peter Steinberger <[email protected]>
What Problem This Solves
Managed-image orphan cleanup rereads full metadata when it only needs to identify referenced files.
User Impact
Cleanup fetches less metadata while preserving retained files, durable claims, errors, and retention rules.
Why This Change Was Made
The existing record store provides a narrow projection after the awaited legacy-metadata check. It includes every agent's claimed and unclaimed records and retains all four integer columns so unsafe values still stop deletion.
Evidence
Query and row counts are unchanged. These Node 24 measurements predate the refresh and use identical candidate bytes; no latency, CPU, allocation, or disk-I/O gain is claimed.
The required CI gate passed on attempt 2 for the unchanged published commit. Its sole failed worker had stopped during Windows checkout before tests; one fresh-job retry succeeded. Native maintainer gates still apply.