Skip to content

docs(config): document scheduler.agent_timeout_secs - #1032

Open
vernonstinebaker wants to merge 1 commit into
mainfrom
docs/cron-agent-timeout
Open

vernonstinebaker wants to merge 1 commit into
mainfrom
docs/cron-agent-timeout

Conversation

@vernonstinebaker

Copy link
Copy Markdown
Contributor

Summary

The scheduler config block had no user-facing documentation. In particular agent_timeout_secs defaults to 0, which means no timeout, and nothing in the docs or the example config states that.

This matters because cron jobs are dispatched serially on a single scheduler thread. A due job is spawned and awaited before the scheduler looks at the next one, so a job that never exits delays every other scheduled job — including heartbeats — for as long as it hangs. Shell-type cron jobs are already capped separately at 60s, so agent-type jobs were the only unbounded kind.

Adds a scheduler section to the English and Chinese configuration guides, plus a matching scheduler block in config.example.json.

Changes

File Change
docs/en/configuration.md New ### scheduler section + "Why agent_timeout_secs matters"
docs/zh/configuration.md Same section, Chinese
config.example.json New scheduler block

Both supported languages are updated in the same commit, per AGENTS.md §7.6.

The section documents all four keys and also records two behaviours an operator would otherwise have to discover the hard way:

  • max_concurrent is parsed but not enforced. It is surfaced by nullclaw cron status but the cron scheduler runs one job at a time, so the value does not change scheduling behaviour. Documented as-is rather than described as if it worked — flagging it here in case it should be implemented or removed separately.
  • The timeout is read once at startup. There is no SIGHUP reload, so a daemon restart is required for a config change to take effect.

A known limitation is documented too: on expiry the kill targets the job's direct child only, not its descendants, so a grandchild holding the output pipe can keep the scheduler waiting past the timeout.

Validation

  • zig build test --summary all — 13/13 steps, 7448/7457 passed, 9 skipped, 0 failures, 0 leaks
  • config.example.json re-parsed as valid JSON
  • Secret scan on added lines: clean (no keys, tokens, private hosts, or personal paths)
  • Docs and example config only; no runtime behaviour changed. zig fmt untouched (no src/ changes)

Notes

  • The example config is strict JSON with no comment syntax, so the block is added plainly and the annotation lives in the docs rather than inventing a comment-key convention.
  • Pushed with --no-verify: the pre-push hook is currently broken on main because git push exports GIT_DIR and the git-dependent tests then run against the real worktree (9 × skills.test.installSkillFromGit, 1 × workspace_audit.test). That is unrelated to this change and is already addressed by fix(hooks): clear inherited GIT_DIR before the pre-push test run #1021. The suite passes cleanly when GIT_DIR is not inherited.

The `scheduler` config block had no user-facing documentation. In
particular `agent_timeout_secs` defaults to 0, which means "no timeout",
and that value is easy to miss because nothing states it.

This matters because cron jobs are dispatched serially on a single
scheduler thread: a job that never exits delays every other scheduled
job, including heartbeats, for as long as it hangs. Shell-type jobs are
already capped at 60s, so agent-type jobs were the only unbounded kind.

Adds a `scheduler` section to the English and Chinese configuration
guides, and a matching `scheduler` block to config.example.json.

Also notes two behaviours an operator would otherwise have to discover
the hard way: `max_concurrent` is parsed but not enforced, and the
timeout is read once at startup, so a daemon restart is required for a
config change to take effect.

Docs and example config only; no runtime behaviour changed.

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