From 521212af46061f90d1edadaac7ef267fd0a1b8b8 Mon Sep 17 00:00:00 2001 From: Dave Date: Tue, 24 Feb 2026 12:00:31 +0000 Subject: [PATCH] story-kit: create 133_story_clean_up_agent_state_on_story_archive_and_add_ttl_for_completed_entries --- ...chive_and_add_ttl_for_completed_entries.md | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 .story_kit/work/1_upcoming/133_story_clean_up_agent_state_on_story_archive_and_add_ttl_for_completed_entries.md diff --git a/.story_kit/work/1_upcoming/133_story_clean_up_agent_state_on_story_archive_and_add_ttl_for_completed_entries.md b/.story_kit/work/1_upcoming/133_story_clean_up_agent_state_on_story_archive_and_add_ttl_for_completed_entries.md new file mode 100644 index 0000000..9cab67c --- /dev/null +++ b/.story_kit/work/1_upcoming/133_story_clean_up_agent_state_on_story_archive_and_add_ttl_for_completed_entries.md @@ -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