Repository navigation
feat(sessions): return the passages around a hit on request - #443
Merged
Merged
Conversation
`context` (CLI: `--context <n>`, 0 to 5, implies `full`) adds the n passages either side of each hit from the same transcript. A transcript's passages are written in one transaction, so its rows are consecutive and in transcript order and the neighbours are the adjacent rows. Neighbours spend the 16,000-byte full budget after every hit's own passage, nearest first, so context never costs a hit its passage; the answer says how many neighbours the budget left out. Passages are returned as stored, credentials included, and the docs and server instructions say so.
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.
codegraph_sessionsandcodegraph sessionsgaincontext/--context <n>(0 to 5, impliesfull). Each hit comes back with the n passages before and after it from the same transcript, in transcript order.How it works. A transcript's passages are inserted in one transaction, so its rows are consecutive and in order. The neighbours are the adjacent rows with the same
file. No schema change and no second lookup call.Budget. Neighbours draw on the existing 16,000-byte
fullbudget after every hit's own passage, nearest first, rank by rank. Context never costs a hit its passage. When neighbours are cut, the answer says how many.Secrets. Passages are returned as stored, credentials included. This matches the default snippets and the transcript files on disk, so there is no redaction (decided with the maintainer). The README, site docs, CHANGELOG and server instructions say so.
Checks.
tsc --noEmitclean;sessions-index,cli-sessions-command,readme-sync,mcp-tool-allowlist,worktree-detectionpass locally (62 + 42 tests);check:agent-docs13318/32768 bytes.README rows checked. The CLI line, the
codegraph_sessionstool row and the site CLI and MCP pages are updated. No count or benchmark row moves, and no other "About this fork" row is affected.Summary by CodeRabbit
--context <n>option to session searches, including the CLI and MCP tool. Choose up to five neighboring passages on each side of a matching passage; requesting context also enables full-passage output.