Skip to content

Document 202 Accepted for detectVoiceActivity and detectCredits#120

Open
hammerlabs wants to merge 1 commit into
LukasParke:mainfrom
hammerlabs:fix/detection-triggers-202-accepted
Open

Document 202 Accepted for detectVoiceActivity and detectCredits#120
hammerlabs wants to merge 1 commit into
LukasParke:mainfrom
hammerlabs:fix/detection-triggers-202-accepted

Conversation

@hammerlabs

@hammerlabs hammerlabs commented Jun 13, 2026

Copy link
Copy Markdown

Problem

PUT /library/metadata/{ids}/voiceActivity and PUT /library/metadata/{ids}/credits return 202 Accepted (async — the detection job is scheduled, not completed inline), but the spec documents only 200. Speakeasy-generated SDKs (e.g. plex-api-client / plexpy) therefore treat the valid 202 as an unexpected response and raise SDKError, even though the request succeeded:

plex_api_client.models.errors.SDKError: Unexpected response received: Status 202 Content-Type text/html

Evidence

Verified live against PMS 1.43.2.10687-563d026ea — the current latest per Plex's own updater (/updater/status), i.e. not an old-version quirk:

Endpoint Observed
PUT …/voiceActivity?force=1&manual=1 202
PUT …/credits?force=1&manual=1 202
PUT …/analyze, …/intro, …/addetect, …/chapterThumbs 200 (unchanged)

Only the two endpoints in this PR return 202; the sibling triggers return 200 and are intentionally left alone.

Change

  • Adds a shared #/components/responses/202 (Accepted, text/html) mirroring the existing 200.
  • References it from detectVoiceActivity and detectCredits alongside the existing 200.

8 lines added, no other operations touched.

Verification

Regenerated the Python SDK from the patched spec with Speakeasy: the generated method changes from match_response(http_res, "200", "*") to match_response(http_res, ["200", "202"], "*") and a live detect_voice_activity() call now returns cleanly instead of raising.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Documentation
    • Updated API documentation to reflect 202 Accepted responses for credit detection and voice activity detection endpoints, indicating these operations are now documented as asynchronous requests.

Plex returns `202 Accepted` (text/html body) for these async detection
triggers, but the spec documents only `200`. Speakeasy-generated SDK clients
(e.g. plex-api-client / plexpy) therefore treat the valid 202 as an unexpected
response and raise SDKError, even though the job was accepted and scheduled.

Verified live against PMS 1.43.2.10687-563d026ea — the current latest per
Plex's own updater as of 2026-06-13 (i.e. not an old-version quirk):
  PUT /library/metadata/{ids}/voiceActivity  -> 202
  PUT /library/metadata/{ids}/credits        -> 202
Sibling triggers (analyze, intro, addetect, chapterThumbs) return 200 and are
left unchanged. developer.plex.tv shows 200 only because those docs are
rendered from this spec, not from observed server behavior.

Adds a shared `#/components/responses/202` (Accepted) and references it from
the two affected operations alongside the existing 200.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 725503c8-81ef-4421-b826-aae6faab4d9d

📥 Commits

Reviewing files that changed from the base of the PR and between 29414a3 and 37860e8.

📒 Files selected for processing (1)
  • plex-api-spec.yaml

📝 Walkthrough

Walkthrough

The OpenAPI specification gains a new shared components.responses['202'] entry (HTTP Accepted, text/html content). This component is then referenced as a documented 202 response on both the detectCredits (PUT /library/metadata/{ids}/credits) and detectVoiceActivity (PUT /library/metadata/{ids}/voiceActivity) operations.

Changes

202 Accepted Response Documentation

Layer / File(s) Summary
Shared 202 component and operation-level references
plex-api-spec.yaml
Introduces components.responses['202'] with description: Accepted and text/html content, then adds 202 response references to the detectCredits and detectVoiceActivity PUT operations pointing to that shared component.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

A most dignified 202, I do declare! 🎩
The butler presents Accepted with impeccable flair,
Credits detected, voice activity too,
Each PUT operation now properly due.
The spec is laid out — quite proper, quite right,
All responses accounted for, tidy and bright. ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title precisely captures the main change: documenting HTTP 202 Accepted responses for the two affected endpoints (detectVoiceActivity and detectCredits).
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant