fix(tools): honor config auth for media model selection#85356
Conversation
|
Codex review: found issues before merge. Latest ClawSweeper review: 2026-05-22 15:35 UTC / May 22, 2026, 11:35 AM ET. Workflow note: Future ClawSweeper reviews update this same comment in place. How this review workflow works
Summary Reproducibility: yes. Current main source shows config-backed provider API keys are missed by env/profile-only tool auth checks, and the PR’s remaining aws-sdk/API-key mismatch is visible by comparing the new helper with runtime auth precedence. PR rating Rank-up moves:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. Real behavior proof Risk before merge
Maintainer options:
Next step before merge Security Review findings
Review detailsBest possible solution: Land after the tool preflight and runtime auth resolver agree on aws-sdk versus API-key precedence, with focused coverage for config API keys, profiles, implicit Bedrock/aws-sdk, and explicit Do we have a high-confidence way to reproduce the issue? Yes. Current main source shows config-backed provider API keys are missed by env/profile-only tool auth checks, and the PR’s remaining aws-sdk/API-key mismatch is visible by comparing the new helper with runtime auth precedence. Is this the best way to solve the issue? No, not yet. The shared helper is the right shape, but it must mirror the execution auth contract or deliberately change that contract with tests and docs. Label justifications:
Full review comments:
Overall correctness: patch is incorrect Acceptance criteria:
What I checked:
Likely related people:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 99d7c7077e23. |
|
ClawSweeper PR egg 🔥 Warming up: real-behavior proof passed; findings, security review, or rank-up moves are still in progress. Hatch commandComment Hatchability rules:
What is this egg doing here?
|
|
/clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Closing in favor of a smaller follow-up PR. Why close #85356 The original fix direction was correct (config-aware auth preflight for media tools), but the landed scope grew into a broader media-tool auth refactor:
Replacement approach (Plan B)
A narrower replacement PR will be opened from |
|
Superseded by narrower Plan B PR (config apiKey preflight only; no aws-sdk/Bedrock expansion). |
|
Replacement PR: #85570 |
Summary
models.providers.*.apiKeycan be auto-selected.workspaceDirthrough generation tool model/list availability paths so discovery and execution use the same auth context.aws-sdkauth out of API-key-only tool preflight and preserve video reference-audio capability semantics.Verification
node scripts/run-vitest.mjs src/agents/tools/model-config.helpers.test.ts src/agents/tools/media-tool-shared.test.ts src/agents/tools/image-generate-tool.test.ts src/agents/tools/music-generate-tool.test.ts src/agents/tools/image-tool.test.ts src/agents/tools/pdf-tool.model-config.test.ts(262 passed)ReadLintson changed tool filesPASSReal behavior proof
Behavior addressed: Custom provider image/media tool auto-selection now recognizes config-backed API keys while avoiding aws-sdk-only providers that cannot satisfy current tool API-key execution.
Real environment tested: Local Mason worktree on Linux with focused Vitest coverage and review checks.
Exact steps or command run after this patch:
node scripts/run-vitest.mjs src/agents/tools/model-config.helpers.test.ts src/agents/tools/media-tool-shared.test.ts src/agents/tools/image-generate-tool.test.ts src/agents/tools/music-generate-tool.test.ts src/agents/tools/image-tool.test.ts src/agents/tools/pdf-tool.model-config.test.tsEvidence after fix: Focused suite reported
12 passed (12)test files and262 passed (262)tests.Observed result after fix: Config-backed custom provider auth is accepted for image/PDF/media model selection, aws-sdk-only tool preflight is rejected, and generation list/model availability receives workspace auth context.
What was not tested: Full repository check, live provider calls, and existing video reference-audio test failures unrelated to this diff.