Repository navigation
fix: time search and excerpt bilingual notes in the question script - #71
Merged
Merged
Conversation
Report server tookMs on MCP search and log embed, retrieval, and grounding milliseconds without the query. When a note contains both Cyrillic and Latin, take the source excerpt from the question's script. Co-authored-by: Nick Kosarev <nick@kosarev.space>
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.
Summary
search(evidence and pack) now includes integertookMs, the server wall time for that call. Each search logs one stderr line,{"event":"search","tookMs":n,"embedMs":n,"retrievalMs":n,"groundingMs":n}, with no query text.embedMsis query embedding,retrievalMsis vector plus lexical lookup, andgroundingMsis passage scoring.listProjectsdoes not search and omitstookMs. There is no separate HTTP search route; this field is the/mcptool result.Tests
pnpm run check(lint,tsc --noEmit, full test suite): 55 files, 291 tests passed.Friction
excerpt()insrc/context-package.ts, offsets fromsrc/search-lexical.ts) insidedocs/search.mdand a single-line MCP tool description. About ten minutes of reading.pnpm run checkitself was about 30 seconds. The first check failed immediately on formatting andvp check --fixcleared it.vp check --fix.src/mcp-surface.tskeeps the wholesearchtool description on one line, so a one-sentence field note is easy to miss.docs/search.mddescribes response fields in running prose, with no field list, sotookMshad no obvious place to land.vp checksays to runvp check --fixand also warns that the npm script name isvpr check.docs/search.md— response assembly insrc/mcp-surface.ts(packageResult/ pack), excerpt window inexcerpt()— plus a response-field list (grounding,sources[].excerpt,tookMs) would cut the reading in half. Splitting the MCP description string would make the field addition a normal edit.