Skip to content

fix(operators): prevent infinite recursion when calling non-explore operators#886

Merged
michael-johnston merged 6 commits into
mainfrom
maj_general_orchestration_fix
Apr 22, 2026
Merged

fix(operators): prevent infinite recursion when calling non-explore operators#886
michael-johnston merged 6 commits into
mainfrom
maj_general_orchestration_fix

Conversation

@michael-johnston
Copy link
Copy Markdown
Member

@michael-johnston michael-johnston commented Apr 21, 2026

Bug reported in #884, bug created in #805

The operator function decorators wrap an operator function, so that when the wrapper is called, the general operator orchestration function is called to execute the wrapped function (the operator function the developer writes and decorates)

Pre #805 an internal function was receiving the un-decorated, original operator function and calling it.
in #805 this functions interface was changed so it received the decorated function, however the call was not updated to account for this (it should have accessed the wrapped function and called it).

As a result that internal call called the wrapper, which called the outermost orchestration function again and a recursive loop kicks off.

operator_wrapper() -> general_orchestration(operator metadata) -> ... -> Internal Function(operator wrapper) -> operator_wrapper()

Instead of

operator_wrapper() -> general_orchestration(operator metadata) -> ... -> Internal Function(operator wrapper) -> unwrap(operator_wrapper)()

run_general_operation_core_closure was calling the decorator function not the decorated (wrapped) function. As a result this caused a recursion run_general_operation_core_closure -> orchestrate_general_operation -> run_general_operation_core_closure -> orchestrate_general_operation etc.

This was because the function passed to run_general_operation_core_closure was the wrapped function before #805. This was changed to the wrapper function in #805 but the actual call was not updated to account for this.
Installing trim for orchestration tests adds two more custom experiments
@AlessandroPomponio AlessandroPomponio changed the title fix(operators): recursion in calling non-explore operators fix(operators): prevent infinite recursion when calling non-explore operators Apr 22, 2026
Copy link
Copy Markdown
Member

@AlessandroPomponio AlessandroPomponio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM thanks

@michael-johnston michael-johnston added this pull request to the merge queue Apr 22, 2026
Merged via the queue into main with commit 77e5b90 Apr 22, 2026
19 checks passed
@michael-johnston michael-johnston deleted the maj_general_orchestration_fix branch April 22, 2026 08:53
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.

2 participants