## Palace Code Self-Heal — 2026-03-17 18:30 **All features working.** One bug found and fixed: **Bug:** Stale closure in `use-threads.ts` — the `refresh` callback had an empty dependency array `[]`, causing it to always fetch with the initial `windowMs` value even after the user changed the time window selector (1h → 7d etc.). **Fix:** Changed `useCallback(..., [])` to `useCallback(..., [windowMs])` so the callback correctly re-captures the current time window. **Verified:** - Page renders (Palace Code header, split-panel layout, thread cards) - All API endpoints: `/code/api/threads`, `/code/api/session-tails`, `/code/api/update-thread`, `/code/api/delete-thread`, `/code/api/attach-thread`, `/code/api/sync-linear` — all 200 - 8 threads returned, session tail logs working - App rebuilt and restarted after fix