Skip to content

Rename agent event sources to webhook sources#4574

Open
KyleAMathews wants to merge 3 commits into
mainfrom
webhook-sources-rename
Open

Rename agent event sources to webhook sources#4574
KyleAMathews wants to merge 3 commits into
mainfrom
webhook-sources-rename

Conversation

@KyleAMathews

Copy link
Copy Markdown
Contributor

Renames the agent-facing “event source” API to “webhook source” across runtime, server routes, tools, types, tests, and Horton prompts. This is a breaking terminology/API cleanup: agents now discover, subscribe to, wake from, and manage webhook sources via *_webhook_source* names and /webhook-source-subscriptions routes.

Root Cause

“Event source” was too generic for the feature being exposed: these subscriptions are specifically for external webhook ingress streams. Keeping the generic name made APIs, manifests, tool names, and downstream integration points harder to reason about.

Approach

  • Rename the public runtime/server surface from EventSource* to WebhookSource*.
  • Rename agent tools:
    • list_event_sourceslist_webhook_sources
    • subscribe_event_sourcesubscribe_webhook_source
    • list_event_source_subscriptionslist_webhook_source_subscriptions
    • unsubscribe_event_sourceunsubscribe_webhook_source
  • Rename persisted subscription metadata:
    • event-source:<id>webhook-source:<id>
    • config.eventSourceconfig.webhookSource
    • event_source_wakewebhook_source_wake
    • sourceKeywebhookKey
  • Rename server routes:
    • /event-source-subscriptions/:id/webhook-source-subscriptions/:id
    • /_electric/event-sources/_electric/webhook-sources
  • Update Horton’s system prompt/tool detection to describe webhook-source tools.
  • Update tests and fixtures to use the new terminology.
  • Add a Stratovolt follow-up doc describing the companion changes needed downstream.

Key Invariants

  • Webhook source subscriptions still resolve to the same underlying webhook event streams.
  • Wake hydration still only applies to webhook-event wake changes and matching source manifests.
  • Subscription IDs remain deterministic from webhook key, bucket, params, and filter.
  • Only active, agent-visible webhook source contracts may be subscribed to.
  • This PR intentionally does not provide compatibility aliases for old event-source names, routes, or manifest keys.

Non-goals

  • No backwards-compatible event_source aliases.
  • No migration of existing persisted dynamic event-source:<id> manifests.
  • No Stratovolt/cloud changes in this repo; those are documented for a companion PR.
  • No server-side filter implementation changes beyond preserving the existing advisory filter behavior.

Trade-offs

This is a breaking rename rather than an additive compatibility layer. That keeps the runtime/server API smaller and avoids supporting duplicate names long-term, but requires downstream consumers to update in lockstep.

Verification

Completed:

GITHUB_BASE_REF=main node scripts/check-changeset.mjs
# ✅ Changesets cover all affected packages: @electric-ax/agents-runtime, @electric-ax/agents-server, @electric-ax/agents
git diff --check
# passes

Attempted targeted runtime tests:

pnpm --filter @electric-ax/agents-runtime test webhook-sources.test.ts webhook-source-tools.test.ts --run

This failed before collecting tests because the fresh worktree did not have all dependencies installed:

Error: Failed to load url pino ...
Error: Failed to load url cron-parser ...

Suggested follow-up checks after dependencies are installed:

pnpm install
pnpm --filter @electric-ax/agents-runtime test webhook-sources.test.ts webhook-source-tools.test.ts --run
pnpm --filter @electric-ax/agents-server test webhook-source-subscriptions-route.test.ts --run
pnpm --filter @electric-ax/agents test horton-system-prompt.test.ts horton-tool-composition.test.ts --run

Also verify downstream Stratovolt/cloud updates against docs/stratovolt-webhook-source-rename-followup.md before consuming the renamed APIs.

Files changed

  • .changeset/rename-webhook-sources.md — changeset for affected agents packages.
  • packages/agents-runtime/src/webhook-sources.ts — renamed webhook-source subscription/wake helpers and types.
  • packages/agents-runtime/src/tools/webhook-sources.ts — renamed agent tools and manifest parsing to webhook-source terminology.
  • packages/agents-runtime/src/index.ts, types.ts, context/runtime/client files — exported and wired new WebhookSource* names.
  • packages/agents-server/src/routing/*, src/index.ts, src/server.ts, src/entity-manager.ts — renamed tenant context, catalog APIs, and subscription routes.
  • packages/agents/src/agents/horton.ts, bootstrap/tests — updated prompt text and tool detection.
  • Runtime/server/agent tests — renamed event-source tests and assertions to webhook-source equivalents.
  • docs/stratovolt-webhook-source-rename-followup.md — documents required downstream Stratovolt changes.
  • Changelogs — note the webhook-source breaking rename.

@github-actions

github-actions Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Electric Agents Desktop Builds

Build artifacts for commit 318c794.

Platform Status Artifact
macOS Apple Silicon Passed DMG
macOS Intel Passed DMG
Windows x64 Building Installer
Linux x64 Passed AppImage / deb

Workflow run

@codecov

codecov Bot commented Jun 11, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 88.46154% with 21 lines in your changes missing coverage. Please review.
✅ Project coverage is 56.72%. Comparing base (baee54e) to head (318c794).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
packages/agents-runtime/src/process-wake.ts 45.45% 6 Missing ⚠️
...ckages/agents-runtime/src/tools/webhook-sources.ts 93.50% 5 Missing ⚠️
packages/agents-runtime/src/webhook-sources.ts 90.00% 5 Missing ⚠️
...ckages/agents-runtime/src/runtime-server-client.ts 84.21% 3 Missing ⚠️
...kages/agents-server/src/routing/entities-router.ts 87.50% 1 Missing ⚠️
packages/agents-server/src/server.ts 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4574      +/-   ##
==========================================
- Coverage   57.31%   56.72%   -0.60%     
==========================================
  Files         347      327      -20     
  Lines       39124    37951    -1173     
  Branches    11189    10944     -245     
==========================================
- Hits        22425    21527     -898     
+ Misses      16661    16388     -273     
+ Partials       38       36       -2     
Flag Coverage Δ
packages/agents 71.37% <100.00%> (ø)
packages/agents-mcp ?
packages/agents-mobile 75.49% <ø> (ø)
packages/agents-runtime 82.56% <88.27%> (+0.08%) ⬆️
packages/agents-server 74.86% <87.50%> (ø)
packages/agents-server-ui 6.25% <ø> (ø)
packages/electric-ax 46.42% <ø> (ø)
typescript 56.72% <88.46%> (-0.60%) ⬇️
unit-tests 56.72% <88.46%> (-0.60%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions

github-actions Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Electric Agents Mobile Build

Local mobile checks ran for commit 318c794.

The EAS Android preview build was skipped because the mobile-eas-build label is not present.
Add the mobile-eas-build label to this PR to produce an installable preview build.

Workflow run

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