Repository navigation
Bind packages.invoke in standalone scheduled jobs - #1583
Conversation
Standalone jobs that wrap packages.invoke failed because the helper was only bound for package-owned jobs. Use the same execute-style invoke tools that inline workflows already use when there is no package context. Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (7)
Included review availability: Your plan provides up to 2 included reviews per hour; 1 remains after this review. 📝 WalkthroughWalkthroughStandalone scheduled jobs now receive package invocation tools. Worker execution selects tools by package context, tests verify the selection, and documentation describes standalone-job support for ChangesStandalone package invocation
Estimated code review effort: 2 (Simple) | ~15 minutes Merge Risk: ⚪ Minimal · up to This PR enables standalone scheduled jobs to use packages.invoke through the existing execute path and adds targeted coverage and documentation updates. No actionable merge-blocking risk remains beyond normal checks and review. Sequence Diagram(s)sequenceDiagram
participant StandaloneScheduledJob
participant executePublishedJobArtifact
participant executeInvokeToolFactory
participant PackageRuntime
StandaloneScheduledJob->>executePublishedJobArtifact: execute published artifact
executePublishedJobArtifact->>executeInvokeToolFactory: create execute-time invocation tools
executePublishedJobArtifact->>StandaloneScheduledJob: provide invocation tools
StandaloneScheduledJob->>PackageRuntime: invoke saved package
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 2📝 Generate docstrings 💡
🛠️ Fix failing CI checks 💡
🧪 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-1583.kody-a99.workers.dev Worker: Mocks:
|
Static CI failed oxfmt --check on the three files this PR already edited. Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>
Intent
Standalone scheduled jobs that wrap
packages.invoketo enter another package's runtime should work the same way authenticatedexecuteand inline workflows already do.Summary
Nightly forecast thermostat rangesfailed withCannot read properties of null (reading 'invoke')because standalone jobs left the optionalkody:runtimepackageshelper unbound.packagesviacreatePackageRuntimeInvokeTools. Standalone jobs now bindcreateExecutePackageInvokeTools, matching inline workflows that have no package context.packages.invokecontext.Testing
npx vitest run --project node-unit packages/worker/src/jobs/service.node.test.ts— 19/19 passed, including the extended standalone (createExecutePackageInvokeTools) and package-owned (createPackageRuntimeInvokeTools) assertions.kody-pr-1583on merge commit ofc093e6e9: seed login succeeded;GET /account/jobs.jsonreturnedjobs: []with alarmidle;GET /account/activity.jsonreturned zero open errors. UI pass: Jobs empty state and Activity 7-day empty errors view both loaded. The account JSON API cannot create standalone jobs or packages, so the invoke-binding path is covered by the node-unit spies plus the production fingerprint.job:Nightly forecast thermostat ranges:cannot-read-properties-of-nullon run9730cc5e-2d59-4094-b007-d251ca26d290.Preview: https://kody-pr-1583.kody-a99.workers.dev
System changes
System recap — extends existing primitives (medium risk)
Mode: recap · Base:
main@67f3d425· Head:c093e6e9Classification: extends — standalone job execution now binds
packages.invokeusing the existing execute invoke path.Primitives touched
jobspackages.invokemcp-serverpackagesnext-steps copy names scheduled jobsChange flow
A standalone job that calls
packages.invokenow receives the same execute-style helper inline workflows already bind.Before / after
Summary by CodeRabbit
New Features
Documentation
Tests