Skip to content

Implement agent hooks (prepare/filter/retry) #13

@endymion

Description

@endymion

Problem

The spec describes agent lifecycle hooks (prepare, filter, response retry config), but they are not implemented.

Why it matters

  • Users need per-agent customization (pre-turn context, token budgeting, retry behavior) without forking core code.

Where this shows up

  • TECHNICAL_DEBT.md → “Agent Hooks” (Category 3).

Proposed fix

  • Implement agent config fields:
    • prepare: callable run before each turn; output becomes {prepared.*} (when/if that namespace is implemented)
    • filter: token budget / message filtering policy
    • response: retry policy (retries, retry_delay, etc.)
  • If {prepared.*} is not implemented yet, define a minimal path (e.g., only allow prepare to mutate session/context).

Acceptance criteria

  • Hooks are parsed, validated, and executed according to spec (or spec is updated to match final design).
  • Tests cover hook execution order and retry behavior.

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