feat(cron): add context_from field for cron job output chaining#14190
Closed
MorAlekss wants to merge 3 commits into
Closed
feat(cron): add context_from field for cron job output chaining#14190MorAlekss wants to merge 3 commits into
MorAlekss wants to merge 3 commits into
Conversation
cd24980 to
51e2638
Compare
Contributor
Author
|
Updated: silent skip instead of placeholder when referenced job has no output. Avoids spurious context in the LLM prompt. |
Contributor
|
Merged via #15606 (rebase-merge) with your 3 feature commits preserving your authorship in git log. One follow-up commit from me wired the missing update-path support (schema promised 'pass an empty array to clear' but the update branch didn't read the kwarg) — now add/change/clear all work end-to-end. Thanks for the solid groundwork on this one: Option B semantics, path-traversal guard, 8K truncation, graceful no-output behavior, and 15 tests were all sound as written. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #5439
Summary
Adds native cron job output chaining via
context_fromfield. When set, the most recent output of the referenced job(s) is automatically injected into the prompt before each run, enabling job A to collect data and job B to process it without manual file wiring.Files changed
cron/jobs.py— addedcontext_fromparameter tocreate_job(), with normalization to a listcron/scheduler.py— output injection in_build_job_prompt()tools/cronjob_tools.py— schema, validation, handler wiringtests/cron/test_cron_context_from.py— 14 new testsImplementation
Issue #5439 Option C proposed a new
~/.hermes/cron/shared/directory with named files. Instead, the implementation reads from the existing~/.hermes/cron/output/{job_id}/store thatsave_job_output()already writes atomically.This avoids introducing a new filesystem surface while delivering stronger guarantees:
temp → fsync → os.replace())latestsemantics viamtimesortingSafety:
OSError(coversPermissionErrorandFileNotFoundError)Usage:
Tests
context_fromstored as list when passed as stringcontext_fromstored when passed as listNonewhen not providedNoneNonemtimeFileNotFoundErrorhandled gracefullyPermissionErrorhandled gracefullyTested on
macOS, Linux, Python 3.11, Hermes v0.11.0