Skip to content

refactor(events): improve adapter semantics and typing#721

Closed
aXenDeveloper wants to merge 15 commits into
canaryfrom
agent/improve-events-system
Closed

refactor(events): improve adapter semantics and typing#721
aXenDeveloper wants to merge 15 commits into
canaryfrom
agent/improve-events-system

Conversation

@aXenDeveloper

Copy link
Copy Markdown
Owner

Summary

Improves the Events API introduced in #720 while keeping the existing public configuration compatible.

Changes

  • Add an explicit failed emit status for adapter publish failures instead of reporting them as delivered.
  • Add AnyEventEnvelope, a discriminated union of all registered event envelopes, so custom adapters can narrow payload types from envelope.name.
  • Rename the adapter contract to EventsAdapter.
  • Keep EventsApiPlugin as a deprecated compatibility alias to avoid breaking existing integrations.
  • Update the local adapter to use the new adapter and envelope types.

Why

The previous result status could report delivered even when the transport failed before delivering anything. The generic envelope type also lost the relationship between an event name and its payload inside adapter implementations.

Non-goals

This PR does not introduce distributed delivery, retries, persistent event storage, transaction hooks, or the outbox pattern.

Validation

The diff is intentionally limited to the event model and local adapter. Automated repository checks should validate formatting, type safety, and tests on the PR.

@vercel

vercel Bot commented Jul 22, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
vitnode-docs Canceled Canceled Jul 22, 2026 9:02pm

@github-actions github-actions Bot added the 🧱 Refactor A code change that neither fixes a bug nor adds a feature label Jul 22, 2026
@aXenDeveloper

Copy link
Copy Markdown
Owner Author

What did you do, omg 😱

@aXenDeveloper
aXenDeveloper deleted the agent/improve-events-system branch July 22, 2026 21:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🧱 Refactor A code change that neither fixes a bug nor adds a feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant