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
Collaborator

Summary

The HeartbeatService constructor was refactored to use an on_heartbeat callback instead of accepting provider/model parameters directly. This PR updates the tests to match the new API.

Changes

  • 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
  • Fixed bug where start() was not idempotent

Test Results

All 3 HeartbeatService tests now pass

Type

  • Test fixes
  • Bug fix (idempotent start)

🤖 Generated with Claude Code

## Summary The HeartbeatService constructor was refactored to use an `on_heartbeat` callback instead of accepting `provider`/`model` parameters directly. This PR updates the tests to match the new API. ## Changes - ✅ 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 - ✅ Fixed bug where `start()` was not idempotent ## Test Results ✅ All 3 HeartbeatService tests now pass ## Type - [x] Test fixes - [x] Bug fix (idempotent start) 🤖 Generated with Claude Code
code-server added 1 commit 2026-03-05 08:36:26 +01:00
fix: update HeartbeatService tests for new constructor API
Build Nanobot OAuth / build (pull_request) Successful in 7m4s
Build Nanobot OAuth / cleanup (pull_request) Has been skipped
e8e8ca6700
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>
code-server merged commit 8e829396b2 into main 2026-03-05 08:44:05 +01:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: wylab/nanobot#20