Skip to content

fix(media): honor video auth modes and redact reflected credentials - #138205

Merged
steipete merged 1 commit into
mainfrom
codex/fix-video-optional-auth
Sep 4, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/fix-video-optional-auth

Conversation

@steipete

@steipete steipete commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes an issue where video requests to OpenAI-compatible endpoints reject explicitly configured no-auth requests or ignore a typed API key. Video error responses could also retain credentials reflected by the endpoint in diagnostic fields or malformed JSON parser errors.

Why This Change Was Made

Audio and video now share the existing header-selection rules: typed authentication takes precedence, legacy keys still work, and explicit no-auth requests omit Authorization. Video passes the actual request headers to the same diagnostic redactor audio already uses. The two public multipart helper names now point to one implementation.

User Impact

Compatible video endpoints accept the same authentication modes as audio, and returned errors redact reflected request credentials. Public SDK export names, request payloads, MIME handling, timeouts, and guarded HTTP behavior remain available. No new configuration, dependency, schema, or persistence behavior is introduced.

Evidence

  • Before the repair, three video authentication regressions and two credential-reflection regressions failed. All 120 tests across eight affected and sibling files now pass.
  • Native public-SDK HTTP proof made 20 real loopback requests: 14 authentication/header cases, four redacted-error cases, and two multipart uploads through both public export names. These use synthetic credentials and local endpoints; no external AI provider was exercised.
  • Full changed-file checks passed, including source/test types, lint, formatting, dead exports, SDK and architecture boundaries. Independent Codex review found no actionable P0–P2 findings.
  • Production: +20/-28, net −8. Tests: +193/-132, net +61, with shared table coverage replacing duplicate audio assertions.

Release-note context: OpenAI-compatible video requests now honor typed/no-auth authentication and redact endpoint-reflected request credentials.

@clawsweeper

clawsweeper Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@openclaw-barnacle openclaw-barnacle Bot added size: M maintainer Maintainer-authored PR labels Sep 4, 2026
@clawsweeper clawsweeper Bot added P1 High-priority user-facing bug, regression, or broken workflow. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 4, 2026
@clawsweeper

clawsweeper Bot commented Sep 4, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 4, 2026, 8:51 AM ET / 12:51 UTC.

ClawSweeper review

What this changes

The PR makes OpenAI-compatible video requests honor typed, legacy, and no-auth modes, redacts request credentials reflected in video errors, and consolidates equivalent multipart POST helpers.

Regression provenance

Possible regression — suspected (reviewed change). No predecessor PR is attributed.

Merge readiness

✅ Ready for maintainer review

Keep open. This focused repair addresses a current-main video-auth and diagnostic-redaction defect; no blocking correctness or security finding was identified in the introduced patch.

Priority: P1
Reviewed head: 4d6b8c05c27090c7d18240ee46e288236a5e8644

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, net-negative implementation with credible owner-boundary regression coverage and no actionable review finding.
Proof confidence 🌊 off-meta tidepool Not applicable: This is a member-authored PR, so the external-contributor proof gate does not apply; the captured body additionally reports synthetic-credential loopback coverage, while source inspection confirms the exercised adapter and redaction boundary.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This is a member-authored PR, so the external-contributor proof gate does not apply; the captured body additionally reports synthetic-credential loopback coverage, while source inspection confirms the exercised adapter and redaction boundary.
Evidence reviewed 7 items Current-main defect: The current main tree has the same blobs for the three affected production files as the PR base. That base's video adapter always builds Authorization: Bearer ${params.apiKey}, so a runner-provided explicit no-auth marker is sent as bearer authentication and typed auth is ignored.
Caller reaches the defective path: The media runner explicitly passes auth.kind: "none" together with the legacy local marker to video providers, then calls the provider's video description function; the existing runner test confirms that request shape.
Shared fix at the owner boundary: The introduced helper applies the established typed-key, legacy-key, and explicit-no-auth selection once; both audio and video pass it into the common request-configuration boundary, where caller headers still take precedence.
Findings None None.
Security None None.

How this fits together

Media understanding routes configured video attachments through provider plugins to OpenAI-compatible HTTP endpoints. The adapter merges provider and caller request settings, sends the guarded request, then returns media text or a redacted diagnostic.

flowchart LR
  A[Video attachment] --> B[Media provider]
  C[Resolved auth and headers] --> D[Video request adapter]
  B --> D
  D --> E[Guarded HTTP request]
  E --> F[Response and error redaction]
  F --> G[Video description or safe error]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source -8, Tests +61. Total +53 across 6 files.

View PR surface stats
Area Files Added Removed Net
Source 3 20 28 -8
Tests 3 193 132 +61
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 6 213 160 +53

Review metrics

Metric Value Why it matters
Production versus regression coverage production +20/-28 (net -8); tests +193/-132 (net +61) The patch removes duplicated transport code while adding shared audio/video contract coverage; production growth is net-negative.

Technical review

Best possible solution:

Merge the shared header-selection and final-header redaction path so OpenAI-compatible video behavior remains aligned with the established audio contract without adding a parallel transport path.

Do we have a high-confidence way to reproduce the issue?

Yes. Current main's video adapter unconditionally derives bearer authentication from the legacy key while the runner demonstrably supplies an explicit no-auth video request; a request-capturing endpoint exposes the mismatch.

Is this the best way to solve the issue?

Yes. Centralizing the already-established audio auth selection in the shared media boundary prevents audio/video drift; copying the audio branch into video would preserve duplicate policy.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 7623603c23db.

Labels

Label justifications:

  • P1: Current main can reject explicitly no-auth OpenAI-compatible video requests and can retain endpoint-reflected credentials in video diagnostics.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This is a member-authored PR, so the external-contributor proof gate does not apply; the captured body additionally reports synthetic-credential loopback coverage, while source inspection confirms the exercised adapter and redaction boundary.

Evidence

What I checked:

  • Current-main defect: The current main tree has the same blobs for the three affected production files as the PR base. That base's video adapter always builds Authorization: Bearer ${params.apiKey}, so a runner-provided explicit no-auth marker is sent as bearer authentication and typed auth is ignored. (src/media-understanding/openai-compatible-video.ts:39, 95815d895c15)
  • Caller reaches the defective path: The media runner explicitly passes auth.kind: "none" together with the legacy local marker to video providers, then calls the provider's video description function; the existing runner test confirms that request shape. (src/media-understanding/runner.entries.ts:982, 4d6b8c05c270)
  • Shared fix at the owner boundary: The introduced helper applies the established typed-key, legacy-key, and explicit-no-auth selection once; both audio and video pass it into the common request-configuration boundary, where caller headers still take precedence. (src/media-understanding/shared.ts:49, 4d6b8c05c270)
  • Redaction reaches the final request headers: The video adapter now provides its resolved final headers to both HTTP-error normalization and malformed-JSON handling. The shared error owner redacts reflected request IDs and bodies before extracting error metadata. (src/media-understanding/openai-compatible-video.ts:67, 4d6b8c05c270)
  • Regression coverage: The new table-driven test exercises audio and video through the same public adapters for no-auth, typed, legacy, caller-header, and request-level auth precedence, then checks reflected credentials cannot survive HTTP or malformed-JSON diagnostics. (src/media-understanding/openai-compatible-auth.test.ts:39, 4d6b8c05c270)
  • Public multipart compatibility: The existing public provider-HTTP subpath continues to export both multipart and transcription names; the PR aliases the old transcription name to the canonical multipart implementation and tests the matching guarded-request behavior for both names. (src/media-understanding/shared.ts:739, 4d6b8c05c270)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • zengLingbiao: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
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.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (1 earlier review cycle)
  • reviewed 2026-09-04T11:07:31.785Z sha a67de0de5cd5d4307b3d7b09bce9beee650098a9 :: needs maintainer review before merge. :: none

@steipete
steipete force-pushed the codex/fix-video-optional-auth branch from a67de0d to 4d6b8c0 Compare September 4, 2026 12:17
@steipete
steipete merged commit f4b335d into main Sep 4, 2026
174 checks passed
@steipete
steipete deleted the codex/fix-video-optional-auth branch September 4, 2026 12:54
@steipete

steipete commented Sep 4, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR P1 High-priority user-facing bug, regression, or broken workflow. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant