Skip to content

Add budget and extension error codes, charged amount to event response#29

Merged
amavashev merged 1 commit intomainfrom
claude/verify-yaml-protocol-changes-7k4lE
Mar 24, 2026
Merged

Add budget and extension error codes, charged amount to event response#29
amavashev merged 1 commit intomainfrom
claude/verify-yaml-protocol-changes-7k4lE

Conversation

@amavashev
Copy link
Contributor

Summary

This PR extends the error handling capabilities and event response structure to support additional budget management states and provide more detailed transaction information.

Key Changes

  • New Error Codes: Added three new error codes to the ErrorCode enum:

    • BUDGET_FROZEN: Indicates a budget is frozen and cannot be used
    • BUDGET_CLOSED: Indicates a budget is closed and cannot be used
    • MAX_EXTENSIONS_EXCEEDED: Indicates the maximum number of extensions has been exceeded
  • Enhanced Event Response: Added optional charged field to EventCreateResponse interface to return the amount charged during event creation, providing clients with immediate confirmation of the transaction amount

Implementation Details

  • The new error codes follow the existing naming convention and are positioned logically within the enum (budget-related errors grouped together, extension errors near other reservation-related errors)
  • The charged field is optional (charged?: Amount) to maintain backward compatibility with existing implementations
  • These changes enable more granular error handling for budget lifecycle management and extension limits

https://claude.ai/code/session_012kUr8m7T1SXfLgXh5GKSE2

…for v0.1.24

Add BUDGET_FROZEN, BUDGET_CLOSED, MAX_EXTENSIONS_EXCEEDED to ErrorCode enum.
Add optional charged field to EventCreateResponse (present when ALLOW_IF_AVAILABLE caps actual).
@amavashev amavashev merged commit 384b9e5 into main Mar 24, 2026
3 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