Skip to content

fix(codemode): extend default dynamic worker timeout#1806

Merged
threepointone merged 1 commit into
cloudflare:mainfrom
mattzcarey:fix/update-default-execution-time-60-seconds
Jun 24, 2026
Merged

fix(codemode): extend default dynamic worker timeout#1806
threepointone merged 1 commit into
cloudflare:mainfrom
mattzcarey:fix/update-default-execution-time-60-seconds

Conversation

@mattzcarey

@mattzcarey mattzcarey commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Summary

  • increase the default DynamicWorkerExecutor timeout from 30 seconds to 60 seconds
  • update codemode docs/README default timeout references
  • add a patch changeset for @cloudflare/codemode

Verification

  • pnpm exec nx run @cloudflare/codemode:build
  • pnpm exec oxfmt --check packages/codemode/src/executor.ts packages/codemode/README.md docs/codemode.md .changeset/tender-owls-execute-longer.md
  • pnpm exec oxlint packages/codemode/src/executor.ts
  • deployed a throwaway production Worker using this branch's local @cloudflare/codemode build and verified DynamicWorkerExecutor worked fine through the 60-second default window:
    • curl /sleep?ms=59000
    • response: ok=true, wallTimeMs=59009, result.sleptMs=59000

Note: no example changes are included in this PR; the deployment smoke check used a separate throwaway Worker, which has since been deleted.

@changeset-bot

changeset-bot Bot commented Jun 24, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 6df7796

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

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Open in Devin Review

@pkg-pr-new

pkg-pr-new Bot commented Jun 24, 2026

Copy link
Copy Markdown

Open in StackBlitz

agents

npm i https://pkg.pr.new/agents@1806

@cloudflare/ai-chat

npm i https://pkg.pr.new/@cloudflare/ai-chat@1806

@cloudflare/codemode

npm i https://pkg.pr.new/@cloudflare/codemode@1806

create-think

npm i https://pkg.pr.new/create-think@1806

hono-agents

npm i https://pkg.pr.new/hono-agents@1806

@cloudflare/shell

npm i https://pkg.pr.new/@cloudflare/shell@1806

@cloudflare/think

npm i https://pkg.pr.new/@cloudflare/think@1806

@cloudflare/voice

npm i https://pkg.pr.new/@cloudflare/voice@1806

@cloudflare/worker-bundler

npm i https://pkg.pr.new/@cloudflare/worker-bundler@1806

commit: 6df7796

@threepointone threepointone merged commit 43f663d into cloudflare:main Jun 24, 2026
5 checks passed
@mattzcarey mattzcarey deleted the fix/update-default-execution-time-60-seconds branch June 24, 2026 16:05
@github-actions github-actions Bot mentioned this pull request Jun 24, 2026
mattzcarey pushed a commit that referenced this pull request Jun 24, 2026
The request() callback runs while the sandbox is suspended on its codemode.request() RPC, so the DynamicWorkerExecutor timeout bounds the human-in-the-loop elicitation wait. The default executor timeout (60s, #1806) already matches the elicitation timeout; document that lowering it below the elicitation timeout aborts the call before the user can respond.
mattzcarey pushed a commit that referenced this pull request Jun 25, 2026
The request() callback runs while the sandbox is suspended on its codemode.request() RPC, so the DynamicWorkerExecutor timeout bounds the human-in-the-loop elicitation wait. The default executor timeout (60s, #1806) already matches the elicitation timeout; document that lowering it below the elicitation timeout aborts the call before the user can respond.
mattzcarey added a commit that referenced this pull request Jun 25, 2026
* fix(codemode): preserve MCP request context

* test(mcp): cover codemode request context over real McpAgent transport

Adds a TestCodemodeMcpAgent that registers openApiMcpServer and elicits via McpAgent.elicitInput with the forwarded relatedRequestId. The test drives a real Streamable HTTP POST with no standalone GET stream through the Worker Loader executor RPC boundary, asserts the elicitation rides the originating POST and the tool result follows it, and checks the keepAlive lease is held during the nested wait and released afterward.

* docs(codemode): note executor timeout must cover elicitation wait

The request() callback runs while the sandbox is suspended on its codemode.request() RPC, so the DynamicWorkerExecutor timeout bounds the human-in-the-loop elicitation wait. The default executor timeout (60s, #1806) already matches the elicitation timeout; document that lowering it below the elicitation timeout aborts the call before the user can respond.
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.

2 participants