Include per-image architecture in agent heartbeat payload and use it as the sync source
- Dominant language
- Python
- Stars
- 670
- Forks
- 183
- Avg merge
- 15h 13m
- Merged PRs (30d)
- 368
Description
The heartbeat images payload currently packs (canonical, digest) 2-tuples (agent/agent.py around line 1294), while the per-image architecture needed for canonical-to-ImageID resolution (ImageIdentifier requires canonical + architecture) only exists in the installed_image:{agent_id} JSON that the agent writes directly to Valkey. To remove the Valkey path entirely, the heartbeat must become self-contained.
Scope:
- Agent: pack (canonical, digest, architecture) 3-tuples from self.images (InstalledImageInfo already holds the architecture from docker inspect).
- Manager: accept both 2-tuples (older agents) and 3-tuples when decoding; for 3-tuple payloads build ImageIdentifier directly from the payload instead of reading the Valkey JSON; keep the Valkey JSON fallback for older agents.
- Follows the established compatibility convention: manager upgraded first and tolerant of older agents (same as normalize_slot_keys in AgentInfo).
Success Criteria
- [ ] new agent sends 3-tuples; manager resolves images without reading the Valkey installed_image JSON
- [ ] payload with legacy 2-tuples is still processed via the Valkey JSON fallback without errors
- [ ] architecture values are normalized via arch_name_aliases consistently with the current scan path
- [ ] pants test passes for affected packages
JIRA Issue: BA-7163
Contributor guide
Research direction
Start at agent/agent.py around line 1294, then trace the manager’s heartbeat decoder and current installed_image/scan path. Check the existing AgentInfo compatibility convention and arch_name_aliases handling; done means new payloads resolve without the Valkey JSON, legacy 2-tuples still fall back, and affected Pants tests pass.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, python
- Domain
- backend, distributed-systems
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100