Skip to content

add operator max steps to request#159

Open
dragon18456 wants to merge 1 commit into
mainfrom
nicholas/max-operator-steps
Open

add operator max steps to request#159
dragon18456 wants to merge 1 commit into
mainfrom
nicholas/max-operator-steps

Conversation

@dragon18456

Copy link
Copy Markdown

Adds max steps to operator in the request so you can raise or lower it.

@dragon18456 dragon18456 requested a review from xTRam1 June 19, 2026 02:46
callback_headers: Mapping[str, Any] | None = None,
on_input_required: InputRequiredCallback | None = None,
critic: CriticConfig | None = None,
max_operator_steps: int | None = None,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Because this is a new public SDK parameter, please document the semantics at the API boundary rather than only plumbing it through. The name says “operator steps”, but callers need to know the production contract: this should cap cumulative operator/browser-action steps for the run/session, valid values are 1..100, and exceeding it raises NaradaOperatorMaxStepsExceededError with max_operator_steps populated when the backend includes it.

I would add a short docstring/API-docs entry along these lines:

max_operator_steps: Optional cap on the number of cumulative Operator
    browser-action steps the run may take. Must be between 1 and 100.
    When the cap is reached, Agent.run raises
    NaradaOperatorMaxStepsExceededError.

This matters because otherwise external users may read this as a timeout, a token/LLM-iteration cap, or a per-request retry limit. The SDK should describe the same cumulative behavior that the caddie implementation enforces, especially since this is now part of the public surface of Agent.run().

callback_headers: Mapping[str, Any] | None = None,
on_input_required: InputRequiredCallback | None = None,
critic: CriticConfig | None = None,
max_operator_steps: int | None = None,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Same public API concern for the Pyodide package: this parameter should be documented wherever the browser SDK surface is documented, not only forwarded. Agent Studio / Pyodide users are often less close to the backend implementation, so the distinction between “operator browser-action steps” and “LLM iterations” is especially important here.

Please keep the CPython and Pyodide docs/signatures aligned and describe the same behavior in both places:

max_operator_steps: Optional cap on cumulative Operator browser-action
    steps for this run/session. Must be 1..100. Raises
    NaradaOperatorMaxStepsExceededError when reached.

That also gives us a clean contract to test against across the three repos: SDK sends operatorMaxIterations, frontend preserves it through remote dispatch, and caddie enforces it cumulatively in the operator persisted runtime.

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