Skip to content

fix(rivetkit): pass agentOS cron session cwd to the vm - #5795

Open
breken-ai wants to merge 1 commit into
rivet-dev:mainfrom
breken-ai:fix/agent-os-cron-session-cwd
Open

breken-ai wants to merge 1 commit into
rivet-dev:mainfrom
breken-ai:fix/agent-os-cron-session-cwd

Conversation

@breken-ai

Copy link
Copy Markdown

Description

  • The agentOS actor's scheduleCron action takes a SerializableCronAction, where a session action carries cwd at the top level. The action object was passed to agent-os-core with a plain type cast. The core cron manager starts the session with createSession(action.agentType, action.options), so the cwd was dropped and scheduled sessions ran in the default directory.
  • listCronJobs reads the value back from action.options?.cwd, so the job listing also showed no cwd.
  • scheduleCron now converts the action into the core CronAction shape and puts cwd into options. Exec actions are passed through field by field.
  • Added cron.test.ts to check that the action reaching the VM carries options.cwd and that listCronJobs returns the same cwd.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

  • pnpm vitest run src/agent-os/actor/cron.test.ts in rivetkit-typescript/packages/rivetkit. On main the session test fails because the VM receives { type: "session", agentType, prompt, cwd } with no options. With this change both tests pass.
  • biome check is clean on the changed files. tsc --noEmit for the package reports no errors in the changed files.
  • vitest run src for the package: the only failures are the same 3 that fail on main in my local setup (inline-websocket-adapter.test.ts and runtime.test.ts fail to load, and one workflow/driver.test.ts case), so this change adds no new failures.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@the-company-company the-company-company Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

✅ No issues found

Reviewed commit 66aff55.

This branch has not been deployed

No deployments
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.

1 participant