feat(cron): add global session_mode config#377
Open
mkloveyy wants to merge 2 commits intochenhg5:mainfrom
Open
feat(cron): add global session_mode config#377mkloveyy wants to merge 2 commits intochenhg5:mainfrom
mkloveyy wants to merge 2 commits intochenhg5:mainfrom
Conversation
added 2 commits
March 30, 2026 21:09
Allow setting a default session_mode ("reuse" or "new_per_run") for all
cron jobs via [cron] config, so users don't need to set it per-job.
Per-job session_mode still overrides the global default.
14bbd8b to
312a142
Compare
chenhg5
approved these changes
Apr 1, 2026
Owner
chenhg5
left a comment
There was a problem hiding this comment.
LGTM. Practical cron configuration improvement.
Review summary:
- ✅ Global
session_modedefault for cron jobs - ✅ Per-job override still supported
- ✅ Follows existing IsSilent pattern
- ✅ CI passes
Reduces config repetition for users with many cron jobs.
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.
Summary
session_modefield to[cron]config section, allowing a global default for all cron jobs"reuse"(default, share active session) or"new_per_run"(fresh session each run)session_modestill overrides the global defaultIsSilent/SetDefaultSilentpatternMotivation
Cron jobs sharing active sessions often hit "session is busy" errors. Users can now set
session_mode = "new_per_run"once globally instead of per-job.Test plan
go build ./...passesgo test ./core/ -run TestCron— all cron tests pass[cron] session_mode = "new_per_run"in config, verify cron jobs create independent sessionssession_mode = "reuse"overrides the global default