gut: fix heartbeat and cron agent resolution (#1579)#2284
Merged
alexey-pelykh merged 1 commit intomainfrom Apr 11, 2026
Merged
Conversation
Heartbeat: - Rewrite isHeartbeatEnabledForAgent — agents.defaults.heartbeat now applies to ALL configured agents as baseline, not just the default - Per-agent heartbeat config overrides defaults for that agent - No agents configured → skip heartbeat entirely - Remove hasExplicitHeartbeatAgents binary either/or logic Cron: - resolveCronAgent throws on unknown agentId instead of silently falling back to the default agent (catches typos like "helpr") - assertMainSessionAgentId validates against sole agent (via resolveSoleAgentId) instead of the deprecated resolveDefaultAgentId - Session reaper uses explicit agent from each job, falling back to sole/default agent only when no job-specific paths are collected - Isolated agent run.ts cascade uses resolveSoleAgentId instead of resolveDefaultAgentId Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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
isHeartbeatEnabledForAgent()soagents.defaults.heartbeatapplies to ALL configured agents as baseline, with per-agent overrides. No agents → skip heartbeat entirely. Removes the binary either/or logic fromhasExplicitHeartbeatAgents.resolveCronAgent: Throw on unknownagentIdinstead of silently falling back to default agent (catches typos likeagentId: "helpr").assertMainSessionAgentId: Validate against sole agent (resolveSoleAgentId) instead of deprecatedresolveDefaultAgentId.run.ts: Three-level cascade usesresolveSoleAgentIdinstead ofresolveDefaultAgentId.Closes #1579
Test plan
isHeartbeatEnabledForAgenttests rewritten — defaults.heartbeat enables all agents, per-agent override, no-agents returns false, unknown agent returns falseresolveHeartbeatAgentsreturns all agents with heartbeat enabled (not just explicit ones)assertMainSessionAgentIdtests updated for sole-agent validation (rejects non-sole, rejects when no sole agent, allows sole agent)tsgo --noEmit)oxlint --type-aware)oxfmt --check)🤖 Generated with Claude Code