Repository navigation
v0.69.0
Getting started
- Sign up free at studio.poly.ai
- Install:
uv tool install polyai-adk - Set up:
poly setup(signs you in, saves an API key, installs shell completion and AI coding-agent skills)
Already installed? Run poly update to get this release and the latest skills.
v0.69.0 (2026-10-13)
This release is published under the Apache-2.0 License.
Features
Summary
Brings the _gen/ stubs that poly pull writes into a project up to date with the latest runtime. Newer runtime types (Clock, CxOne*, Outbound*, VerifiedContext, the connectors/ package) are now available, and from _gen import * exposes exactly the names deployed functions can use, so code that would raise NameError on the platform now fails locally too.
To make that repeatable, the stub sync script is rewritten around mypy's stubgen plus a post-processing pass that emits runtime-safe .py modules. The committed files are byte-identical to what poly pull copies into _gen/, so review and CI validate exactly what ships, and the script refuses to run unless the runtime checkout is a clean origin/main.
Motivation
The custom script (~600 lines) reimplemented stub generation with edge cases around dataclass __init__ synthesis, import pruning, TYPE_CHECKING blocks, and depth-aware relative imports. stubgen handles all of this correctly out of the box. Regenerating also picks up the runtime modules added since the stubs were last synced.
Changes
- Rewrite
scripts/sync_runtime_stubs.pyto shell out tostubgen(viauv run --extra dev) and post-process into runtime-safe.pymodules: relativizeruntime./utils.imports, inject__all__from the runtime'simports.json, drop imports of internal-only modules and erase their names toAny, bind annotation-only declarations (X: T = ...), addfrom __future__ import annotationsand the copyright + linter-suppression header - Add a typing-closure list (CLOSURE_SOURCES): modules such asutils/api_connector.pyare stubbed so that exported classes keep their real base classes and annotation types, but get no__all__entry, so nothing advertises them as importable (their back-edge imports are guarded underTYPE_CHECKINGso the package has no import cycles); re-exports of private names stubgen omits are dropped -from _gen import *now exposes exactly the runtime's public surface fromimports.json: helper classes that were previously star-exported but aren't in
imports.json(e.g.Handoff,EntityConfig, the value-extraction*Configclasses,SMSClient) are no longer top-level names (existing projects reach these through attribute access such asconv.utils.PhoneNumberConfigrather than the bare name, andUtilsnow declares those attributes, which the previous stubs did not), and newer runtime types (Clock,CxOne*,Outbound*,VerifiedContext, …) are added - Validate at sync time: the script refuses to run unless the runtime checkout is a cleanorigin/main(--skip-git-checkto override), imports every generated module in a subprocess and asserts every__all__name binds, then runsruff check --ignore-noqa --select F821,F822andruff formatover the output; it warns when animports.jsonname is missing from its stub, and replaces any__all__the runtime module declares with the one fromimports.json- Writesrc/poly/types/_manifest.json(runtime commit, generation time, module count) and ship it as package
data so the stubs' origin is recorded - Simplifysave_imports()to a verbatim copy of the committed modules (including subpackages such asconnectors/andintegrations/) plus the two genuinely per-project files (aggregated__init__.pywith relative imports,decorators.py) - Addscripts/verify_wheel.py+ awheel-checkCI job: builds the wheel from a clean source copy (a stalebuild/tree would otherwise mask packaging regressions), installs it into a fresh venv, and generates a_gen/from it — the editable installs used everywhere else cannot catch packaging mistakes - Regenerate all stubs from current runtimemain, adding modules that were missing (clock,connectors/,cxone,janus_sms,outbound) - Addmypyto thedevextra - Add tests: generate a real_gen/, import it, and assert every__all__name is bound; check subpackages are generated and every file carries the suppression header; check typing-closure modules aren't advertised in__init__;
import-walk the committedpoly.typesmodules directly; assert no stub carries absoluteruntime./utils.imports
Usage: python scripts/sync_runtime_stubs.py [--python-root /path/to/genai_lambda_runtime/python]
Test strategy
- Added/updated unit tests - [ ] Manual CLI testing (
poly <command>) - [ ] Tested against a live Agent Studio project - [ ] N/A (docs, config, or trivial change)
The sync script was run end-to-end against a fresh runtime main checkout, and save_imports() was verified against a real Agent Studio project: the regenerated _gen/ passes ruff and imports cleanly with every exported name bound.
Checklist
-
ruff check .andruff format --check .pass - [x]pytestpasses (2262 tests, 508 subtests) - [x] No breaking changes to thepolyCLI interface (or migration path documented) - [x] Commit messages follow conventional commits
Screenshots / Logs
Synced 39 stub files to src/poly/types ```
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
---
**Detailed Changes**: [v0.68.2...v0.69.0](https://github.com/polyai/adk/compare/v0.68.2...v0.69.0)