Skip to content

fix: cloud sync deletion, memory issues, and agent prompt optimization#242

Merged
dvlin-dev merged 11 commits intomainfrom
fix/cloud-sync-deletion-and-memory-issues
Mar 16, 2026
Merged

fix: cloud sync deletion, memory issues, and agent prompt optimization#242
dvlin-dev merged 11 commits intomainfrom
fix/cloud-sync-deletion-and-memory-issues

Conversation

@dvlin-dev
Copy link
Copy Markdown
Owner

@dvlin-dev dvlin-dev commented Mar 16, 2026

Summary

  • Cloud sync: Fix deletion propagation and sync engine scheduler reliability (retry transient failures, reset cache on scope switch)
  • Memory: Fix pending state handling, cache key identity, Zustand functional updater usage, and UX improvements
  • Agent prompt: Rename agent from Mory to Mimi, translate all LLM-visible prompts/tool descriptions/error messages to English, improve conversational style (match response depth to complexity, skip execution loop for greetings)
  • Compaction: Translate summary prompt to English with backward-compatible legacy 【会话摘要】 prefix detection

Test plan

  • packages/agents-runtime: 133 tests pass (including new legacy prefix compat test)
  • packages/agents-tools: 33 tests pass
  • Full pre-commit hooks pass (lint-staged, typecheck across 33 packages, scoped unit tests)
  • PC app: 939 unit tests pass

Open with Devin

Codex added 8 commits March 16, 2026 22:59
- Fix resolveLocalDeleted equal case to delete instead of download
- Reduce deletion sync debounce from 300ms to 50ms for faster propagation
- Add error classification in memory indexing: ENOENT redirects to delete,
  4xx triggers inline_text fallback then server-side cleanup
- Remove redundant Memory tab search overlay (global search covers it)
- Implement stale-while-revalidate for Memory tab data loading
- Fix concurrent refresh race: use ref counter so only the latest
  refresh invocation clears the refreshing indicator
- Move setDataCache out of React setState updater to avoid brief
  Zustand/React state desync
- Scheduler: use Math.min(existingDeadline, newDeadline) so a longer
  debounce event cannot cancel a shorter one already scheduled
- Bump deletion debounce from 50ms to 100ms to avoid premature sync
  during chokidar rename event splitting
…back

- Replace duck-typed status check with instanceof WorkspaceContentApiError
  to avoid accidentally classifying non-HTTP errors as non-retryable
- Re-read file content when falling back from sync_object_ref to inline_text
  to ensure fresh data instead of potentially stale earlier read
…nalFacts

Extract merged array from setPersonalFacts functional updater and pass
the same reference to setDataCache, eliminating the stale closure over
personalFacts that could cause cache/state divergence after concurrent
operations.
- Exclude 401/408/429 from non-retryable classification so auth refresh
  races and rate limiting get proper retry instead of permanent failure
- Reset all cached payload fields when scopeKey changes to prevent stale
  data from previous workspace leaking into the new scope
- Fallback inline_text catch now checks isNonRetryable: transient errors
  (network/5xx) get scheduled for retry instead of dropping the task
- Use personalFactsRef to read latest facts in loadMorePersonalFacts,
  avoiding reliance on functional updater synchronous execution which
  is not guaranteed under React 18 concurrent rendering
…1/429

- Compose scopeKey as vaultPath + user.id to prevent cross-account data
  leak when switching accounts on the same vault
- Exclude 401 (auth refresh), 408 (timeout), 429 (rate limit) from
  non-retryable classification so transient failures get proper retry
- Allow retry for transient inline_text fallback failures instead of
  immediately dropping the indexing task
…versational style

- Rename agent identity from Mory to Mimi in core prompt
- Add execution loop qualifier: skip workflow for greetings/simple questions
- Add response style rule #8: match depth to complexity
- Add vibe line: read the room, respond accordingly
- Translate compaction prompt to English with legacy 【会话摘要】 compat
- Change compaction language directive to "primary language of the conversation"
- Translate all tool descriptions, Zod .describe(), and error messages to English
  across 14 tool files (subagent, task, web, file, search)
- Add test for legacy summary prefix backward compatibility
chatgpt-codex-connector[bot]

This comment was marked as resolved.

Copy link
Copy Markdown

@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: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 6 additional findings.

Open in Devin Review

chatgpt-codex-connector[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

Codex added 2 commits March 17, 2026 01:41
…on-and-memory-issues

# Conflicts:
#	apps/moryflow/pc/src/renderer/workspace/components/memory/use-memory-page.ts
@dvlin-dev dvlin-dev merged commit 19c6e63 into main Mar 16, 2026
1 of 2 checks passed
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2c2a2984d5

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +61 to +62
'<conversation>\n';
const SUMMARY_PROMPT_SUFFIX = '\n</conversation>';
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Use non-colliding markers for compaction transcript

Switching the transcript wrapper to <conversation>...</conversation> makes delimiter collisions much easier in real chats (for example, when users paste XML/HTML containing </conversation>), and buildSummaryPrompt concatenates raw history text without escaping, so that token can prematurely terminate the “data-only” section and let trailing transcript text be interpreted as fresh instructions during summary generation. This is a regression from the previous rare marker and can weaken compaction safety/summary accuracy for those inputs.

Useful? React with 👍 / 👎.

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