Skip to main content
Use sdk.warn when something unexpected or potentially problematic occurs, but execution can continue. Warning entries render in yellow in the dashboard terminal — visible enough to catch your attention during a review, but distinct from the red of a critical error. The platform does not treat a warn entry as a run failure.

Parameters

message
string
required
A description of the warning condition.
metadata
object
Optional key-value data providing context for the warning. Include values like retry counts, rate limit headers, or degraded-mode flags so the dashboard can display them as formatted JSON.

Example

sdk.warn("Rate limit approaching", { remaining: 5, resetAt: "2024-01-01T00:00:00Z" });

When to use

Call sdk.warn for:
  • Rate limits approaching or being hit, when the agent will retry
  • Falling back to a degraded or cached data source
  • Missing optional configuration that has a default fallback
  • Unexpected but recoverable responses from external APIs
Use sdk.error instead when the condition prevents the agent from completing its task.

Dashboard rendering

sdk.warn entries render in yellow in the Dolphinclaw dashboard terminal. This colour draws attention without the urgency of a red error, making it easy to spot potential issues in a log stream without misreading them as failures.