Skip to content

Feat: add RetryPolicy#121

Open
sonleoracle wants to merge 4 commits intomainfrom
feat-retry-policy
Open

Feat: add RetryPolicy#121
sonleoracle wants to merge 4 commits intomainfrom
feat-retry-policy

Conversation

@sonleoracle
Copy link
Member

@sonleoracle sonleoracle commented Feb 26, 2026

This PR adds the RetryPolicy config object to Agent Spec so that users can configure networked components (LLMConfig, API Node, RemoteTool) how to retry when the request does not succeed.

closes #119

@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Feb 26, 2026
@paul-cayet paul-cayet requested review from cesarebernardis, dhilloulinoracle, jschweiz and paul-cayet and removed request for jschweiz March 16, 2026 14:42
@paul-cayet paul-cayet marked this pull request as ready for review March 16, 2026 14:42
@paul-cayet paul-cayet requested a review from a team March 16, 2026 14:42
@dhilloulinoracle
Copy link
Contributor

Internal regression succeeded 🍏: Build ID #372



* ``max_attempts``: maximum number of retries for a request that fails with a recoverable status.
Defaults to 2.
Copy link
Member

Choose a reason for hiding this comment

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

What do "Defaults to" mean in this scope? They are not optional and the configuration is supposed to be complete for now, so we should always include the values. I would remove these statements (they can still be the default values we set in pyagentspec).

of the number of attempts. Defaults to 2.0.
* ``jitter``: type of backoff we want to do. Defaults to ``"full_and_equal_for_throttle"``.

* ``None``: ``t = min(min_wait * (backoff_factor ** attempts), max_wait)``
Copy link
Member

Choose a reason for hiding this comment

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

Seems a bit weird that None does not coincide with any of the other options (or am I wrong?). Why don't we give a name to that option too?


* **Retry policy for remote transports and agents:**

Added ``retry_policy`` support to components remote MCP transports, ``OciAgent``,
Copy link
Member

Choose a reason for hiding this comment

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

MCP transports

We don't I think, no? We say "MCP remote transports currently do not define a retry_policy attribute."

* **Retry policy for remote transports and agents:**

Added ``retry_policy`` support to components remote MCP transports, ``OciAgent``,
and ``A2AAgent`` so SDK users can configure retries, backoff, and request timeouts
Copy link
Member

Choose a reason for hiding this comment

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

Also OciAgents and A2A don't have the new retry in the spec no? Please double check this changelog entry.

pyyaml==6.0.3
httpx==0.28.1
urllib3==2.6.2
urllib3==2.6.3
Copy link
Member

Choose a reason for hiding this comment

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

Does it align with the BAs we have?

# `retry_policy` was introduced in Agent Spec 26.2.0.
# For backwards compatibility, omit the field when not explicitly set
# (example 26.2.0 configs do not include `retry_policy: null`).
if agentspec_version < AgentSpecVersionEnum.v26_2_0 or self.retry_policy is None:
Copy link
Member

Choose a reason for hiding this comment

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

Config should be complete for now, don't exclude it if the version is >= 26.2.0

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

Labels

OCA Verified All contributors have signed the Oracle Contributor Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: make it possible to configure a retry policy on components doing network communications

4 participants