Repository navigation
fix(hands): make the autonomous tick honour update_frequency - #19
Merged
Merged
Conversation
`update_frequency` is a selectable setting on the collector hand, but nothing ever read it. `activate_hand` built the agent's `ScheduleMode` from `def.agent.check_interval_secs.unwrap_or(3600)`, so every activated hand self-prompted once an hour no matter what the user picked. The effect on a live deployment: an instance configured `every_6h` woke up 24 times a day instead of 4. Worse, both collector instances also have their own cron schedules pointed at the same agents, so each sweep ran twice — once on the tick, once on the schedule — against a metered LLM API and rate-limited search engines. The setting shown in the UI was decorative. Resolve the interval from the instance's own config first, then the hand's declared value, then the default. Add `manual` (aliases `off`/`never`/`none`) which returns `None` and leaves the agent Reactive, so an instance driven by its own schedule does not also sweep on a timer. That is the correct setting for both current collector instances. An unrecognised value falls through to the declared default rather than returning `None`: a typo in a settings option should not silently leave an autonomous hand inert, which is a much harder failure to notice than one that ticks too often. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Nideesh1
marked this pull request as ready for review
July 31, 2026 20:20
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.
update_frequencyis a selectable setting on the collector hand, but nothing ever read it.activate_handbuilt the agent'sScheduleModefromdef.agent.check_interval_secs.unwrap_or(3600), so every activated hand self-prompted once an hour regardless of what the user picked. Confirmed on a live deployment:Both instances are configured
every_6h.Why it matters
An instance set to
every_6hwas waking 24 times a day instead of 4. And both collectors also have cron schedules pointed at the same agents, so each sweep ran twice — once on the tick, once on the schedule — against a metered LLM API and search engines that rate-limit. The setting shown in the UI was decorative.Change
Resolve the tick interval in order:
update_frequency, so the UI value is the value that runscheck_interval_secsDEFAULT_HAND_TICK_SECS(3600)Adds
manual(aliasesoff/never/none) returningNone, which leaves the agent Reactive so it runs only when messaged or when its cron fires. That is the correct setting for both current collector instances, and it is now a visible option in the collector's settings rather than something only reachable by editing state.An unrecognised value falls through to the declared default rather than returning
None— a typo in a settings option should not silently leave an autonomous hand inert, which is far harder to notice than one that ticks too often.Tests
test_hand_tick_uses_configured_update_frequency— each option maps to its intervaltest_configured_frequency_beats_hand_declared_interval— the setting wins, i.e. the actual bugtest_manual_frequency_disables_the_tick— incl. aliases and surrounding whitespace/casetest_hand_tick_falls_back_when_unconfigured— hand value, then defaulttest_unknown_frequency_falls_back_rather_than_disabling— typos do not disable a handVerification
Not compiled locally — the only available host is a k8s control-plane node where cargo has previously OOM-killed kube-apiserver. Relying on CI.
HAND.tomlwas parsed to confirm it still loads and now offers[manual, hourly, every_6h, daily, weekly].Requires a rebuild + deploy to take effect:
HAND.tomlisinclude_str!'d into the binary.🤖 Generated with Claude Code