Skip to content

Conversation

@yujonglee
Copy link
Contributor

@yujonglee yujonglee commented Feb 13, 2026

Made with Cursor


Open with Devin

@netlify
Copy link

netlify bot commented Feb 13, 2026

Deploy Preview for hyprnote ready!

Name Link
🔨 Latest commit 9e8746d
🔍 Latest deploy log https://app.netlify.com/projects/hyprnote/deploys/698eddc1d081df00089c735b
😎 Deploy Preview https://deploy-preview-3942--hyprnote.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link

netlify bot commented Feb 13, 2026

Deploy Preview for hyprnote-storybook ready!

Name Link
🔨 Latest commit 9e8746d
🔍 Latest deploy log https://app.netlify.com/projects/hyprnote-storybook/deploys/698eddc1ef79fc00083181cb
😎 Deploy Preview https://deploy-preview-3942--hyprnote-storybook.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 2 potential issues.

View 10 additional findings in Devin Review.

Open in Devin Review

yujonglee and others added 3 commits February 13, 2026 17:06
- Fix AUTHOR_NAMES unused in content-collections.ts
- Add fallbacks for optional article.title and meta_description in blog routes

Co-authored-by: Cursor <cursoragent@cursor.com>
- useMCP: set isReady=true in catch block to allow chat fallback on transient errors
- context-bar: always slice displayChips so expand/collapse button stays visible

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@yujonglee yujonglee merged commit 789c864 into main Feb 13, 2026
22 checks passed
@yujonglee yujonglee deleted the chat-various-improvements branch February 13, 2026 08:21
Copy link
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 new potential issue.

View 16 additional findings in Devin Review.

Open in Devin Review

Comment on lines +36 to +46
for (const e of prevEntities) {
if (!seen.has(e.key)) {
seen.add(e.key);
merged.push(e);
}
}
for (const e of entities) {
if (!seen.has(e.key)) {
seen.add(e.key);
merged.push(e);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 persistContext never updates stale context entities, causing stale data after chat mode transitions

The persistContext function in chat-context.ts merges entities by always giving priority to previously persisted entities. When an entity with the same key (e.g., session:info) is persisted again with updated data (e.g., a changed session title or new transcript), the stale version from prevEntities is kept and the fresh version from entities is silently discarded.

Root Cause and Impact

In apps/desktop/src/store/zustand/chat-context.ts:36-46, prevEntities are iterated first and added to the seen set, so when the loop reaches the matching entity in entities, it's skipped:

for (const e of prevEntities) {
  if (!seen.has(e.key)) { seen.add(e.key); merged.push(e); }
}
for (const e of entities) {
  if (!seen.has(e.key)) { seen.add(e.key); merged.push(e); } // skipped for same key!
}

This is called from sendMessage (apps/desktop/src/components/chat/session.tsx:247-256) on every message send with contextEntitiesRef.current. On the first send, the session entity (key session:info) is persisted. On subsequent sends, even if the session title or content has been updated (e.g., auto-enhance completed), the updated entity is ignored.

Further, in session.tsx:226-228, the final contextEntities is computed as composeContextEntities([persistedEntities, ephemeralEntities]), which also gives precedence to persistedEntities. So after a chat mode transition (floating → panel → full tab), the stale persisted entity wins over the fresh ephemeral entity.

Impact: After a session's metadata changes (title, enhanced content, transcript word count) during an active chat, the context bar will display stale information that won't update until a new chat group is created.

Prompt for agents
In apps/desktop/src/store/zustand/chat-context.ts, the persistContext function's merge logic should prefer the new entities over the previously persisted ones for matching keys. Change the merge order: iterate over `entities` first (to get fresh data), then iterate over `prevEntities` (to retain previously accumulated entities that are no longer in the current set). This ensures that entities with updated data (same key) get the latest version while still accumulating context entities that may no longer be in the ephemeral set.

Alternatively, you could iterate `entities` first and `prevEntities` second:
  for (const e of entities) { if (!seen.has(e.key)) { seen.add(e.key); merged.push(e); } }
  for (const e of prevEntities) { if (!seen.has(e.key)) { seen.add(e.key); merged.push(e); } }
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant