Skip to content
This repository was archived by the owner on Jul 27, 2026. It is now read-only.

[ISSUE-030] Fix voices get 404 on cloned/custom voices — custom-voice fallback - #58

Merged
pillip merged 2 commits into
mainfrom
issue/ISSUE-030-voices-get-custom-fallback
Jun 15, 2026
Merged

[ISSUE-030] Fix voices get 404 on cloned/custom voices — custom-voice fallback#58
pillip merged 2 commits into
mainfrom
issue/ISSUE-030-voices-get-custom-fallback

Conversation

@pillip

@pillip pillip commented Jun 15, 2026

Copy link
Copy Markdown
Collaborator

Closes #57

Summary

supertone voices get <id> only queried the preset endpoint (/v1/voices/{id}), so cloned/custom voices (/v1/custom-voices/{id}) returned a 404 — even though edit/delete work on the same id.

This adds a narrow 404 detector (_is_not_found_error, lazy SDK import) and a fallback in get_voice: on a preset 404, it calls client.custom_voices.get_custom_voice(voice_id=...) and builds Voice(..., type="custom") via the existing helpers.

  • Preset success path unchanged (Type: preset).
  • Auth/network errors still propagate as AuthError/APIError with NO spurious second call (404 detection is narrow; auth checked first).
  • Both endpoints miss -> APIError (exit 1, not-found message).

Tests

  • Unit: preset hit (custom endpoint NOT called), preset-404 -> custom fallback returns type=custom, both-miss -> APIError, preset-auth -> AuthError with no fallback call.
  • CLI: voices get on a custom voice exits 0 showing Type: custom; --format json returns type: "custom".
  • Full suite: 163 passed, 1 skipped. ruff clean. Coverage 81.58% (gate >80%).

Track: product | Priority: P1

pillip and others added 2 commits June 15, 2026 16:02
get_voice queried only the preset endpoint (/v1/voices/{id}), so cloned
voices (/v1/custom-voices/{id}) returned 404 even though edit/delete work
on the same id. Add a narrow 404 detector (_is_not_found_error) and fall
back to client.custom_voices.get_custom_voice, building Voice(type=custom).
Auth/network errors still propagate without a spurious second call; if both
endpoints miss, raise APIError with a clear not-found message.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Senior review: APPROVE. No Critical/High findings. Verified narrow 404
detection (auth/network errors do not trigger fallback, no spurious second
call), preset path unchanged. Two non-blocking Low follow-ups recorded.
uv run pytest: 163 passed, 1 skipped. ruff clean.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@pillip
pillip merged commit a6ef97e into main Jun 15, 2026
6 checks passed
@pillip
pillip deleted the issue/ISSUE-030-voices-get-custom-fallback branch June 15, 2026 07:11
pillip added a commit that referenced this pull request Jun 16, 2026
- src/supertone_cli/__init__.py: bump __version__ to 0.2.1
- CHANGELOG.md: cut [0.2.1] - 2026-06-16
  - Fixed: usage analytics now converts YYYY-MM-DD to ISO-8601
    datetime before calling /v1/usage (ISSUE-029, PR #56)
  - Fixed: voices get falls back to the custom-voice endpoint on a
    preset 404 so cloned voices resolve (ISSUE-030, PR #58)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ISSUE-030] Fix voices get 404 on cloned/custom voices — fall back to custom-voice endpoint

1 participant