Skip to content

fix(agent): eval awaits async expressions instead of returning the pending Promise (#177) - #196

Merged
justrach merged 1 commit into
mainfrom
fix/177-eval-await-promise
Aug 1, 2026
Merged

fix(agent): eval awaits async expressions instead of returning the pending Promise (#177)#196
justrach merged 1 commit into
mainfrom
fix/177-eval-await-promise

Conversation

@justrach

@justrach justrach commented Aug 1, 2026

Copy link
Copy Markdown
Owner

Fixes #177. cmdEval sent Runtime.evaluate with returnByValue only, so an async expression returned the pending Promise and the resolved value was lost. This passes awaitPromise:true — the same flag the HTTP /evaluate route and cmdHeaders/cmdAudit already pass — so CDP resolves before serializing. 378/378 tests pass. Note: the v0.5.x release line has the identical missing flag at its own cmdEval and needs this same one-liner when the lines reunify.

…nding Promise (#177)

cmdEval sent Runtime.evaluate with returnByValue only, so an async
expression came back as the unresolved Promise object and the value was
lost. Pass awaitPromise:true — the same flag the HTTP /evaluate route
and cmdHeaders/cmdAudit already use — so CDP resolves the promise before
serializing. One-line fix; the v0.5.x line needs the same line when the
release lines reunify.
@justrach
justrach merged commit 855a8b8 into main Aug 1, 2026
3 of 4 checks passed
@justrach
justrach deleted the fix/177-eval-await-promise branch August 1, 2026 16:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

eval: async expressions lose their resolved value (promise not awaited)

1 participant