feat(#820): MCP rate_entry tool — in-session knowledge feedback#823
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Adds an MCP rate_entry tool so agents can record good/bad/neutral feedback (with an optional note) on knowledge entries inline, and adds a migration that introduces a note column on search_feedback to back the optional note field.
Changes:
- Register a new
rate_entryMCP tool schema and dispatch entry inmcp-server.py. - Implement
_run_rate_entryto validate input, look up the entry, and INSERT a row intosearch_feedbackwithresult_kind='knowledge'and the newnotecolumn. - Add migration v37 to
migrate.pyaddingsearch_feedback.note TEXT.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| mcp-server.py | Adds the rate_entry tool schema, handler, and dispatch wiring. |
| migrate.py | Adds migration v37 introducing search_feedback.note to back optional rating notes. |
f24d2f4 to
578a025
Compare
- New rate_entry MCP tool: entry_id + verdict (good/bad/neutral) + optional note - Migration 37: ADD COLUMN note TEXT to search_feedback table - _run_rate_entry(): validates entry exists, writes to search_feedback with score ±1/0 - Wired into _handle_tools_call() dispatch - Closes the agent feedback loop without requiring a separate CLI call Closes #820 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ion test
- Add _check_auth(arguments) to _run_rate_entry (security fix)
- Change feedback query from 'mcp:rate_entry:{id}' to '*' so briefing
bias applies universally to rated entries regardless of query context
- Update briefing._apply_feedback_bias_to_knowledge to honor '*' query
- Add TestRateEntryExecution test class with feedback write verification
f1898e0 to
2a40fa6
Compare
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.
Implements #820. Adds
rate_entryMCP tool (good/bad/neutral verdict + optional note). Wires into existing search_feedback table. Closes #820