golem-retry-policies-scala

Configure composable retry policies for Scala Golem agents via manifest, SDK, and CLI.

1.5k|212|Updated Nov 24, 2023
One-click install
npx skills add https://github.com/golemcloud/golem --skill golem-retry-policies-scala
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: golem-retry-policies-scala
Source: https://github.com/golemcloud/golem/tree/main/golem-skills/skills/scala/golem-retry-policies-scala
Command: npx skills add https://github.com/golemcloud/golem --skill golem-retry-policies-scala

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Golem agents making HTTP requests, RPC calls, or database operations need controlled retry behavior for transient failures, and this Skill explains how to define, apply, and manage semantic retry policies in Scala agents.

Core Features & Use Cases

  • Manifest-Based Policies: Define named retry policies with priorities and predicates under retryPolicyDefaults in golem.yaml, using base policies (exponential, periodic, fibonacci, immediate, never) and combinators (countBox, timeBox, clamp, jitter, andThen, union, intersect).
  • Runtime SDK Control: Build policies fluently with Policy.exponential(...).clamp(...).withJitter(...).maxRetries(...) and apply them to scoped code blocks using withRetryPolicy.
  • Live Management: Query active policies from agent code via RetryApi or create, update, and delete policies at runtime with the golem retry-policy CLI without redeployment.
  • Use Case: Configure an HTTP 5xx retry policy that only fires on transient server errors for HTTPS endpoints, with exponential backoff clamped to a delay range and jitter to avoid thundering herds.

Quick Start

Ask the AI to define a retry policy in golem.yaml that retries transient HTTPS errors up to 5 times with exponential backoff, clamping, and jitter.

Frequently Asked Questions about golem-retry-policies-scala

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I configure retry policies in a Golem Scala agent?

Define named policies under retryPolicyDefaults in golem.yaml with a priority, predicate, and policy tree, or build them at runtime using Policy.exponential(...).clamp(...).withJitter(...).maxRetries(...) from golem.host.Retry and apply them with withRetryPolicy.

How do I retry HTTP requests on 5xx status codes in Golem?

Create a policy whose predicate explicitly references the status-code property, such as propIn with values [500, 502, 503, 504]. Status-code retries are opt-in, so catch-all policies are excluded, and the request must be idempotent with a reconstructible body.

Can I change Golem retry policies without redeploying?

Yes, use the golem retry-policy CLI commands to create, list, get, update, and delete policies at runtime. Changes take effect immediately for running agents in the current environment.

Why is my retry policy not being applied in Golem?

Policies are evaluated in descending priority order and the first matching predicate wins, so a higher-priority catch-all may shadow yours. Also, predicates referencing properties absent from the current context, like status-code in a trap context, are silently skipped.

What is the default retry policy in Golem?

When no user-defined policies exist, Golem applies a default catch-all policy named default with priority 0. It retries up to 3 times with exponential backoff at factor 3.0, delays clamped to 100ms-1s, and 15% jitter.