feat: auto-hide stale chat tabs after 12 h; macros Record always opens new tab#716
Conversation
…ys opens new tab - Raise stale-tab threshold from 4 h to 12 h and remove the empty-only guard: any tab inactive >12 h is now hidden from the sidebar on load. The user lands in a fresh tab; older conversations stay in history. - Macros VoiceDictation: pass newTab:true to sendToAgent so each voice command always opens its own chat thread instead of reusing the active one. - Add changeset for @agent-native/core (patch).
✅ Deploy Preview for agent-native-voice ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for agent-native-meeting-notes ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for agent-native-scheduling ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for agent-native-images ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
✅ Deploy Preview for agent-native-design ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Builder reviewed your changes and has a few items to flag 🟡
Review Details
Code Review Summary
This PR makes two targeted chat-tab lifecycle changes to @agent-native/core:
-
Macros VoiceDictation.tsx — Voice command button now passes
newTab: truetosendToAgent, ensuring each voice invocation opens a fresh thread instead of reusing the active tab. -
MultiTabAssistantChat.tsx — Stale tab cleanup logic updated from "empty-only tabs inactive >4 hours" to "any tab inactive >12 hours", aiming to automatically drop users into a fresh tab on page load if their active conversation is old.
Overall approach: The scope is narrow, the changeset is properly included, and the intent is clear. However, there is a medium-severity logic issue in the stale tab cleanup implementation that affects the stated behavior.
Key Finding:
🟡 Effect ordering bug — When the active thread is detected as stale (>12h), it's filtered from the sidebar by the initialization effect, but then immediately re-added by the active-thread effect in the same render cycle before the new thread takes effect. This means users do not get dropped into a clean empty tab as the PR description promises; instead, the stale tab momentarily reappears alongside the fresh one.
Browser testing: Will run after this review (PR touches UI code).
⠀
Summary
Two related changes to chat-tab lifecycle behavior.
1. Macros — Record button always opens a new chat tab
File:
templates/macros/app/components/VoiceDictation.tsxPreviously, pressing the mic button and speaking sent the transcribed command to the currently active chat thread. Now it passes
newTab: truetosendToAgent, so every voice invocation starts a fresh thread. This keeps macro voice runs isolated and prevents a long-running conversation from getting a raw voice-to-action transcript dumped into it.2. General — Stale tabs hidden after 12 h of inactivity
File:
packages/core/src/client/MultiTabAssistantChat.tsxBefore:
After:
The
isStalepredicate inside the initialization effect was updated: themessageCount === 0guard was removed and the threshold raised from 4 h to 12 h.Changeset
A
patchchangeset for@agent-native/coreis included as required by CI.Testing
pnpm buildinpackages/corepasses cleanly (TypeScript compilation).Behavior matrix