clawwork-ai / clawwork-ai/ClawWork
[Bug] taskGateways Map in room-store never cleaned up
- Dominant language
- TypeScript
- Stars
- 532
- Forks
- 75
- Avg merge
- 5h 31m
- Merged PRs (30d)
- 1
Description
## Summary
`packages/core/src/stores/room-store.ts` — the module-scoped `taskGateways` Map grows indefinitely. When a room is created via `initConductor()`, a `taskGateways.set(taskId, gatewayId)` entry is added, but it is never removed when the room is stopped, archived, or deleted.
## Expected behavior
Add cleanup logic in `setRoomStatus()` when status transitions to a terminal state (`stopped`, `error`), or provide an explicit `removeRoom()` action.
## Files
- `packages/core/src/stores/room-store.ts` — `taskGateways` Map (line ~66)
## Context
Introduced in PR #210.
Contributor guide
Research direction
Start in packages/core/src/stores/room-store.ts at the module-scoped taskGateways Map and inspect setRoomStatus() plus the room lifecycle paths. Ensure entries created by initConductor() are no longer retained after terminal room states or removal, and verify the Map is cleaned up for stopped and error cases.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 62/100