-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Problem
After work completes, agent directories in ~/.panopticon/agents/ accumulate indefinitely. Currently there are 200+ directories from historical work.
Blocked On
PAN-81: Event-sourced cost tracking
The current cost calculation (/api/costs/by-issue) iterates through agent directories to find workspace paths for session file parsing. Until PAN-81 implements hook-based cost collection with its own persistence, we cannot safely delete or archive agent directories without losing cost data.
Proposed Solution (After PAN-81)
- Add
status: "completed"to state.json when work finishes normally - Add "Archive old agents" button to Health tab UI
- Implement archive logic:
- Move directories older than X days (configurable) with
status: "stopped"or"completed"to~/.panopticon/agents-archive/ - Or simply delete (cost data now lives in event log)
- Move directories older than X days (configurable) with
- Optional: Auto-archive on dashboard startup
Related
- PAN-84 implemented filter-only approach as interim solution (hides old agents from Health tab)
- PAN-81 will eliminate dependency on agent directories for cost calculation
Acceptance Criteria
- Old agent directories can be cleaned up without losing cost data
- Archive button available in Health tab UI
- Configurable age threshold for archiving
- Confirmation dialog before archiving
Metadata
Metadata
Assignees
Labels
No labels