Skip to content

Expose model-call retry/backoff configuration through the SDK (HarnessConfig) #124

Description

@wuthomas-mit

Request

Add an optional way to configure the harness's model-call retry behavior from the SDK — e.g. a retry field on AgentConfig / LocalAgentConfig that flows into HarnessConfig and controls max attempts and backoff for model API calls.

Rationale

When driving many agent turns programmatically (batch / eval workloads), callers currently have no control over how transient model errors are handled. Per the v0.1.4 notes, model-exhaustion errors (HTTP 429) propagate up as AntigravityExecutionError once the harness's internal retries are exhausted — but there's no way to:

  • raise/lower the retry count or backoff to match a workload's latency tolerance, or
  • back off more conservatively to stay under provider rate/throughput limits when
    running many agents concurrently.

The retry logic already exists in the shipped localharness binary. Its symbols include a ModelAPIRetryConfig / ModelOutputRetryConfig (visible via strings), and it links hashicorp/retryablehttp. The only gap is that these knobs aren't plumbed through the HarnessConfig proto the Python SDK sends: localharness_pb2 exposes no retry/backoff field today, so the values are pinned to internal defaults and unreachable from Python.

This capability was first-class in Gemini CLI — configurable via maxAttempts and retryFetchErrors in settings.json, backed by an exponential-backoff retry loop. With Gemini CLI now being sunset in favor of this SDK, exposing equivalent retry configuration would close that gap and make the SDK more suitable for production use.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions