Skip to content

fix: tighten permission_suggestions type from list[Any] to list[dict[str, Any]]#997

Open
2023Anita wants to merge 1 commit into
anthropics:mainfrom
2023Anita:fix/permission-suggestions-type
Open

fix: tighten permission_suggestions type from list[Any] to list[dict[str, Any]]#997
2023Anita wants to merge 1 commit into
anthropics:mainfrom
2023Anita:fix/permission-suggestions-type

Conversation

@2023Anita
Copy link
Copy Markdown

Summary

Fix PermissionRequestHookInput.permission_suggestions type annotation from list[Any] to list[dict[str, Any]].

Root Cause

The wire protocol delivers raw JSON objects (plain dicts) for each permission suggestion, but the field was typed as list[Any], suppressing all type-checking on consumers. The Any annotation was a placeholder that was never tightened.

Verification

  • python -m ruff check src/
  • python -m mypy src/claude_agent_sdk/types.py
  • No runtime behavior changes — purely a type-level correction

Risk / Compatibility

Zero risk. This is a strict narrowing of the type annotation — dict[str, Any] is a subtype of Any, so all existing code remains compatible. Type checkers will gain coverage; no runtime behavior changes.

Related

Closes #957

…str, Any]]

The wire protocol delivers raw JSON objects (plain dicts) for each
permission suggestion. list[Any] suppressed all type-checking on
consumers of this field. list[dict[str, Any]] accurately reflects the
wire format and restores type-checker coverage.

Closes anthropics#957
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.

SDKControlPermissionRequest.permission_suggestions typed as list[Any] instead of list[dict[str, Any]]

1 participant