fix: update HeartbeatService tests for new constructor API #20

Merged
code-server merged 1 commits from fix/heartbeat-service-tests into main 2026-03-05 08:44:05 +01:00
1 Commits
Author SHA1 Message Date
code-serverandClaude Sonnet 4.5 e8e8ca6700 fix: update HeartbeatService tests for new constructor API
Build Nanobot OAuth / cleanup (pull_request) Has been skipped
Build Nanobot OAuth / build (pull_request) Successful in 7m4s
The HeartbeatService constructor was refactored to use an on_heartbeat
callback instead of accepting provider/model parameters directly. This
commit updates the tests to match the new API:

- Removed DummyProvider class (no longer needed)
- Updated test_start_is_idempotent to use new constructor
- Removed test_decide_returns_skip_when_no_tool_call (_decide method no longer exists)
- Updated test_trigger_now_executes_when_decision_is_run to use on_heartbeat callback
- Updated test_trigger_now_returns_none_when_no_callback to test new behavior

Also fixed a bug where start() was not idempotent - it now checks if a
task is already running before creating a new one.

All 3 HeartbeatService tests now pass.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-03-05 07:04:37 +00:00