Repository navigation
Conversation
3efa0d1 to
310ea31
Compare
|
Codex review: needs real behavior proof before merge. Reviewed August 10, 2026, 12:01 AM ET / 04:01 UTC. ClawSweeper reviewWhat this changesCentralizes optional image, video, and music generation eligibility during agent tool preparation so their factories do not repeat provider and authentication scans. Merge readiness⛔ Blocked until stronger real behavior proof is added - 4 items remain No code-level blocker found: the preparation plan is the right owner for registration eligibility, and the prior list-readiness finding is addressed. The PR still needs a redacted after-fix trace from a configured agent flow rather than only temporary metadata before merge. Priority: P2 Review scores
Verification
How this fits togetherAgent tool preparation assembles the tools offered to a model on each run. It combines runtime config, plugin capability metadata, and authentication state to decide which media tools reach the model tool list. flowchart LR
A[Agent run options] --> B[Tool preparation]
C[Runtime config and auth] --> D[Media eligibility plan]
E[Plugin capability metadata] --> D
D --> B
B --> F[Media tool definitions]
F --> G[Model tool list]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +122, Tests +36. Total +158 across 15 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep one preparation-time eligibility decision, then add a redacted configured-agent trace showing the registered media tools and warm preparation behavior on the exact merged head. Do we have a high-confidence way to reproduce the issue? Yes—current main source shows eligibility checked in both preparation and each generation factory; the exact runtime benchmark was not run because this review is read-only. Is this the best way to solve the issue? Yes—the preparation plan is the narrowest ownership boundary for registration eligibility, while the shared helper remains for the image list action outside tool preparation. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 592bf90b079c. 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
HistoryReview history (22 earlier review cycles; latest 8 shown)
|
310ea31 to
53be1cb
Compare
|
Addressed the review finding by adding the required Unreleased changelog entry for the agent tool-prep performance change. Additional local validation for the changelog-only follow-up:
|
53be1cb to
2e312e9
Compare
2e312e9 to
efedafe
Compare
efedafe to
80424bd
Compare
80424bd to
a4debb7
Compare
a4debb7 to
a763094
Compare
a763094 to
298cdc6
Compare
Follow-up knip fixPrevious tip removed
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
@clawsweeper re-review Rebased onto current Local proof on that head:
Please re-evaluate proof confidence / needs-proof gate on this head. |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
Fixed CI Cause: unexporting |
|
@clawsweeper re-review Exact head
Please re-evaluate for maintainer look (clear waiting-on-author / unranked proof gates if the P1 is resolved). |
|
🦞👀 Command router queued. I will update this comment with the next step. |
|
@clawsweeper re-review Head P1 (config-auth without prepared runtime)
plugin-sdk baseline
Please re-rate for maintainer look once CI is green. |
|
🦞👀 Command router queued. I will update this comment with the next step. |
Knip production deadcode failed on media-tool-shared.ts because hasGenerationToolAvailability was only referenced by unit tests after availability moved into resolveOptionalMediaToolFactoryPlan. Remove the leftover helper and keep the still-useful isConfigured regression.
Removing hasGenerationToolAvailability left three production-only exports unused. Unexport the internal snapshot loader, delete the dead current- snapshot helper and listAvailableManifestContractValues, and retarget the eligibility tests at listAvailableManifestContractPlugins.
… runtime Recognize models.providers.<id>.apiKey inside snapshot capability signals so gateway/skill tool prep still plans image/video/music generation without a prepared model runtime, while keeping manifest base-url guards.
Keep loadCapabilityManifestSnapshot / listAvailableManifestContractValues and hasGenerationToolAvailability so the Plugin SDK API contract matches main while factories still use the single media plan owner and config-auth snapshot fix.
Re-export loadCapabilityManifestSnapshot / listAvailableManifestContractValues and keep hasGenerationToolAvailability for non-plan callers so CI plugin-sdk:api:check matches main while factories still plan once.
|
@clawsweeper re-review Head P1 config-auth (waiting-on-author)
plugin-sdk baseline
Local proof
Please re-evaluate for status: ready for maintainer look when exact-head CI is green. |
|
🦞👀 Command router queued. I will update this comment with the next step. |
Wire hasGenerationToolAvailability into the media factory plan when no prepared providers are present so knip keeps the helper used and config-auth fallback stays shared with non-plan callers.
…ty for knip Unprepared media planning stays on snapshot signals (workspace + base-url + config auth). Re-export hasGenerationToolAvailability through the plan/tools barrel so production knip keeps the shared helper.
|
@clawsweeper re-review Head
Please re-rate for maintainer look when CI is green. |
|
🦞🧹 I asked ClawSweeper to review this item again. |
Keep hasGenerationToolAvailability as a production owner for list/status readiness while tool prep still plans factories once. Fixes knip unused export after removing factory re-scans.
|
@clawsweeper re-review Head Ready for maintainer look targets
Please clear waiting-on-author when CI is green. |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
Keep image_generate list generationAvailable consistent with factory plan registration when agents.defaults.mediaModels.image is set.
|
@clawsweeper re-review Head
Please re-evaluate for status: ready for maintainer look. |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Closing this PR for now. It has been open for a long time without maintainer merge traction, and the surface keeps moving under rebases. I’m withdrawing it to reduce review noise rather than keep pinging the queue. Thanks for the automated review feedback along the way. Happy to open a fresher, narrower PR later if this direction is still useful. |
What Problem This Solves
Warm agent tool preparation repeatedly re-scanned image/video/music generation availability inside each tool factory, even after
createOpenClawToolshad already planned which optional media tools to build.Why This Change Was Made
resolveOptionalMediaToolFactoryPlan.models.providers.<id>.apiKeyauth works without prepared runtime (after base-url guards).image_generatelist readiness uses the shared availability helper with the configured media model so list state matches registration.User Impact
No intentional product/API change for operators. Same tools should appear for the same inputs, with cheaper warm tool prep.
Evidence
Focused validation (exact head
39d44da575c871ffb50542e6f7a338eee562afd5)node scripts/run-vitest.mjs src/agents/openclaw-tools.media-factory-plan.test.ts src/agents/tools/image-generate-tool.test.ts— greenplugin-sdk:api:check/ knip green on CI for prior tip with same surface; baseline unchanged vs mainClawSweeper findings addressed
agents.defaults.mediaModels.imageintohasGenerationToolAvailabilityReal behavior proof
Behavior or issue addressed: Media generation tools are planned once; config-auth works without prepared runtime; list readiness matches explicit model registration.
Real environment tested: Local macOS OpenClaw checkout on exact head
39d44da575c871ffb50542e6f7a338eee562afd5, Node 25, real planner modules + temporary plugin metadata snapshot (no live provider network).Exact steps or command run after this patch:
node scripts/run-vitest.mjs src/agents/openclaw-tools.media-factory-plan.test.ts src/agents/tools/image-generate-tool.test.ts PROOF_HEAD_SHA=$(git rev-parse HEAD) node --import tsx /tmp/openclaw-78852-media-plan-proof.mjsEvidence after fix (redacted exact-head runtime JSON):
{ "head": "39d44da575c871ffb50542e6f7a338eee562afd5", "plan": { "imageGenerate": true, "videoGenerate": true, "musicGenerate": true }, "registeredMediaTools": ["image_generate", "music_generate", "video_generate"], "timingsMs": { "planAvgOverIters": 0.04, "createOpenClawToolsWarmAvg": 4.563 }, "invariants": { "imageGeneratePlannedAndRegistered": true, "videoGeneratePlannedAndRegistered": true, "musicGeneratePlannedAndRegistered": true } }Stdout ended with
PROOF_OK.Observed result after fix:
generationAvailableincludes configured media model so it cannot report false when registration is true for explicit models.createOpenClawToolsavg ~4.6 ms on this machine after plan.What was not tested:
Linked context
Performance/refactor of media tool prep; not issue-linked.