Support pre-minted session tokens - #68
Merged
Merged
Conversation
There was a problem hiding this comment.
All reported issues were addressed across 1 file (changes from recent commits).
Reply with feedback, questions, or to request a fix.
Fix all with cubic | Re-trigger cubic
There was a problem hiding this comment.
All reported issues were addressed
Reply with feedback, questions, or to request a fix.
Fix all with cubic | Re-trigger cubic
There was a problem hiding this comment.
1 issue found across 3 files (changes from recent commits).
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="src/anam/client.py">
<violation number="1" location="src/anam/client.py:579">
P3: `_get_persona_config` is now dead code: this change removed its only caller in `send_message`, and nothing else references it. Either keep using it for the API-key path or delete the method to avoid misleading private API surface.</violation>
</file>
Tip: Review your code locally with the cubic CLI to iterate faster.
Fix all with cubic | Re-trigger cubic
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
session_token=Testing
uv run pytest -q(68 passed)uv run ruff check src testsuv run mypy srcstill reports the 31 pre-existing aiortc/PyAV typing errors in_signalling.py,_streaming.py, and_user_audio_input_track.py; no errors remain in changed filesSummary by cubic
Add pre-minted session token auth to the Python SDK so sessions can start without an API key. Fix token-auth message sending and retain API-key persona validation; the token snapshot stays authoritative and only client metadata is sent at start.
New Features
AnamClientsupportssession_token=; provide exactly one ofapi_keyorsession_token. Tokens cannot be combined withpersona_idorpersona_config. Legacy positional token (JWT with dots) still works.CoreApiClient.start_sessionswitches auth mode; token path sends onlyclientMetadataand uses the token inAuthorization.low-risk/hot-fixPRs; bootstrap-safe.Migration
AnamClient(session_token="...")when a trusted service pre-minted the token.persona_id,persona_config, client label, routing overrides, or session options to override a token snapshot.api_key, continue to provide eitherpersona_idorpersona_config(not both).Written for commit b0cbbb4. Summary will update on new commits.