Skip to content

Comments

Fix codemode tool prompt and README to request JavaScript#961

Open
mattzcarey wants to merge 1 commit intomainfrom
fix/codemode-javascript-not-typescript
Open

Fix codemode tool prompt and README to request JavaScript#961
mattzcarey wants to merge 1 commit intomainfrom
fix/codemode-javascript-not-typescript

Conversation

@mattzcarey
Copy link
Contributor

@mattzcarey mattzcarey commented Feb 20, 2026

Summary

  • Updated the default tool description (DEFAULT_DESCRIPTION) to explicitly tell the LLM to write JavaScript and avoid TypeScript syntax (type annotations, interfaces, generics)
  • Updated README intro to say "executable JavaScript" instead of "executable code" / "TypeScript APIs"
  • Clarified that TypeScript type definitions are generated for LLM context, but execution is JavaScript

The DynamicWorkerExecutor only accepts JavaScript — models that emit TypeScript syntax hit SyntaxError: Unexpected token ':' at runtime.

Closes #959

Test plan

  • Verify LLMs no longer emit TypeScript annotations when using the codemode tool
  • Confirm generated code still executes correctly in the Dynamic Worker sandbox

@changeset-bot
Copy link

changeset-bot bot commented Feb 20, 2026

🦋 Changeset detected

Latest commit: fa78c08

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@cloudflare/codemode Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@pkg-pr-new
Copy link

pkg-pr-new bot commented Feb 20, 2026

Open in StackBlitz

npm i https://pkg.pr.new/cloudflare/agents@961
npm i https://pkg.pr.new/cloudflare/agents/@cloudflare/ai-chat@961
npm i https://pkg.pr.new/cloudflare/agents/@cloudflare/codemode@961
npm i https://pkg.pr.new/cloudflare/agents/hono-agents@961

commit: fa78c08

@mattzcarey mattzcarey force-pushed the fix/codemode-javascript-not-typescript branch from 40614b3 to fa78c08 Compare February 20, 2026 23:31
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.

Codemode documented as supporting Typescript, does not seem to

1 participant