feat(config): add GOCLAW_CRON_JOB_TIMEOUT env var for cron timeout - #1099
Merged
mrgoonie merged 1 commit intoJun 22, 2026
Merged
Conversation
Allow overriding the cron job execution timeout via env var, matching the existing GOCLAW_* env var pattern used throughout the codebase. Falls back to the existing default (10m) when unset or invalid, since CronConfig.JobTimeoutDuration() already handles parse errors with a slog.Warn and the DefaultJobTimeout constant. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
|
Backlog triage note: this overlaps with #1114 for GOCLAW_CRON_JOB_TIMEOUT / #1098. This PR still has useful config_load_test.go coverage, so I am not closing it automatically. Recommended consolidation: keep the clean implementation path from #1114, but port or preserve these tests before closing this PR. |
3 tasks
mrgoonie
approved these changes
Jun 22, 2026
mrgoonie
left a comment
Contributor
There was a problem hiding this comment.
Summary: This is the cleaner merge target for #1098: it adds the same one-line GOCLAW_CRON_JOB_TIMEOUT env mapping as duplicate PR #1114, but also includes focused config-load regression tests for env override, invalid fallback, unset default, and env-over-file precedence.
Risk level: Low
Mandatory gates:
- Duplicate/prior implementation: overlap found with #1114. This PR is the better consolidation target because it includes the missing tests; #1114 can be closed after this lands.
- Project standards: passed — env override is placed in config loading and covered by tests.
- Strategic necessity: clear value for operators running long cron jobs.
- CI/checks: no GitHub checks reported on this branch, but the touched code is narrow and test coverage is included.
Findings:
- Critical: none
- Important: none
- Suggestion: after merge, close #1114 as duplicate/superseded by this PR.
Verdict: APPROVE
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
GOCLAW_CRON_JOB_TIMEOUTenv var mapping inapplyEnvOverrides(), completing theGOCLAW_*env var pattern forCronConfig.JobTimeout.DefaultJobTimeout(10m) behavior via the existingJobTimeoutDuration()helper, which already handles parse errors withslog.Warn.Closes #1098
Changes
internal/config/config_load.go— one new section in the operational-config block (next to Browser):internal/config/config_load_test.go— 4 new test cases:TestLoad_CronJobTimeout_EnvVar—GOCLAW_CRON_JOB_TIMEOUT=1h→1hTestLoad_CronJobTimeout_Invalid_FallsBackToDefault— invalid value → 10m (logs warn)TestLoad_CronJobTimeout_Unset_UsesDefault— unset → 10mTestLoad_CronJobTimeout_EnvOverridesFile— file5m+ env30m→30m(env wins)Test plan
go build ./...(PG build)go build -tags sqliteonly ./...(Desktop/SQLite build)go vet ./...go test ./internal/config/— 4 new + all existing tests passGOCLAW_CRON_JOB_TIMEOUT=1hand confirm a long cron job is no longer killed at 10mNotes for reviewers
CronConfig.JobTimeoutDuration()already validates and falls back. This was confirmed by the existingTestCronConfig_JobTimeoutDuration_Invalidtest.