Repository navigation
Conversation
|
Thanks for the contribution. This PR still needs the requested real-behavior proof, and the branch has been idle since that ask. Close this stale, unmergeable branch: it has had no head update since July 18 and still lacks real after-fix OpenClaw request proof, despite the proof request having been visible for more than 14 days. Current main still has the underlying resize gap, so a rebased, proven replacement would remain welcome. Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. So I’m closing this for now to keep the review queue honest. Please reopen or open a fresh PR with real-behavior proof (a live run, logs, or a reproducible validation transcript) and it will be reviewed again. Review detailsBest possible solution: Keep #101923 as the canonical bug report and accept a fresh, rebased PR only when it proves an oversized image through an actual OpenClaw request path. Do we have a high-confidence way to reproduce the issue? Yes in source: current main sends normalized image bytes directly from both configured and explicit-model paths without invoking the existing optimizer; live provider confirmation was not performed in this review. Is this the best way to solve the issue? No for this stale branch: reuse of the canonical resolver is plausible, but the dirty branch needs a fresh rebase and real OpenClaw request proof before it is the best safe fix. Security review: Security review cleared: The described diff reuses in-repository policy and media helpers without adding dependencies, workflow changes, or new secret-handling paths. AGENTS.md: found and applied where relevant. What I checked:
Likely related people:
Codex review notes: model internal, reasoning high; reviewed against 95d7d95515b5. |
f28014e to
3a127ae
Compare
P1 fix: model-aware image compression policyAddressed the ClawSweeper P1 finding: the media-understanding compression policy now queries the bundled static catalog for provider/model Changes
Why this mattersThe previous config-only policy only set The image tool already resolves these limits via Validation
Repair branchhttps://github.com/LiuwqGit/openclaw/tree/repair/pr-101940 |
3a127ae to
11e295e
Compare
7a6289a to
f73d0a3
Compare
f73d0a3 to
68ecc63
Compare
…to all image paths Thread provider/model catalog mediaInput.image limits (maxSidePx, maxPixels, maxBytes) into media-understanding compression policy so oversized images respect the same hard caps the image tool already enforces. Covers all three entry points: - Channel-triggered media:// references (runProviderEntry) - Explicit model calls (prepareImageDescriptionInput / describeImageFileWithModel) - CLI infer image describe --model (runImageDescribe) Change details: - runner.entries.ts: export resolveImageCompressionPolicyFromConfig with optional provider/model opts; query bundled static catalog to merge mediaInput.image limits alongside agents.defaults config - runtime.ts: delete duplicate config-only copy; import shared helper; pass provider/model through prepareImageDescriptionInput - capability-cli.ts: pass activeModel.provider/model into prepareImageDescriptionInput so catalog limits are resolved before explicit-model fallback Previously the config-only policy produced only a preferredSidePx from agents.defaults.imageMaxDimensionPx. Without hard maxSidePx/maxPixels caps, optimizeImageBufferForWebMedia could preserve originals, bypassing provider-specific dimension caps (e.g., Anthropic 2576px maxSidePx). Ref: openclaw#101940 Fixes: openclaw#101923
…ssion policy Replace resolveBundledStaticCatalogModel-only lookup with resolveModelAsync so the media-understanding image compression policy merges the same three sources the image tool already enforces: 1. Configured model metadata (openclaw.json providers.*.models[].mediaInput.image) via resolveModelAsync with skipProviderRuntimeHooks. 2. Bundled static catalog limits as safety-net fallback. 3. Runtime-discovered limits (plugin hooks) when no hard dimension caps exist. Previously the helper only queried the bundled static catalog, so custom configured model limits and runtime-discovered metadata could be bypassed. Refs: openclaw#101940
…mpression policy Add config-based lookup (cfg.models.providers.*.models[].mediaInput.image) to resolveImageCompressionPolicyFromConfig so custom/user-configured vision models that are not in the bundled static catalog still get their hard dimension caps applied before provider execution. Configured limits take priority over catalog limits (matching the image tool's mergeImageCompressionPolicies contract). Also fix pre-existing test failures from upstream secret-sentinel changes that broke media-services mocks in runner.vision-skip.test.ts and apply.test.ts. Refs: openclaw#101940
- resolveImageCompressionPolicyFromConfig: drop dead agentDir opt, fix the
alias-matching comment to reflect id-only lookup, and guard the model entry
against pushing an empty ImageCompressionModelPolicy when neither configured
nor catalog limits are present (spreading two undefined objects yields {}
which is truthy and was leaking an empty {} into policy.models).
- prepareImageDescriptionInput: propagate workspaceDir so the explicit
model-call path resolves catalog/config policy the same way as the channel
media:// path.
- Drop the unused imageCompression param from normalizeImageDescriptionInput
and its two call sites.
- Add focused unit tests covering policy merge precedence and guards.
- Add PNG_1X1 constant to vi.hoisted() for mock factories - Mock readImageProbeFromHeader/readImageMetadataFromHeader to detect PNG - Fix HEIC test: fileName sample.bin -> sample.jpg (toJpegFileName rename) - Add test: prefers local image bytes over conflicting explicit MIME - Add test: prefers fetched image MIME over conflicting explicit metadata - Fix oxfmt formatting in runner.entries.ts and runner.entries.policy.test.ts
be5b38e to
4b3b2bf
Compare
…before-optimize order, add fileName to normalizer - Export resolveCompressionModelPolicy from image-tool.ts so media-understanding can delegate - Rewrite resolveImageCompressionPolicyFromConfig to async wrapper delegating to shared resolver - Fix HEIC/HEIF normalize-before-optimize order in both runtime.ts and runner.entries.ts - Add fileName to normalizeImageDescriptionInput return type so HEIC->JPG renames propagate - Use normalizedMedia.fileName in runner.entries.ts optimizer call - Add runner.entries.js and image-input-normalize.js mocks to runtime.test.ts - Update HEIC test to verify normalization runs before optimization - Rewrite policy tests to mock image-tool.js resolveCompressionModelPolicy
|
ClawSweeper applied the proposed close for this PR.
|
Summary
Fixes #101923
Root Cause
Real behavior proof
Regression Test Plan
Risk checklist