Remove Valkey installed-image storage and compatibility paths
- Dominant language
- Python
- Stars
- 670
- Forks
- 183
- Avg merge
- 15h 13m
- Merged PRs (30d)
- 368
Description
Final cleanup after reads and writes have moved to the DB and the heartbeat payload carries architecture.
Scope:
- Agent: remove the direct Valkey JSON write (add_agent_installed_images call in the heartbeat method).
- Manager: remove Valkey set writes from sync_installed_images, the installed_image JSON fallback, and the remove_agent_from_all_images full-SCAN cleanup.
- Remove ValkeyImageClient and the valkey_image client module, the AgentInstalledImagesRemoveEvent handling (digest reverse lookup), and the legacy canonical-key compatibility chain (AgentImagesRemoveEvent handler, remove_agent_from_images_by_canonicals).
- Retire REDIS_IMAGE_DB (DB 3) usage.
Success Criteria
- [ ] no remaining references to installed_image keys or image-id set keys in the codebase
- [ ] agent heartbeat works without any Valkey image client
- [ ] agent exit cleanup no longer produces WRONGTYPE error logs
- [ ] legacy GQL, CLI, and v2 API results are unchanged after removal
- [ ] pants test passes for affected packages
JIRA Issue: BA-7167
Contributor guide
Research direction
Start by tracing the heartbeat method's add_agent_installed_images call and the Manager methods sync_installed_images and remove_agent_from_all_images. Then locate ValkeyImageClient, the valkey_image client module, the event handlers, and remove_agent_from_images_by_canonicals. Done means the listed compatibility paths and REDIS_IMAGE_DB usage are gone, affected-package Pants tests pass, and the stated heartbeat, cleanup, and API criteria remain satisfied.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend, databases
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100