Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix max_iterations_override #1733

Merged
merged 1 commit into from
Feb 6, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion skyvern/forge/sdk/routes/agent_protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -1193,7 +1193,7 @@ async def observer_task(
background_tasks: BackgroundTasks,
data: ObserverTaskRequest,
organization: Organization = Depends(org_auth_service.get_current_org),
x_max_iterations_override: Annotated[int | None, Header()] = None,
x_max_iterations_override: Annotated[int | str | None, Header()] = None,
Copy link
Contributor

Choose a reason for hiding this comment

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

Allowing x_max_iterations_override to be int | str may lead to inconsistent behavior. If an integer override is expected, consider converting the header value to int explicitly and using an explicit None check (e.g. 'if x_max_iterations_override is not None') to avoid misinterpreting 0. Also, align its type with similar parameters (like x_max_steps_override).

) -> dict[str, Any]:
if x_max_iterations_override:
LOG.info("Overriding max iterations for observer", max_iterations_override=x_max_iterations_override)
Expand Down
Loading