Repository navigation
fix(sdk): expose camelCase types for agent exit and node status #505
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: fix/sdk-on-before-connect-492
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -43,9 +43,12 @@ import type { | |
| DmReceivedEvent, | ||
| GroupDmReceivedEvent, | ||
| RelaycastMessageEvent, | ||
| AgentExitedEvent, | ||
| AgentStatusActiveEvent, | ||
| AgentStatusChangedEvent, | ||
| AgentStatusOfflineEvent, | ||
| NodeStatusOnlineEvent, | ||
| NodeStatusOfflineEvent, | ||
| ChannelCreatedEvent, | ||
| ChannelUpdatedEvent, | ||
| ChannelArchivedEvent, | ||
|
|
@@ -448,6 +451,9 @@ export class AgentClient { | |
| agentStatusChanged: (handler: (e: AgentStatusChangedEvent) => void): (() => void) => this.onEvent('agent.status.changed', handler), | ||
| agentActive: (handler: (e: AgentStatusActiveEvent) => void): (() => void) => this.onEvent('agent.status.active', handler), | ||
| agentOffline: (handler: (e: AgentStatusOfflineEvent) => void): (() => void) => this.onEvent('agent.status.offline', handler), | ||
| agentExited: (handler: (e: AgentExitedEvent) => void): (() => void) => this.onEvent('agent.exited', handler), | ||
| nodeOnline: (handler: (e: NodeStatusOnlineEvent) => void): (() => void) => this.onEvent('node.status.online', handler), | ||
| nodeOffline: (handler: (e: NodeStatusOfflineEvent) => void): (() => void) => this.onEvent('node.status.offline', handler), | ||
|
Comment on lines
+455
to
+456
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟡 Agent node-status handlers never fire
Learn moreNode-status transitions are workspace-wide events. Example: A node times out and the engine emits Recommended fix: Remove Was this helpful? React with 👍 or 👎 to provide feedback. |
||
| channelCreated: (handler: (e: ChannelCreatedEvent) => void): (() => void) => this.onEvent('channel.created', handler), | ||
| channelUpdated: (handler: (e: ChannelUpdatedEvent) => void): (() => void) => this.onEvent('channel.updated', handler), | ||
| channelArchived: (handler: (e: ChannelArchivedEvent) => void): (() => void) => this.onEvent('channel.archived', handler), | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When consumers register these callbacks on
AgentClient, they can never fire in production:AgentClientconnects exclusively through/v1/node/ws, while the canonical engine'semitNodeStatusEffectssendsnode.status.onlineandnode.status.offlineonly to the workspace stream and webhook outbox, with no node/agent audience. The new test bypasses that routing by injecting a synthetic node frame directly. Either route these events to the direct-node client or expose these handlers only onRelayCast; otherwise the advertisedagent.on.nodeOnline/nodeOfflineAPI silently does nothing.AGENTS.md reference: AGENTS.md:L10-L12
Useful? React with 👍 / 👎.