Skip to content

feat(codemode): make model configurable instead of hardcoded gpt-4.1#28112

Closed
agents-git-bot[bot] wants to merge 3 commits intoproductionfrom
sync-docs-pr-849
Closed

feat(codemode): make model configurable instead of hardcoded gpt-4.1#28112
agents-git-bot[bot] wants to merge 3 commits intoproductionfrom
sync-docs-pr-849

Conversation

@agents-git-bot
Copy link
Contributor

@agents-git-bot agents-git-bot bot commented Feb 5, 2026

Summary

Syncs documentation for cloudflare/agents#849

  • Documents the new optional model parameter in experimental_codemode
  • Updates usage examples to show model configuration
  • Adds complete API reference section for the function signature
  • Model defaults to openai("gpt-4.1") when not specified

Changes

Updated Documentation

File: public/.well-known/skills/agents-sdk/references/codemode.md

  1. API Reference Section: Added comprehensive documentation for the experimental_codemode() function including all parameters and return types, clearly marking model as optional

  2. Updated Usage Example: Modified the code example to include:

    • Optional model parameter in the codemode() call with inline specification
    • Comment indicating the parameter is optional and its default value
    • Consistent model usage in both codemode() and streamText()
  3. Model Configuration Guide: Added a dedicated section showing:

    • How to specify different models (OpenAI, Anthropic, etc.)
    • Example of omitting the parameter to use the default
    • Multiple model provider examples

Implementation Details

The model parameter is optional in experimental_codemode(). When not provided, it defaults to openai("gpt-4.1"). This allows users to:

  • Choose their preferred AI model
  • Use any AI SDK-compatible model provider
  • Continue using the default without code changes

Related Links


Generated by automated docs sync from cloudflare/agents

Synced from cloudflare/agents#849

- Add required `model` parameter to `experimental_codemode` API
- Update usage example to show model configuration
- Add API reference section with complete parameter documentation
- Add migration guide for breaking change from v0.0.6
- Users can now use any AI SDK-compatible model instead of hardcoded gpt-4.1

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@agents-git-bot agents-git-bot bot requested a review from a team as a code owner February 5, 2026 19:41
@github-actions github-actions bot added the size/s label Feb 5, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Feb 5, 2026

This pull request requires reviews from CODEOWNERS as it changes files that match the following patterns:

Pattern Owners
* @cloudflare/pcx-technical-writing

@github-actions
Copy link
Contributor

github-actions bot commented Feb 5, 2026

@elithrar
Copy link
Collaborator

elithrar commented Feb 5, 2026

/bonk review this PR. replace gpt-4o (which is about to be deprecated) with gpt-5.2. review code to make sure it is valid and uses <TypeScriptExample> where relevant.

Co-authored-by: elithrar <elithrar@users.noreply.github.com>
@ask-bonk
Copy link
Contributor

ask-bonk bot commented Feb 5, 2026

Good — all 4 gpt-4o references are now gpt-5.2. The gpt-4.1 reference on line 273 is correct as-is since it refers to the historically hardcoded model in the old version.

Summary of changes made

Replaced all 4 instances of gpt-4o with gpt-5.2 in public/.well-known/skills/agents-sdk/references/codemode.md:

  • Line 92: model initialization in main example
  • Line 157: API reference parameter description
  • Line 179: API reference inline example
  • Line 263: migration guide "After" example

<TypeScriptExample> verdict

Not applicable. This is a .md skills file, not an .mdx docs page. All sibling skills files use standard fenced code blocks, which is correct.

github run

The model parameter is optional, not required. Updated documentation to:
- Mark model parameter as optional with default value openai("gpt-4.1")
- Remove unused model variable declaration
- Update all code examples to show inline model specification
- Replace "Migration" section with "Model Configuration" showing optional usage
- Add examples for multiple model providers (OpenAI, Anthropic)
- Show that model can be omitted to use default

This aligns the documentation with the actual implementation in
cloudflare/agents PR #849 where model was made optional.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@elithrar
Copy link
Collaborator

elithrar commented Feb 6, 2026

Closing as this is auto-generated and not the source of truth: https://github.com/cloudflare/skills/

@elithrar elithrar closed this Feb 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant