Skip to content

feat(platform): managed-user update, caller ID config and identity catalog - #7

Merged
Charlie-Qilin merged 5 commits into
mainfrom
feat/platform-session-config-and-profile-update
Oct 21, 2026
Merged

Charlie-Qilin merged 5 commits into
mainfrom
feat/platform-session-config-and-profile-update

Conversation

@Charlie-Qilin

@Charlie-Qilin Charlie-Qilin commented Oct 21, 2026 •

Copy link
Copy Markdown
Collaborator

Why

Partners need to change a managed user's profile, choose the caller ID per session, and set the assistant. This PR adds those calls to the SDK and its docs.

It also fixes a bug: Socket.IO messages sent datetime.now().isoformat() as client_now_date. That value has no UTC offset, so the server could not parse it, and the agent always used UTC.

What changed

Area Change
Managed users platform.managed_users.update(external_id, *, email, name, phone, assistant) → PATCH /platform/v1/managed-users/{external_id}. None is not sent; phone="" removes the phone; no arguments sends {}. Errors raise PlatformError.
Assistant create() and update() take assistant as a dict with identity_id, name or both. Other keys or non-string values raise ValueError before any request. ManagedUser.assistant is ManagedUserAssistant or None.
Caller ID sessions.get_config() / sessions.update_config(caller_id=...) on GET/PUT /v2/sessions/{id}/config. caller_id is "user" or "platform"; other values raise ValueError before any request. 503 session_config_push_failed is a SessionError; no automatic retry.
Identity catalog settings.assistant_identities() → GET /v2/app/settings/assistance_identities?identities=catalog. A key-only client reads it anonymously.
client_now_date Socket.IO chat() and send_message() take it, as REST send_message() already did. On every path it must be an RFC 3339 time with a UTC offset, or ValueError is raised before any request (validate_client_now_date). Without it, nothing is sent.
Sync PineAI has the same REST methods.

Docs: new sections in sdk-api.md and http-api.md for update, assistant identity (Pine's default assistant until one is chosen), caller ID and the user's time. The REST history delay now says "a minute or more". README links point to the docs on main, so they stay the same across releases and open on PyPI. CHANGELOG has upgrade notes, and the version is 0.5.0rc3.

Breaking

client_now_date without a UTC offset now raises ValueError. The server ignored such values before, so the effect was UTC anyway.

Verification

  • ruff check src tests: clean.
  • pytest tests --ignore=tests/integration: 271 passed on Python 3.12 and 3.10, 51 of them new.
  • mypy: no new errors.
  • python -m build and twine check: passed.
  • End to end against a local server with the new endpoints, 27/27 passed: create, update and clear a managed user, assistant, catalog, session config, and the errors. The agent received the caller ID setting, the time offset from client_now_date over REST and Socket.IO, no offset without it, and the config change while a session was active.

🤖 Generated with Claude Code

Charlie-Qilin and others added 4 commits October 21, 2026 19:46
…y catalog

- platform.managed_users.update() (PATCH): only the given members are sent,
  phone="" removes the phone. create() and update() take assistant as a dict
  with identity_id and/or name; ManagedUser.assistant defaults to None, so
  responses without the field still parse.
- sessions.get_config() / update_config(caller_id="user" | "platform") on
  GET/PUT /v2/sessions/{id}/config; other values fail before any request.
- app_settings.assistant_identities() reads the identity catalog
  (/v2/app/settings/assistance_identities?identities=catalog); a key-only
  client reads it anonymously.
- client_now_date: Socket.IO chat() and send_message() take it, and every
  path requires an RFC 3339 time with a UTC offset. The Socket.IO default
  of a naive local time is removed: the server could not parse it, so the
  agent always used UTC.

Docs, CHANGELOG and version 0.5.0rc3.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Drop the lines on when the first call uses the setting and on removing
it. "user" and no value behave the same; the assistant number applies only
when the user has one; "platform" shows a pool number without "always".
The STIR/SHAKEN caution now says the rating depends on whether the carrier
that places the call owns the number, so any caller ID can get B or C.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
send_message() on REST and chat()/send_message() on Socket.IO take
timezone (an IANA name or a tzinfo). The SDK sends the current local time
in it as client_now_date, so callers cannot send a malformed value. An
unknown time zone raises ValueError before any request. tzdata is a
dependency on Windows, which has no system time zone database.

Docs: the caller ID section is shorter and drops the STIR/SHAKEN caution;
it can be set or changed at any time. README links point to the docs on
main, so they stay the same across releases and open on PyPI.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
client.app_settings is now client.settings (SettingsAPI, SyncSettingsAPI);
the request path is unchanged.

Docs: on update(), an identity without name also replaces a custom name;
a call already placed, including its retries, keeps its caller ID, and a
change while the session is paused applies when it resumes; the session
config is open to managed users and test accounts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Charlie-Qilin
Charlie-Qilin marked this pull request as ready for review October 21, 2026 12:46
@Charlie-Qilin

Copy link
Copy Markdown
Collaborator Author

@codex review

@Charlie-Qilin
Charlie-Qilin force-pushed the feat/platform-session-config-and-profile-update branch from 246c742 to 289fbcd Compare October 21, 2026 14:24
Go back to one client_now_date parameter on REST send_message() and on
Socket.IO chat()/send_message(): it keeps 0.5.0rc2 code working and matches
the HTTP field. A value without a UTC offset still raises ValueError, and
validate_client_now_date() is exported again. The tzdata dependency is
removed.

Docs: managed users have Pine's default assistant until you choose one;
the CHANGELOG entry is shorter.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Charlie-Qilin
Charlie-Qilin force-pushed the feat/platform-session-config-and-profile-update branch from 289fbcd to 54947f3 Compare October 21, 2026 14:24
@Charlie-Qilin
Charlie-Qilin requested a review from Jim0v0 October 21, 2026 14:49
@Charlie-Qilin
Charlie-Qilin merged commit e105edd into main Oct 21, 2026
5 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