Skip to content

test(codemode): the Workers AI e2e tools state their result shape - #3501

Closed
mattzcarey wants to merge 1 commit into
mainfrom
slim/nightly-codemode-output-types
Closed

mattzcarey wants to merge 1 commit into
mainfrom
slim/nightly-codemode-output-types

Conversation

@mattzcarey

Copy link
Copy Markdown
Member

The nightly's "Workers AI: codemode Playwright" job is red on llm-codemode.spec.ts "LLM combines tools from both namespaces", and the failure prints nothing.

The suite's arithmetic tools had no outputSchema, so the types the model writes against said AddNumbersOutput = unknown. The model passed the result of addNumbers ({ result: 15 }) to multiply as if it were a number and got a tool error. It then spent steps finding the shape. In about 3 of 8 runs it used all five steps on tool calls and the reply had no text. The assertion's message is the reply, so the failure was empty too.

  • addNumbers, multiply and divide now declare outputSchema: { result: number }, so the generated types say so.
  • An empty reply now fails with "(the reply has no text)".

Measured against Workers AI locally: 12 of 12 replies answered after the change, against 5 of 8 before. The LLM suite passes 8/8 and the mock suite 21/21.

Tests only, no changeset.

…ult's shape, so the model doesn't spend its five steps guessing it; an empty reply says so
@mattzcarey

Copy link
Copy Markdown
Member Author

Replaced by #3503, which carries this change with the rest of its unit, integrated and tested together.

@mattzcarey mattzcarey closed this Nov 28, 2026
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.

1 participant