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
Copy file name to clipboardExpand all lines: src/content/changelog/agents/2025-07-21-agents-queue-email-context-update.mdx
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,7 @@ The latest releases of [@cloudflare/agents] (https://github.com/cloudflare/agent
12
12
13
13
### Lightweight .queue for fast task deferral
14
14
15
-
You can use .queue() to enqueue background work — ideal for tasks like processing user messages, sending notifications etc.
15
+
You can use `.queue()` to enqueue background work — ideal for tasks like processing user messages, sending notifications etc.
16
16
17
17
```ts
18
18
classMyAgentextendsAgent {
@@ -30,9 +30,9 @@ class MyAgent extends Agent {
30
30
31
31
Want to try it yourself? Just define a method like processMessage in your agent, and you’re ready to scale.
32
32
33
-
### New email adaptor
33
+
### New email adapter
34
34
35
-
Want to build an AI agent that can receive and respond to emails automatically? With the new email adaptor and onEmail lifecycle method, now you can.
35
+
Want to build an AI agent that can receive and respond to emails automatically? With the new email adapter and onEmail lifecycle method, now you can.
36
36
37
37
```ts
38
38
exportclassEmailAgentextendsAgent {
@@ -67,11 +67,11 @@ You can find a full example [here](https://github.com/cloudflare/agents/tree/mai
67
67
68
68
### Automatic context wrapping for custom methods
69
69
70
-
Custom methods are now automatically wrapped with the agent's context, so calling `getCurrentAgent()` should work regardless of where in an agent's lifecycle it's called. Previously this would not work on RPC calls, but not just works out of the box.
70
+
Custom methods are now automatically wrapped with the agent's context, so calling `getCurrentAgent()` should work regardless of where in an agent's lifecycle it's called. Previously this would not work on RPC calls, but now just works out of the box.
71
71
72
72
```ts
73
73
exportclassMyAgentextendsAgent {
74
-
async suggestReply(ctx, { message }) {
74
+
async suggestReply(message) {
75
75
// getCurrentAgent() now correctly works, even when called inside an RPC method
0 commit comments