Repository navigation
Guide agents toward workflows for long-running work - #659
Conversation
Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>
Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>
Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>
Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>
Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>
Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>
Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>
Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>
…te-undefined-gettime-189c Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>
📝 WalkthroughWalkthroughDocumentation and MCP tool/capability description strings are updated to recommend using ChangesWorkflows-over-execute guidance update
Estimated code review effort: 1 (Trivial) | ~5 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
🔎 Preview deployed: https://kody-pr-659.kody-a99.workers.dev Worker: Mocks:
|
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
docs/contributing/cloudflare-agents-sdk.md (1)
189-191: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winMove the Kody runtime guidance to
docs/use.As per path instructions,
docs/use/**/*.md: End-user and MCP usage documentation belongs under docs/use/, not in the contributor guidance files.This bullet is user-facing MCP guidance, so it belongs with the workflow docs rather than in the Cloudflare Agents contributor guide.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@docs/contributing/cloudflare-agents-sdk.md` around lines 189 - 191, This Kody runtime guidance is misplaced in the contributor guide and should be moved into the end-user documentation under docs/use. Remove the bullet from the Cloudflare Agents SDK contributing doc and add the same content to the appropriate workflow/MCP usage doc that covers workflows.create and workflow_run_list, keeping user-facing guidance out of contributor-only docs.Source: Path instructions
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs/use/workflows.md`:
- Around line 48-52: Tighten the idempotency wording in the workflows docs so it
does not imply the key alone guarantees reuse; the behavior in
`workflows.create` also depends on normalized request fields such as `runAt`.
Update the sentence around `idempotencyKey` to say that reusing the same key for
the same user returns the existing workflow only when the normalized request
identity matches, and keep the quota note for the concurrent workflow limit
unchanged.
- Around line 7-10: The queueing description in the workflows docs is
attributing the handoff to the wrong API call; update the wording in the
workflow guidance to point to workflows.create as the call that queues the
workflow, and keep execute described only as the launcher/entry point. Use the
workflows.create and execute references in this section to make the distinction
explicit and accurate.
---
Nitpick comments:
In `@docs/contributing/cloudflare-agents-sdk.md`:
- Around line 189-191: This Kody runtime guidance is misplaced in the
contributor guide and should be moved into the end-user documentation under
docs/use. Remove the bullet from the Cloudflare Agents SDK contributing doc and
add the same content to the appropriate workflow/MCP usage doc that covers
workflows.create and workflow_run_list, keeping user-facing guidance out of
contributor-only docs.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 57afd457-5b8f-4697-91b5-1c3c40076711
📒 Files selected for processing (6)
docs/contributing/cloudflare-agents-sdk.mddocs/use/execute.mddocs/use/workflows.mdpackages/worker/src/mcp/capabilities/jobs/workflow-list.tspackages/worker/src/mcp/server-instructions.tspackages/worker/src/mcp/tools/execute.ts
Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>
Summary
executeMCP tool description and base MCP server instructions.workflow_run_listdiscoverability for timeout-avoidance, migrations, and background status inspection.workflows.createover chained execute calls.paramsand a follow-upworkflow_run_liststatus check.Validation
npx vitest run packages/worker/src/mcp/tools/execute.node.test.ts packages/worker/src/mcp/capabilities/jobs/job-schedule.node.test.ts packages/worker/src/package-runtime/package-workflows.node.test.ts packages/worker/src/package-runtime/package-app.node.test.ts packages/worker/src/mcp/run-kody-registry.node.test.ts✅npm run validate✅Post-deploy verification
executeMCP tool description and confirm it warns about the ~90s hard timeout and recommends oneworkflows.create({ code, params })for batch sweeps, migrations, polling loops, or >~60s work.workflow_run_list.System recap — composes existing primitives (low risk)
Mode: recap · Base:
main@d16fce76· Head:c0f5618eClassification: composes — updates guidance and capability descriptions without changing primitive behavior or data contracts.
Primitives touched
mcp-serverworkflowsjobsSystem map
Change flow
Invariants
Summary by CodeRabbit
executeversusworkflowsfor longer-running or durable tasks.executetimeouts.