story-kit: create 133_story_clean_up_agent_state_on_story_archive_and_add_ttl_for_completed_entries

This commit is contained in:
Dave
2026-02-24 12:00:31 +00:00
parent e0a23874e6
commit 521212af46

View File

@@ -0,0 +1,21 @@
---
name: "Clean up agent state on story archive and add TTL for completed entries"
---
# Story 133: Clean up agent state on story archive and add TTL for completed entries
## User Story
As a user, I want completed and archived agent entries to be cleaned up automatically so that the agent pool reflects reality and stale entries do not accumulate or confuse the UI.
## Acceptance Criteria
- [ ] When a story is archived (move_story_to_archived), all agent entries for that story_id are removed from the HashMap
- [ ] Completed and Failed agent entries are automatically removed after a configurable TTL (default 1 hour)
- [ ] list_agents never returns agents for archived stories, even without the filesystem filter fallback
- [ ] A test demonstrates that archiving a story removes its agent entries from the pool
- [ ] A test demonstrates that completed entries are reaped after TTL expiry
## Out of Scope
- TBD