Skip to content

feat: session region controls - #66

Merged
bnogas merged 4 commits into
mainfrom
feat/session-regions
Aug 6, 2026
Merged

feat: session region controls#66
bnogas merged 4 commits into
mainfrom
feat/session-regions

Conversation

@bnogas

@bnogas bnogas commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

What

SDK surface for session regions.

  • SessionOptions.region (Literal["eu","us"]) and region_policy (Literal["preferred","strict"]), camelCase on the wire via the existing serializer; region_policy="strict" without region raises ValueError locally in __post_init__ (matching the existing cross-field validation convention).
  • Served region parsed from the engine session response into SessionInfo.region (appended field — positional-constructor compatible) and exposed publicly via region properties on AnamClient and Session, mirroring session_id.
  • Region selection is available on Enterprise plans; the API returns 403 with error code session_region_not_available for other plans.

Tests

uv run pytest: 69 passed.

🤖 Generated with Claude Code


Summary by cubic

Adds session region controls so apps can request a region and read the region that served the session. Accepts any region string (see docs for available regions); rejects invalid region_policy values and requires region when strict.

  • New Features
    • SessionOptions.region (string) and region_policy ("preferred" | "strict"), serialized as region and regionPolicy; invalid policies raise ValueError.
    • Engine response region parsed into SessionInfo.region (string) and exposed via AnamClient.region and Session.region (unrecognized values returned as-is).

Written for commit b8440e4. Summary will update on new commits.

Review in cubic

Anam AI added 2 commits August 4, 2026 12:24
Serialize engine region preferences and expose the region reported by successful session starts without changing positional SessionInfo construction.

T19
Expose served regions on clients and sessions, and reject strict region policies without an explicit region.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 3 files

Reply with feedback, questions, or to request a fix.

Fix all with cubic | Re-trigger cubic

Comment thread src/anam/types.py Outdated
Keep region policies closed while allowing request and served-region values introduced after this SDK release.
Comment thread src/anam/client.py Outdated
Comment thread tests/test_client.py Outdated
…gion

- Runtime-validate region_policy like video_quality (cubic review)
- Docstrings point to public docs instead of enumerating regions (seb)
- Replace "ap" with clearly fictional "mars" in future-region tests (seb)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@bnogas
bnogas merged commit 7d75bfc into main Aug 6, 2026
9 checks passed
@bnogas
bnogas deleted the feat/session-regions branch August 6, 2026 15:01
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.

2 participants