Skip to content

[18.0][FIX] ai_oca_bridge: honor timeout from _execute_kwargs - #108

Open
marcelsavegnago wants to merge 1 commit into
OCA:18.0from
Escodoo:18.0-fix-ai_oca_bridge-timeout-kwargs
Open

[18.0][FIX] ai_oca_bridge: honor timeout from _execute_kwargs#108
marcelsavegnago wants to merge 1 commit into
OCA:18.0from
Escodoo:18.0-fix-ai_oca_bridge-timeout-kwargs

Conversation

@marcelsavegnago

@marcelsavegnago marcelsavegnago commented Aug 28, 2026

Copy link
Copy Markdown
Member

This pull request improves the handling of the timeout parameter in the ai_bridge_execution model and adds a corresponding test to ensure correct behavior. The main focus is to allow the timeout value to be overridden via keyword arguments, enhancing flexibility and preventing potential errors.

Enhancements to timeout handling:

  • Updated the _execute method in ai_bridge_execution.py to extract the timeout value from keyword arguments, defaulting to 30 seconds if not provided, and ensuring it is passed correctly to the requests.post call.

Testing improvements:

  • Added a new test test_execute_timeout_from_kwargs in test_bridge.py to verify that the timeout parameter can be set via keyword arguments and defaults to 30 when not specified. The test also checks that no TypeError is raised and that the execution state is correctly set to "done".

Hardcoding timeout=30 and unpacking _execute_kwargs that may also
contain timeout raises TypeError. Downstream modules cannot set a
per-bridge HTTP timeout without replicating _execute.
@marcelsavegnago
marcelsavegnago force-pushed the 18.0-fix-ai_oca_bridge-timeout-kwargs branch from 9cd2f0d to eef19b4 Compare August 28, 2026 05:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants