Skip to content

fix(cli): pass required payment url to SmallestAIEnvironment; type-guard ws - #85

Merged
abhishekmishragithub merged 1 commit into
mainfrom
chore/cli-env-payment-and-types
Aug 5, 2026
Merged

abhishekmishragithub merged 1 commit into
mainfrom
chore/cli-env-payment-and-types

Conversation

@abhishekmishragithub

Copy link
Copy Markdown
Collaborator

Two fixes in hand-maintained files (both surfaced as mypy noise; one is a real runtime bug)

1. make_client runtime bug (real)

SmallestAIEnvironment.__init__ requires payment (*, atoms, waves, waves_ws, payment). The SMALLEST_BASE_URL branch in cli/lib/client.py built the env without it, so make_client raised TypeError at runtime whenever a user pointed the CLI at a custom endpoint (dev rig / self-host). Now passes payment=base.

2. stream_tts.py type-safety

self.ws is Optional[WebSocketApp]. send()/close() were called on it directly, tripping mypy union-attr. Capture a non-None local after _connect() (and assert after the is_connected guards) so the calls are type-safe. No behavior change — _connect() already raises unless the socket opened.

Clears the pre-existing mypy union-attr / call-arg errors in these two files. mypy-clean (--follow-imports=silent).

🤖 Generated with Claude Code

…ard ws

- cli/lib/client.py: SmallestAIEnvironment now requires a payment url. The custom
  SMALLEST_BASE_URL branch omitted it, so make_client raised TypeError at runtime
  whenever SMALLEST_BASE_URL was set (dev-rig / self-host). Pass payment=base.
- waves/stream_tts.py: self.ws is Optional[WebSocketApp]; capture a non-None local
  after connect (and assert after is_connected checks) so send/close are type-safe.
  Clears the mypy union-attr errors in these hand-maintained files.
@abhishekmishragithub
abhishekmishragithub merged commit 0eb3fcb into main Aug 5, 2026
3 checks passed
@abhishekmishragithub
abhishekmishragithub deleted the chore/cli-env-payment-and-types branch August 5, 2026 14:10
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