You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Agent class defined alarm as a public readonly arrow function property, which completely shadowed PartyServer's alarm() prototype method. This meant #ensureInitialized() was never called when a Durable Object woke via alarm (e.g. from scheduleEvery), causing this.name to throw and onStart to never run.
Converted alarm from an arrow function property to a regular async method that calls super.alarm() before processing scheduled tasks. Also added an onAlarm() no-op override to suppress PartyServer's default warning log.
scheduleEvery() now deduplicates by the combination of callback name, interval, and payload: calling it multiple times with the same arguments returns the existing schedule instead of creating a duplicate. A different interval or payload creates a separate, independent schedule.
This fixes the common pattern of calling scheduleEvery() inside onStart(), which runs on every Durable Object wake. Previously each wake created a new interval schedule, leading to a thundering herd of duplicate executions.
agents@0.7.1
Patch Changes
#10462cde136 Thanks @threepointone! - Add agent and name fields to observability events, identifying which agent class and instance emitted each event.
New events: disconnect (WebSocket close), email:receive, email:reply, queue:create, and a new agents:email channel.
Make _emit protected so subclasses can use it. Update AIChatAgent to use _emit so message/tool events carry agent identity.
BaseEvent: Removed id and displayMessage fields. Events now contain only type, payload, and timestamp. The payload type is now strict — accessing undeclared fields is a type error. Narrow on event.type before accessing payload properties.
Observability.emit(): Removed the optional ctx second parameter.
AgentObservabilityEvent: Split combined union types so each event has its own discriminant (enables proper Extract-based type narrowing). Added new error event types.
If you have a custom Observability implementation, update your emit signature to emit(event: ObservabilityEvent): void.
diagnostics_channel replaces console.log
The default genericObservability implementation no longer logs every event to the console. Instead, events are published to named diagnostics channels using the Node.js diagnostics_channel API. Publishing to a channel with no subscribers is a no-op, eliminating logspam.
The Agent class defined alarm as a public readonly arrow function property, which completely shadowed PartyServer's alarm() prototype method. This meant #ensureInitialized() was never called when a Durable Object woke via alarm (e.g. from scheduleEvery), causing this.name to throw and onStart to never run.
Converted alarm from an arrow function property to a regular async method that calls super.alarm() before processing scheduled tasks. Also added an onAlarm() no-op override to suppress PartyServer's default warning log.
scheduleEvery() now deduplicates by the combination of callback name, interval, and payload: calling it multiple times with the same arguments returns the existing schedule instead of creating a duplicate. A different interval or payload creates a separate, independent schedule.
This fixes the common pattern of calling scheduleEvery() inside onStart(), which runs on every Durable Object wake. Previously each wake created a new interval schedule, leading to a thundering herd of duplicate executions.
0.7.1
Patch Changes
#10462cde136 Thanks @threepointone! - Add agent and name fields to observability events, identifying which agent class and instance emitted each event.
New events: disconnect (WebSocket close), email:receive, email:reply, queue:create, and a new agents:email channel.
Make _emit protected so subclasses can use it. Update AIChatAgent to use _emit so message/tool events carry agent identity.
BaseEvent: Removed id and displayMessage fields. Events now contain only type, payload, and timestamp. The payload type is now strict — accessing undeclared fields is a type error. Narrow on event.type before accessing payload properties.
Observability.emit(): Removed the optional ctx second parameter.
AgentObservabilityEvent: Split combined union types so each event has its own discriminant (enables proper Extract-based type narrowing). Added new error event types.
If you have a custom Observability implementation, update your emit signature to emit(event: ObservabilityEvent): void.
diagnostics_channel replaces console.log
The default genericObservability implementation no longer logs every event to the console. Instead, events are published to named diagnostics channels using the Node.js diagnostics_channel API. Publishing to a channel with no subscribers is a no-op, eliminating logspam.
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
@dependabot rebase will rebase this PR
@dependabot recreate will recreate this PR, overwriting any edits that have been made to it
@dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
@dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
@dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
@dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bumps agents from 0.6.0 to 0.7.2.
Release notes
Sourced from agents's releases.
... (truncated)
Changelog
Sourced from agents's changelog.
... (truncated)
Commits
03fada6Version Packages (#1051)f1e2bfaMake scheduleEvery() idempotent (#1052)6157741Fix alarm() to call super for init (#1050)477d338Version Packages (#1047)2cde136Observability: include agent identity & events (#1046)64d9ad6Version Packages (#995)766f20bdocs: update ai-chat docs for post-0.6.0 changes (#1040)00d5a31Reduce test noise: mock MCP connections and add ai-chat DO cleanup (#1037)ec9a4b7Reduce Durable Object test noise (#1036)24cf279fix: cleaner tests, better error handling, and protocol improvements (#1035)Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting
@dependabot rebase.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
@dependabot rebasewill rebase this PR@dependabot recreatewill recreate this PR, overwriting any edits that have been made to it@dependabot show <dependency name> ignore conditionswill show all of the ignore conditions of the specified dependency@dependabot ignore this major versionwill close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this minor versionwill close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this dependencywill close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)