Skip to content

Commit 7149fd2

Browse files
committed
don't log when state updates on the server
1 parent dae7e07 commit 7149fd2

File tree

2 files changed

+6
-11
lines changed

2 files changed

+6
-11
lines changed

.changeset/red-streets-count.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"agents-sdk": patch
3+
---
4+
5+
don't log when state updates on the server

packages/agents/src/index.ts

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -173,20 +173,10 @@ export class Agent<Env, State = unknown> extends Server<Env> {
173173
this.#setStateInternal(state, "server");
174174
}
175175

176-
#warnedToImplementOnStateUpdate = false;
177176
onStateUpdate(state: State | undefined, source: Connection | "server") {
178-
if (!this.#warnedToImplementOnStateUpdate) {
179-
console.log(
180-
"state updated, implement onStateUpdate in your agent to handle this change"
181-
);
182-
this.#warnedToImplementOnStateUpdate = true;
183-
}
177+
// override this to handle state updates
184178
}
185179

186-
// onMessage(connection: Connection, message: WSMessage) {}
187-
188-
// onConnect(connection: Connection, ctx: ConnectionContext) {}
189-
190180
onEmail(email: ForwardableEmailMessage) {
191181
throw new Error("Not implemented");
192182
}

0 commit comments

Comments
 (0)