Commit 5ce669c
fix(types): tighten permission_suggestions type in SDKControlPermissionRequest (#955)
## Problem
`SDKControlPermissionRequest.permission_suggestions` is typed as
`list[Any] | None`, which suppresses all type-checking on every consumer
of that field. The wire protocol delivers raw JSON objects for each
suggestion (plain dicts), so `Any` was a placeholder with no
enforcement.
This was noted in a TODO comment added alongside the original field
declaration.
## Fix
Replace `list[Any] | None` with `list[dict[str, Any]] | None` on
`permission_suggestions` in `SDKControlPermissionRequest` and remove the
TODO comment.
The wire shape is raw JSON objects — `dict[str, Any]` accurately
reflects that. Consumers that call `PermissionUpdate.from_dict(s)` on
each item now get proper type-checking on the input to that call.
No runtime behaviour changes.
## Tests
- `mypy src/`: clean (no new errors)
- `ruff check src/ tests/`: clean
- `pytest tests/`: 745 passed, 5 skipped — same baseline as `main`
Closes #957.
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent 6bbad5f commit 5ce669c
1 file changed
Lines changed: 1 addition & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1942 | 1942 | | |
1943 | 1943 | | |
1944 | 1944 | | |
1945 | | - | |
1946 | | - | |
| 1945 | + | |
1947 | 1946 | | |
1948 | 1947 | | |
1949 | 1948 | | |
| |||
0 commit comments