-
Notifications
You must be signed in to change notification settings - Fork 310
Description
agents/packages/agents/src/index.ts
Lines 853 to 857 in 01b919d
| // Skip if it's a private method or not a function | |
| if ( | |
| baseMethods.has(methodName) || | |
| methodName.startsWith("_") || | |
| typeof this[methodName as keyof this] !== "function" |
When methodName refers to a getter, accessing this[methodName as keyof this] will execute the getter. This can lead to several undesirable outcomes that are contrary to the presumed intent of the method discovery process.
-
Potential Side Effects**: If a getter tries to read this.state, it may throw
Uncaught Error: no such table: cf_agents_state: SQLITE_ERROR Error, before the Agent is initialized. -
Performance Overhead: Executing getters, especially those with complex logic, during an iteration over all properties can introduce unnecessary computational overhead.
may relate to: RPC error: RangeError: Maximum call stack size exceeded #430 (comment)