Skip to content

Conversation

EdenWuyifan
Copy link
Collaborator

No description provided.

@Copilot Copilot AI review requested due to automatic review settings August 4, 2025 21:45
Copy link

github-actions bot commented Aug 4, 2025

Coverage report

St.
Category Percentage Covered / Total
🟡 Statements 60.83% 7073/11627
🟡 Branches 65.62% 502/765
🔴 Functions 41.49% 117/282
🟡 Lines 60.83% 7073/11627

Test suite run success

3 tests passing in 3 suites.

Report generated by 🧪jest coverage report action from 6397075

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds support for tracking false positives and false negatives in the memory system by introducing an isMatchToAgent field to user operations. The system now distinguishes between cases where the agent and user disagree on matches, enabling better memory management and agent learning.

Key changes:

  • Adds isMatchToAgent boolean parameter to track agent vs. user match decisions
  • Implements false positive/negative memory storage and retrieval functionality
  • Updates UI components to handle undefined match states during transitions

Reviewed Changes

Copilot reviewed 11 out of 12 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
app/dashboard/rightpanel.tsx Updates isMatch prop type to allow undefined values
app/dashboard/page.tsx Passes isMatch parameter to dashboard operations hook
app/dashboard/hooks/useDashboardOperations.tsx Adds isMatch parameter and includes it in user operations
app/dashboard/components/explanation/useSchemaExplanations.tsx Changes initial isMatch state from false to undefined
app/dashboard/components/explanation/SchemaExplanation.tsx Updates isMatch prop type to allow undefined
app/dashboard/components/explanation/CombinedView.tsx Updates isMatch prop type to allow undefined
api/matching_task.py Adds is_match_to_agent parameter to UserOperation class
api/langchain/memory.py Implements false positive/negative storage and search functionality
api/langchain/agent.py Adds methods for handling user operations and memory management
api/index.py Updates API endpoints to handle isMatchToAgent parameter
README.md Minor title correction from "LLM-Supported" to "LLM-Powered"
Comments suppressed due to low confidence (1)

api/langchain/memory.py:133

  • [nitpick] The namespace key 'false_positives' uses underscores while other namespaces use underscores consistently, but the comment on line 114 uses spaces in 'false_positives'. Consider using consistent naming throughout - either 'false_positives' everywhere or 'falsePositives' to match the frontend camelCase convention.
            "false_positives": 0,

operation: str,
candidate: Dict[str, Any],
references: List[Dict[str, Any]],
is_match_to_agent: Optional[bool] = None,
Copy link

Copilot AI Aug 4, 2025

Choose a reason for hiding this comment

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

The parameter is_match_to_agent should be required rather than optional with None default. When tracking false positives/negatives, this information is essential for proper memory categorization. Consider making this a required boolean parameter.

Suggested change
is_match_to_agent: Optional[bool] = None,
is_match_to_agent: bool,

Copilot uses AI. Check for mistakes.

api/index.py Outdated
operation = operation_obj["operation"]
candidate = operation_obj["candidate"]
references = operation_obj["references"]
is_match_to_agent = operation_obj["isMatchToAgent"]
Copy link

Copilot AI Aug 4, 2025

Choose a reason for hiding this comment

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

Direct dictionary access without validation could cause KeyError if 'isMatchToAgent' is missing from the request. Use operation_obj.get("isMatchToAgent") or add proper validation to handle cases where this field might be absent.

Suggested change
is_match_to_agent = operation_obj["isMatchToAgent"]
is_match_to_agent = operation_obj.get("isMatchToAgent")

Copilot uses AI. Check for mistakes.

api/index.py Outdated

operation_type = operation["operation"]
candidate = operation["candidate"]
is_match_to_agent = operation["isMatchToAgent"]
Copy link

Copilot AI Aug 4, 2025

Choose a reason for hiding this comment

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

Direct dictionary access without validation could cause KeyError if 'isMatchToAgent' is missing from the operation. Use operation.get("isMatchToAgent") or add proper validation to handle cases where this field might be absent in historical operations.

Suggested change
is_match_to_agent = operation["isMatchToAgent"]
is_match_to_agent = operation.get("isMatchToAgent")

Copilot uses AI. Check for mistakes.

api/index.py Outdated

operation_type = operation["operation"]
candidate = operation["candidate"]
is_match_to_agent = operation["isMatchToAgent"]
Copy link

Copilot AI Aug 4, 2025

Choose a reason for hiding this comment

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

Direct dictionary access without validation could cause KeyError if 'isMatchToAgent' is missing from the operation. Use operation.get("isMatchToAgent") or add proper validation to handle cases where this field might be absent in historical operations.

Suggested change
is_match_to_agent = operation["isMatchToAgent"]
is_match_to_agent = operation.get("isMatchToAgent")

Copilot uses AI. Check for mistakes.

Copy link

github-actions bot commented Aug 4, 2025

Coverage

Coverage Report
FileStmtsMissCoverMissing
api
   index.py46421055%34–35, 94, 102–106, 117–195, 213–218, 231–235, 252, 264, 272–311, 320–333, 348–354, 366–373, 385–390, 402–409, 422–429, 473, 482–489, 496–520, 549, 558, 564, 582, 593–602, 619–622, 637, 646–675, 680–695, 741, 748–750, 755–769, 784–794, 804, 813
   matching_task.py70024964%85–87, 126–172, 180–237, 293, 319, 340–342, 439–440, 450–452, 464, 468–483, 495, 506–569, 572, 606, 729, 772, 812, 876–887, 928, 948–961, 966–1019, 1023–1025, 1039–1077, 1088, 1091–1098, 1132, 1147–1156, 1164–1179, 1182, 1185, 1189, 1196, 1205, 1221–1224, 1248–1264, 1292, 1303, 1321–1327, 1335, 1341, 1393, 1428–1437, 1484, 1497, 1526, 1534–1536, 1553, 1556–1560, 1563
   session_manager.py501178%25–26, 30–31, 39, 47–50, 53, 56
   utils.py2169058%32, 46, 57–59, 62–64, 98–99, 124–126, 143, 146–155, 162–169, 179, 208, 218–233, 237–239, 251–287, 293–299, 340–342, 352–354, 358–360, 368–372, 380–383
api/candidate_quadrants
   candidate_quadrants.py902276%130, 136–152, 156–162, 165–168, 172
api/clusterer
   column_encoder.py431370%51, 55, 83, 92, 101–102, 111, 115, 125–126, 135–136, 144
   embedding_clusterer.py741974%59–76, 83, 102–110
   utils.py1299923%14–16, 20–22, 27–29, 34–35, 40–46, 50–60, 64–66, 125, 129, 140–172, 177–190, 207–208, 236–307
api/langchain
   agent.py1984776%85, 99–104, 106–109, 273, 281, 284–287, 296, 378–381, 400–403, 430–461, 466–475, 506–511
   memory.py2848072%147–173, 295, 304, 312–313, 378, 380, 382, 545, 565–566, 585, 664–675, 678–689, 692–706, 709–723, 726–740, 768–769, 817–818, 826–827
   rag.py38380%1–69
api/langgraph
   langgraph.py2012010%2–778
api/matcher
   bdikit.py41295%52, 113
   difflib.py23291%34, 48
   magneto.py25196%28
   rapidfuzz_value.py93990%49, 99, 106, 126, 148–151, 164–166
   utils.py10280%26, 49
   valentine.py40295%68, 79
api/tools
   candidate_tools.py651577%114–116, 136–138, 184–186, 227–229, 270–272
   online_research_tools.py1816763%31, 61, 76, 85–87, 116–132, 143–159, 170–186, 197–213, 241, 247, 257, 285–287, 302, 330–332, 351, 390–392, 411, 421, 455–457, 461–484
   query_tools.py781581%132, 160–167, 189–196, 218–219
   source_scraper.py10190%40
   task_tools.py551475%27, 56–60, 87, 101–105, 120–126
TOTAL3258120963% 

Tests Skipped Failures Errors Time
56 0 💤 4 ❌ 0 🔥 1m 53s ⏱️

@EdenWuyifan EdenWuyifan merged commit 3c19ee5 into main Aug 13, 2025
6 checks passed
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