-
Notifications
You must be signed in to change notification settings - Fork 1.1k
log executeCode return values #300
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: main
Are you sure you want to change the base?
Changes from 1 commit
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 |
|---|---|---|
|
|
@@ -99,7 +99,8 @@ export default class extends WorkerEntrypoint { | |
| } | ||
| } | ||
| } | ||
| await agent(self, env, this.ctx); | ||
| let result = await agent(self, env, this.ctx); | ||
| if (result !== undefined) console.log(result); | ||
|
ndisidore marked this conversation as resolved.
Outdated
Member
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. Should we prefix this with some text explaining it is the return value of the function, to disambiguate from any logs appearing before that?
Member
Author
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. Added a "Return value: " prefix in d954141 |
||
| } | ||
| } | ||
| `; | ||
|
|
||
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.
This text is weird. Why are we explaining the UI to the agent?
Did we actually have problems with agents getting confused and thinking that schedules had failed to be registered? If so, is the solution perhaps to simply emphasize that if the call doesn't throw, then the schedule has been registered?
Why does an agent care about the schedule ID at all? What can it do with this? Why are we telling it to log or return it?
Uh oh!
There was an error while loading. Please reload this page.
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.
The schedule id can be used by the agent to confirm the schedule exists via
list()Non-SOTA models would often get confused because they would call
executeCodebut to them nothing happened - it would just get a void output.The would interpret this as a fail and attempt to re-register (often many times)
This is probably less important now that it won't be a void return, but returning the schedule id may still be useful so it knows how to check if it is still enabled.
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 you experienced this, were those non-SOTA models specifically trying to return the schedule ID? If so, maybe simply the fact that we're logging now will mean that they no longer get confused, without the need for this text?
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.
Another thing we could do is: If the executeCode logs nothing, we could write "(function succeeded with no output)"