ColtenOuO opened a new pull request, #70433:
URL: https://github.com/apache/airflow/pull/70433

   ## Summary
   
   `HookToolset` advertises a hook method's `bytes`-typed parameters to the LLM 
as JSON strings (`_TYPE_MAP` maps `bytes` -> `{"type": "string"}`, since JSON 
has no binary type), but `call_tool` never converted the string back to `bytes` 
before calling the method. A hook method like `S3Hook.load_bytes(bytes_data: 
bytes, ...)` would receive a plain `str`, failing at runtime with an opaque 
`TypeError: a bytes-like object is required, not 'str'` from `BytesIO`.
   
   ## Changes
   
   - Add `_bytes_param_names(method)` to resolve which parameters (including 
`Optional[bytes]`/`bytes | None`) are `bytes`-typed.
   - `call_tool` now UTF-8-encodes any `str` value supplied for those 
parameters before dispatching to the hook method.
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [X] Yes — Claude Code (Sonnet 5)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to