Skip to content

Fix app interaction counter reset and coordinator inference#56

Merged
KjetilVaa merged 1 commit intostagingfrom
fix/app-heartbeat-bugs
Feb 25, 2026
Merged

Fix app interaction counter reset and coordinator inference#56
KjetilVaa merged 1 commit intostagingfrom
fix/app-heartbeat-bugs

Conversation

@KjetilVaa
Copy link
Copy Markdown
Collaborator

Summary

  • Fix heartbeat piggyback overwriting app total_interactions with coordinator's task counts (was resetting the independently tracked counter to 0)
  • Auto-infer coordinator_address from the registering agent when a coordinated app doesn't specify one explicitly (was staying null, causing sweep to mark app offline)

Test plan

  • All 70 directory tests pass
  • Deploy and verify interaction counter increments correctly across heartbeats
  • Verify coordinated app stays "available" after registration + heartbeats

🤖 Generated with Claude Code

Two bugs in the directory heartbeat/registration flow:

1. Heartbeat piggyback was overwriting app total_interactions with the
   coordinator agent's tasks_completed + tasks_failed, clobbering the
   independently tracked appInteractions counter. Now total_interactions
   is only incremented via the appInteractions path.

2. Coordinated apps registered with type:"coordinated" but no explicit
   coordinatorAddress got coordinator_address=null in the DB. The
   heartbeat piggyback couldn't find the app, so the sweep marked it
   offline. Now the directory auto-sets coordinator_address to the
   registering agent's address for coordinated apps.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@KjetilVaa KjetilVaa marked this pull request as ready for review February 25, 2026 17:07
@KjetilVaa KjetilVaa merged commit 1301a83 into staging Feb 25, 2026
2 checks passed
@KjetilVaa KjetilVaa deleted the fix/app-heartbeat-bugs branch February 25, 2026 17:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant