OpenHands / OpenHands/software-agent-sdk

Add typed retry and LLM delegation contracts

Open
#4,977 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement ready-for-dev sdk typing
Dominant language
Python
Stars
1.1k
Forks
539
Avg merge
1d 19h
Merged PRs (30d)
137

Description

Parent tracking issue: #4904

Desired Behavior

Retry state, retry stop conditions, exception retry metadata, and router fallback delegation should use explicit SDK-owned contracts. Exceptions should declare retry metadata rather than receiving attributes dynamically, and LLM/router subclasses should expose shared capabilities through inheritance or protocols.

Scope

  • openhands-sdk/openhands/sdk/llm/utils/retry_mixin.py
  • openhands-sdk/openhands/sdk/llm/router/base.py
  • Related agent/base LLM capability access where the same contract applies
  • Focused retry/router tests and baseline updates

Acceptance Criteria

  • SDK exception types declare retry attempt and maximum retry metadata explicitly.
  • Retry-state and stop-condition access is normalized through typed contracts.
  • Router delegation has a typed surface or an explicitly documented narrow compatibility boundary.
  • Tests cover bounded/unbounded retries, exception metadata, and fallback delegation.
  • Relevant forbidden dynamic-attribute baseline entries are removed and type checks pass.

This issue was created by an AI agent (OpenHands) on behalf of the user.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with openhands-sdk/openhands/sdk/llm/utils/retry_mixin.py and openhands-sdk/openhands/sdk/llm/router/base.py, then inspect the related agent/base LLM capability access. Run the focused retry/router tests and review the baseline entries. Done means typed retry metadata, normalized retry and delegation contracts, passing type checks, and coverage for bounded and unbounded retries, exception metadata, and fallback delegation.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
ai, backend-api-design, testing
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.