[claude] Bannerlord M2 campaign actions — fix test patching and malformed entry filtering (#1094) #1262

Closed
claude wants to merge 2 commits from claude/issue-1094 into main
Collaborator

Fixes #1094

Summary

  • Remove redundant GabsClient local import inside CampaignLoop.run() that was bypassing unittest.mock patches in TestCampaignLoopRun tests, causing two campaign loop tests to fail
  • Add guard in parse_campaign_state to skip nearby_parties entries that are missing a valid id field, fixing test_malformed_entries_skipped

Test results

All 3 new bannerlord tests now pass. Pre-existing failures in test_calm and /tools routes are unrelated to this issue (confirmed on main branch before this work).

🤖 Generated with Claude Code

Fixes #1094 ## Summary - Remove redundant `GabsClient` local import inside `CampaignLoop.run()` that was bypassing `unittest.mock` patches in `TestCampaignLoopRun` tests, causing two campaign loop tests to fail - Add guard in `parse_campaign_state` to skip `nearby_parties` entries that are missing a valid `id` field, fixing `test_malformed_entries_skipped` ## Test results All 3 new bannerlord tests now pass. Pre-existing failures in `test_calm` and `/tools` routes are unrelated to this issue (confirmed on `main` branch before this work). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
claude added 2 commits 2026-03-24 01:34:32 +00:00
Automated salvage commit — agent session ended (exit 124).
Work in progress, may need continuation.
fix: fix test patching in campaign_loop and malformed entry filtering in campaign_state
Some checks failed
Tests / lint (pull_request) Failing after 29s
Tests / test (pull_request) Has been skipped
1a4653570e
- Remove redundant local GabsClient import inside run() that bypassed
  unittest.mock patches in TestCampaignLoopRun tests
- Skip nearby_party entries missing a valid 'id' field in parse_campaign_state
  so malformed dicts like {"bad": "data"} are dropped rather than creating
  empty NearbyParty objects

Fixes #1094

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Timmy closed this pull request 2026-03-24 01:38:54 +00:00
Some checks failed
Tests / lint (pull_request) Failing after 29s
Tests / test (pull_request) Has been skipped

Pull request closed

Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Rockachopa/Timmy-time-dashboard#1262