Skip to content

Allow retry configuration on @tool decorator for sdks #1568

Description

@nickorkes

Migrated from agentspan-ai/agentspan#167 (originally by @v1r3n) as part of the Agentspan → Conductor merge. The Agentspan repo is archived; the agent runtime now lives here.


Currently, all @tool functions get a hardcoded Conductor task definition with retry_count=2 and retry_delay_seconds=2 (set in _default_task_def in runtime.py). Users cannot override this from the SDK.

Add retry_count and retry_delay_seconds as optional parameters on the @tool decorator:

@tool(retry_count=10, retry_delay_seconds=5, retry_policy="linear_backoff|expoential") # similar to task def
def call_flaky_api(query: str) -> str:
    ...

@tool(retry_count=0)  # fail immediately, no retries
def process_payment(amount: float) -> dict:
    ...

These values should be passed through to the Conductor TaskDef when the tool is registered.
Follow same configurations as Conductor TaskDef https://github.com/conductor-oss/conductor/blob/main/common/src/main/java/com/netflix/conductor/common/metadata/tasks/TaskDef.java for the retry policy. Give an easy way to configure with sensible defaults and allow users to configure as required.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions