[codex] add platform channel smoke script - #16
Merged
Conversation
|
✅ Clean PR, @calvin-archastro! No blocking findings on
Reply |
calvin-archastro
marked this pull request as ready for review
June 12, 2026 20:37
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.
What changed
Adds
scripts/smoke_platform_channels.py, a live smoke harness for the generated Python websocket channel helpers. The script creates an authenticatedAsyncPlatformClient, opens the platform socket, joins an API chat channel by thread ID or keyed thread, lists messages, optionally posts a simple message, and verifies the posted message is visible on readback.The script is intentionally small and CLI driven so SDK maintainers can run it against a local
platform-rsinstance while iterating on websocket generation or channel auth behavior.Diagrams
sequenceDiagram participant Dev as SDK maintainer participant Script as smoke_platform_channels.py participant Client as AsyncPlatformClient participant Socket as Platform socket participant Chat as ApiChatChannel participant Platform as platform-rs Dev->>Script: run with base url api key access token thread id Script->>Client: create token client Script->>Client: open socket with auto reconnect disabled Client->>Socket: connect using auth params Script->>Chat: join user thread or keyed thread Chat->>Platform: join api chat channel Platform-->>Chat: joined with thread metadata Script->>Chat: list messages Chat-->>Script: message page alt posting enabled Script->>Chat: post simple message with idempotency key Chat-->>Script: message id Script->>Chat: list messages again Chat-->>Script: posted message visible else skip post Script->>Script: finish after join and list end Script->>Chat: leaveclassDiagram class SmokeScript { +main() +_run(args) +_join_chat_channel(socket thread_id key transient) +_assert_ok_reply(name reply) +_message_ids(response) } class AsyncPlatformClient { +with_token(api_key access_token base_url) +open_socket(url auto_reconnect) } class ApiChatChannel { +join_user_thread(socket thread_id) +join_user_keyed(socket key) +join_user_transient(socket key) +api_chat_list_messages(payload) +api_chat_post_simple_message(payload) +leave() } class PlatformSocket SmokeScript ..> AsyncPlatformClient : constructs SmokeScript ..> ApiChatChannel : exercises AsyncPlatformClient ..> PlatformSocket : opens ApiChatChannel ..> PlatformSocket : usesScope indicator
SDK tooling only. This does not change the generated SDK runtime, backend services, or frontend code.
Risk assessment
Low risk. The change adds an opt-in smoke script under
scripts/and does not affect package import behavior or generated code paths. The only runtime dependency is the existing generated Python SDK.User impact
No direct end-user impact. SDK maintainers get a repeatable local smoke test for websocket channel send and readback behavior.
Testing
uv run ruff check scripts/smoke_platform_channels.pyuv run ruff format --check scripts/smoke_platform_channels.pygit diff --checkmsg_033XHoOV1Qu7D5IegD14orEarlier refreshed-checkout verification also ran
ARCHASTRO_RUN_CHANNEL_CONTRACT_TESTS=1 PYTHONDONTWRITEBYTECODE=1 uv run pytest tests/contract -p no:cacheproviderwith1761 passed.Follow-ups and known issues
No known issues. This script assumes callers provide a valid publishable API key and user access token through CLI flags or
ARCHASTRO_API_KEYandARCHASTRO_ACCESS_TOKEN.