Skip to content

Expose heartbeat default_timeout_secs in config.toml#775

Open
pbranchu wants to merge 1 commit intoRightNow-AI:mainfrom
pbranchu:config-heartbeat-timeout
Open

Expose heartbeat default_timeout_secs in config.toml#775
pbranchu wants to merge 1 commit intoRightNow-AI:mainfrom
pbranchu:config-heartbeat-timeout

Conversation

@pbranchu
Copy link

Summary

  • Add a [heartbeat] section to KernelConfig with a default_timeout_secs field (default: 180)
  • Wire start_heartbeat_monitor to read the configured timeout instead of using the hardcoded default
  • Add tests for deserialization and default values
  • Document the new config section in docs/configuration.md

Problem

Reactive agents (hands) that sit idle between infrequent requests get marked as crashed after the hardcoded 180-second inactivity timeout. This causes the first request after an idle period to fail with a health-check error, requiring the kernel to recover the agent before it can serve the request.

Users with hands that are called infrequently (e.g., a code-review hand invoked a few times per day) need to increase this timeout without modifying source code.

Usage

[heartbeat]
default_timeout_secs = 600   # 10 minutes for infrequently-used hands

Per-agent heartbeat_interval_secs in autonomous config continues to override this global default.

Test plan

  • cargo test -p openfang-types -- config::tests::test_heartbeat passes (4 new tests)
  • cargo test -p openfang-kernel -- heartbeat::tests::test_heartbeat_config_custom_timeout passes
  • Verify a kernel booted with [heartbeat] default_timeout_secs = 600 logs the custom value
  • Verify omitting the [heartbeat] section preserves the 180s default

🤖 Generated with Claude Code

Add a [heartbeat] section to KernelConfig so users can tune the
inactivity timeout that determines when agents are marked unresponsive.
Reactive agents (hands) that sit idle between infrequent requests were
getting marked as crashed after the hardcoded 180s default, causing
the first request after idle to fail.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
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