Skip to content

Feature: Move Tome schedule configuration to new ScheduledTask ent#2072

Merged
hulto merged 7 commits intomainfrom
jules-scheduled-task-ent-12776578495355315753
Mar 14, 2026
Merged

Feature: Move Tome schedule configuration to new ScheduledTask ent#2072
hulto merged 7 commits intomainfrom
jules-scheduled-task-ent-12776578495355315753

Conversation

@hulto
Copy link
Collaborator

@hulto hulto commented Mar 14, 2026

This implements the requested feature to decouple scheduled execution and automation triggers from the Tome itself by moving them into a dedicated ScheduledTask entity.

This update enhances the accessibility of the scheduling features via GraphQL, simplifying automation management for end users. The C2 check-in logic (handleTomeAutomation) has been successfully ported over to look at ScheduledTasks, and the automated tests have been updated accordingly.


PR created automatically by Jules for task 12776578495355315753 started by @hulto

- Added `ScheduledTask` Ent schema with `run_on_new_beacon_callback`, `run_on_first_host_callback`, and `run_on_schedule` fields, linking to `Tome` and `Host` (`scheduled_hosts`).
- Removed scheduling fields and edges from `Tome`.
- Auto-generated corresponding GraphQL mutation and queries via Ent hooks.
- Updated `handleTomeAutomation` logic to iterate over `ScheduledTask`s instead of `Tome`s directly during agent check-ins.
- Refactored C2 tests to accurately use the new `ScheduledTask` relationships.

Co-authored-by: hulto <7121375+hulto@users.noreply.github.com>
@google-labs-jules
Copy link
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 14, 2026

Summary

Tests 📝 Passed ✅ Failed ❌ Skipped ⏭️ Other ❓ Flaky 🍂 Duration ⏱️
2758    ±0 2758    ±0 0    ±0 0    ±0 0    ±0 0    ±0 1ms    ±0

Previous Results

Build 🏗️ Result 🧪 Tests 📝 Passed ✅ Failed ❌ Skipped ⏭️ Other ❓ Flaky 🍂 Duration ⏱️
#1659 2758 2758 0 0 0 0 39.3s

Insights

Average Tests per Run Total Flaky Tests Total Failed Slowest Test (p95)
2758 0 0 6.2s

Slowest Tests

Test 📝 Results 📊 Duration (avg) ⏱️ Duration (p95) ⏱️
TestDockerExecutor_Build_ContextCancellation 1 6.2s 6.2s
eldritch-libsys: std::dll_inject_impl::tests::test_dll_inject_simple 1 5.2s 5.2s
TestInteractiveShell 1 5.0s 5.0s
TestOtherStreamOutput 1 5.0s 5.0s
imix::bin/imix: install::tests::test_install_execution 3 1.6s 4.7s
imix::bin/imix: install::tests::test_install_execution 3 1.6s 4.7s
imix::bin/imix: install::tests::test_install_execution 3 1.6s 4.7s
TestDockerExecutor_Build_SimpleEcho 1 3.6s 3.6s
imix::bin/imix: tests::task_tests::test_task_streaming_output 3 3.0s 3.0s
imix::bin/imix: tests::task_tests::test_task_streaming_output 3 3.0s 3.0s

🎉 No failed tests in this run. | 🍂 No flaky tests in this run.

Github Test Reporter by CTRF 💚

🔄 This comment has been updated

Copy link
Collaborator Author

@hulto hulto left a comment

Choose a reason for hiding this comment

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

@jules update with feedback

plan.md Outdated
@@ -0,0 +1,38 @@
1. **Create the `ScheduledTask` Ent schema**
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@jules delete plan.md

Copy link
Contributor

Choose a reason for hiding this comment

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

I have deleted plan.md.

- Added `ScheduledTask` Ent schema with `run_on_new_beacon_callback`, `run_on_first_host_callback`, and `run_on_schedule` fields, linking to `Tome` and `Host` (`scheduled_hosts`).
- Removed scheduling fields and edges from `Tome`.
- Auto-generated corresponding GraphQL mutation and queries via Ent hooks.
- Updated `handleTomeAutomation` logic to iterate over `ScheduledTask`s instead of `Tome`s directly during agent check-ins.
- Refactored C2 tests to accurately use the new `ScheduledTask` relationships.

Co-authored-by: hulto <7121375+hulto@users.noreply.github.com>
google-labs-jules bot and others added 4 commits March 14, 2026 13:02
Following up on PR feedback to improve efficiency, the check to match `ScheduledTask`s to `scheduled_hosts` (if specified) has been pushed down into the initial SQL query rather than fetching all potential tasks and checking the DB manually inside a loop.

Co-authored-by: hulto <7121375+hulto@users.noreply.github.com>
@hulto hulto marked this pull request as ready for review March 14, 2026 16:44
@hulto hulto merged commit 12014b2 into main Mar 14, 2026
8 checks passed
@hulto hulto deleted the jules-scheduled-task-ent-12776578495355315753 branch March 14, 2026 16:53
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