Repository navigation
Support zero- and multi-parameter activities in Deep Agents' activity_as_tool - #313
Merged
brianstrauch merged 1 commit intoOct 30, 2026
Conversation
…_as_tool activity_as_tool collapsed the model's keyword call into one positional argument, so an activity with two or more parameters got a dict as its first argument and one with none got an empty dict, and every attempt failed with a TypeError. Pass one argument per activity parameter instead, filling the ones the model leaves out with their defaults.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
brianstrauch
enabled auto-merge (squash)
October 30, 2026 20:49
This was referenced Oct 31, 2026
campoy
added a commit
that referenced
this pull request
Nov 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
activity_as_tool(in_tools.py) shows the model the activity's own parameters, then collapses the model's keyword call into one positional argument: the value itself for a one-parameter activity, a dict of all the arguments otherwise, and{}for an activity with none. The worker calls the activity with one argument per input. So a two-parameter activity gets the dict as its first argument and fails with "missing 1 required positional argument", and a zero-parameter one fails with "takes 0 positional arguments but 1 was given". Every attempt fails the same way, so under the default retry policy the tool call never returns. Python activities can take several parameters; the OpenAI Agents plugin'sactivity_as_toolalready passesargs=.This change maps the model's arguments onto the activity's parameters in order and calls
workflow.execute_activity(activity, args=[...]). A parameter the model leaves out gets its default, so the worker still decodes the arguments with the activity's type hints (it uses them only when every parameter has a value). A one-parameter activity is scheduled with the same input as before, so existing histories replay unchanged.Related: #278 reads the same
inspect.signature(activity)line for callable-class activities; this change is about how the call's values are passed.Checklist
Closes: no issue (small bug fix).
How was this tested:
test_activity_as_tool_passes_each_parameterintests/test_tools.pyruns a workflow that calls a three-parameter activity (the last has a default) twice, once leaving the default out, and a zero-parameter activity. With the change it returns["Paris:3:C", "Oslo:1:F", "quota:42"]. On main it fails after about 16 s, inside the 30 s execution timeout, with anActivityErrorcaused byTypeError: forecast_activity() missing 1 required positional argument: 'days'.make lintpasses.make test(the plugin): 137 passed.Any docs updates needed? No.