Skip to content

Native caption API parity with live_transcription, and a mock Talk proxy - #22

Merged
ikusteu merged 4 commits into
mainfrom
feat/live-transcription-parity-scaffold
Nov 19, 2026
Merged

ikusteu merged 4 commits into
mainfrom
feat/live-transcription-parity-scaffold

Conversation

@ikusteu

@ikusteu ikusteu commented Nov 18, 2026

Copy link
Copy Markdown
Member

Why

Cassini Live should work as a stand-in for Nextcloud's live_transcription provider, with extra capabilities on top. Talk calls only the app id live_transcription (nextcloud/spreed#20296), so until that changes the panel needs its own way to start captions.

What changes

  • Native caption API (/api/v1/..., /capabilities) answers as nextcloud/live_transcription 2.1.3 does: the same routes, status codes, {"error": ...} bodies and message texts, with no per-user checks. An unsupported language is 400, no longer 422. The language auto stays, and stays the default.
  • Translation routes are added (GET /api/v1/translation/languages, POST /api/v1/translation/set-target-language). Cassini Live does not translate; they answer 550, which Talk reads as "not supported".
  • Mock Talk proxy (cassini_live/mock_talk_proxy.py): POST and DELETE /mock_talk_proxy/live-transcription/{token} stand in for Talk's endpoints. They make Talk's checks (the caller's own session, in the call to start, CSRF header, rate limit), then send the native route a real HTTP request on the app's own socket, with the fields and AppAPI headers Talk sends. These are the only caption routes declared for the browser.
  • Panel starts captions through the mock route, with its session id only.
  • POST /captions/transcribe is deprecated. It still works for panels already open during an upgrade.
  • niquests (already installed through nc-py-api) becomes a direct dependency, for the request to the app's own socket.

The mock is temporary. When Talk can call this app: delete the module, its two lines in app.py and its manifest routes, and let the panel call Talk's endpoints.

Where the native API is not identical to upstream

  • An unsupported language on transcribe is 400; upstream accepts any string.
  • The 550 message for translation is "Translation is not supported"; upstream's text tells the administrator to install a translation provider, which would not help here.
  • The capabilities key stays live_transcription, which is what Talk reads.

Notes for review

  • appinfo/info.xml gets the same route change only because scripts/check_manifest.py requires the two manifests to match.
  • Not done here, by choice: translation itself, a moderator-checked set-language from the browser, refusing classified and Matrix conversations in the mock, a stored caption language per conversation, guests.

Testing

  • New and changed Python tests pass, including the hop to the native route over a real TCP port and a real Unix socket. The full run has 26 failures in the diagnostics, capacity, model store and resources tests; the same 26 fail on main on this machine.
  • Panel: 98 unit tests and 54 browser tests pass.
  • Dev harness (Nextcloud with AppAPI and HaRP, both providers installed): the same ten requests to both providers through AppAPI gave matching status and body, except translation languages, where upstream 2.1.3 answers 500 because it fails to parse that Nextcloud's task types. Through the browser proxy the mock routes answer as expected and every native route is 404. In a real call the served panel started captions through the mock, finals arrived with seq, and DELETE stopped them.

🤖 Generated with Claude Code

https://claude.ai/code/session_01AXXsWdprpxxDAGvThQT9Mg

ikusteu and others added 4 commits November 18, 2026 16:55
…k proxy

The native routes (/api/v1/..., /capabilities) now match
nextcloud/live_transcription 2.1.3: the same routes, status codes,
{"error": ...} bodies and messages, with no per-user checks. The two
translation routes exist and answer that translation is not available
(550). The language "auto" stays as the one addition.

Talk calls only the app id live_transcription (nextcloud/spreed#20296),
so /mock_talk_proxy/live-transcription/{token} stands in for it: it
makes Talk's checks, then sends the native route a real HTTP request
with the fields and AppAPI headers Talk sends. These are the only
caption routes declared for the browser. /captions/transcribe stays
for one release for panels already open.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AXXsWdprpxxDAGvThQT9Mg
The panel posts to mock_talk_proxy/live-transcription/{token} with its
session id only, as it would to Talk's endpoint, and no longer sends a
language.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AXXsWdprpxxDAGvThQT9Mg
Set with scripts/release-version.sh (both manifests and their image tag,
pyproject.toml, cassini_live/__init__.py, uv.lock). AppAPI reads an app's
routes only when its version changes, and this branch adds the
mock_talk_proxy routes.

Docs that quote the current version or image tag follow. Not tagged; no
image is published for 0.11.2.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AXXsWdprpxxDAGvThQT9Mg
@ikusteu

ikusteu commented Nov 19, 2026

Copy link
Copy Markdown
Member Author

Tried this in staging, merging in for dogfooding

@ikusteu
ikusteu merged commit 06b2208 into main Nov 19, 2026
11 checks passed
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