Skip to content

Conversation

monoxgas
Copy link
Contributor

@monoxgas monoxgas commented Oct 3, 2025

  • Add backoff_on_error and backoff_on_ratelimit hooks for agents.
  • Add unique session_id for an agent run session (needed so we can properly track backoff)

Generated Summary:

  • Introduced session_id of type ULID to uniquely identify agent run sessions.
  • Enhanced AgentEvent to include session_id, improving traceability for events.
  • Updated multiple event dispatch calls to include the session_id, ensuring consistent session tracking.
  • Import from ulid added across relevant files to support the new identifier.
  • Adjusted the messages field in the Retry reaction class to have a default value, making it optional.
  • Changes may improve debugging and performance by providing a clear link between events and their corresponding sessions.

This summary was generated with ❤️ by rigging

@monoxgas monoxgas requested a review from Copilot October 3, 2025 23:02
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces backoff functionality for agent error handling and session tracking. The primary purpose is to add hooks that can automatically retry operations with exponential backoff when specific errors occur, particularly for rate limiting scenarios.

  • Adds session_id (ULID) to uniquely identify agent run sessions for tracking backoff state
  • Implements backoff_on_error and backoff_on_ratelimit hooks with exponential backoff logic
  • Updates all agent event dispatching to include the new session identifier

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
dreadnode/agent/reactions.py Fixed Field parameter syntax for optional messages field
dreadnode/agent/hooks/backoff.py New backoff hook implementations with exponential retry logic
dreadnode/agent/hooks/init.py Exports new backoff hooks in public API
dreadnode/agent/events.py Adds session_id field to AgentEvent base class
dreadnode/agent/agent.py Updates all event dispatching to include session_id parameter

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@monoxgas monoxgas merged commit 6b8adea into main Oct 6, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant