reply drafts: Improve quality tracking#2742
Open
elie222 wants to merge 4 commits into
Open
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
- Inline single-caller helper, collapse duplicated return blocks, and cache repeated regex checks in draft tracking metadata - Avoid re-normalizing values per topic variant in reply memory topic relevance check - Hoist regex constant to top of referral signature module Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
1 issue found across 12 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="apps/web/utils/ai/reply/extract-reply-memories.ts">
<violation number="1" location="apps/web/utils/ai/reply/extract-reply-memories.ts:317">
P2: Topic relevance check uses substring matching, which can produce false positives and incorrectly convert GLOBAL memories to TOPIC.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
|
|
||
| return [content, incomingEmailContent, draftText, sentText].some((value) => | ||
| normalizedTopicVariants.some((topic) => | ||
| normalizeMemoryText(value).includes(topic), |
Contributor
There was a problem hiding this comment.
P2: Topic relevance check uses substring matching, which can produce false positives and incorrectly convert GLOBAL memories to TOPIC.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At apps/web/utils/ai/reply/extract-reply-memories.ts, line 317:
<comment>Topic relevance check uses substring matching, which can produce false positives and incorrectly convert GLOBAL memories to TOPIC.</comment>
<file context>
@@ -250,6 +243,94 @@ function normalizeMemoryText(value: string) {
+
+ return [content, incomingEmailContent, draftText, sentText].some((value) =>
+ normalizedTopicVariants.some((topic) =>
+ normalizeMemoryText(value).includes(topic),
+ ),
+ );
</file context>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.