Skip to content

executeCode can drop module return values #209

Description

@fancydirty

What happened

During a live Cloudflare OS session, several executeCode steps completed with no visible output.
That symptom can have more than one cause; this issue does not claim that every blank tool step has
the same cause.

One independently reproducible case is a code-mode module that returns a value without calling
console.log(). The dynamic Worker harness awaits the module but does not return its value, while
executeCodeMode() formats only the console trace. The invocation therefore completes with blank
output.

Minimal reproduction

Run a code-mode module containing only:

export default async function() {
  return { ok: true };
}

On the current code path, the invocation completes but the returned object is absent from the tool
output.

Expected behavior

The module return value reaches executeCode output alongside any console output. undefined
keeps the existing console-only behavior.

Scope correction

An earlier version of this issue also claimed that verify() and run() tail events could arrive
in one batch. I did not capture such a batch in production; a synthetic unit invocation does not
establish that the runtime emits it. That unsupported claim has been removed, and #211 has been
closed. The return-value behavior above is independent of that hypothesis and is addressed by #210.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions