You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Address two issues raised in PR #102 review by Ohyee:
1. Workspace lookup was hardcoded to a single page (page_size=50). If
the upstream `name=` filter is server-side prefix/fuzzy match, a busy
account can easily exceed 50 same-prefix workspaces and the resolver
would silently miss the target. `_lookup_sync` / `_lookup_async` now
paginate, accumulating candidates across pages and short-circuiting
when a page returns fewer than `_PAGE_SIZE` rows; a `_MAX_PAGES=20`
safety cap (1000 candidates) prevents runaway loops on misbehaving
upstreams.
2. The workspace_name resolution path mutated the caller's input object
(`input.workspace_id = ...; input.workspace_name = None`), which is
surprising for a side-effect-free convenience field. Replaced with
`input = input.model_copy(update={...})` so the caller's instance is
untouched. Applied to create / create_async / list / list_async in
client.py and mirrored into the codegen template.
Tests:
- 4 new pagination cases (multi-page accumulation, short-page early
stop, MAX_PAGES cap, async multi-page).
- 4 existing mutation assertions flipped to "caller's input stays
unchanged; OpenAPI request carries the resolved id".
agent_runtime suite 266 passed / 2 skipped; `_workspace.py` 95.62%
line/branch. Full repo 3481 passed.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Signed-off-by: Sodawyx <sodawyx@126.com>
0 commit comments