Skip to content

Attach readable code-linked lessons to exact grep answers - #1128

Merged
zlareb1 merged 2 commits into
mainfrom
feat/grep-linked-lessons
Nov 21, 2026
Merged

zlareb1 merged 2 commits into
mainfrom
feat/grep-linked-lessons

Conversation

@zlareb1

@zlareb1 zlareb1 commented Nov 21, 2026

Copy link
Copy Markdown
Member

Changelog category (leave one):

  • Improvement

Changelog entry (one or two sentences a user of Loom can read without the diff; the release pull request collects these into the release notes):

Exact code grep answers can include readable memories linked to their matched files. Lesson reads respect the request deadline and can be disabled with include_lessons=false.

Why

An agent can inspect a function through exact grep and never make a second memory call. Grep did not participate in the existing code-result lesson enrichment, so those reads could not return the project knowledge attached to their files.

Use the same enrichment wrapper as other code answers. It reads lessons after match retrieval, so cached match data does not contain a caller's memories. Only files in the returned answer are candidates; uncovered paths and namespace presence queries read no lessons.

Scope and risk

Adds the shared optional lesson input and output fields to code.grep, registers its file selector and bounds enrichment by the remaining grep deadline. Existing namespace authorization, narrowed-token refusal, lesson token limits and read timeout remain in the shared helper. No SQL, memory writes, extractor changes or re-indexing.

Compatibility, rollout and rollback

  • Wire: code.grep accepts include_lessons (default true) and lesson_namespaces (default empty). Both use the existing hidden-input policy. Responses can include lessons and lessons_left_out; empty fields are omitted.
  • Operator steps: none. The existing global lesson setting and enrichment limits apply.
  • Rollback: revert the change. No stored data or schema changes.

Tests

  • make format, make lint and make typecheck pass; generated SDKs and references are current.
  • Added coverage for matched-file selection, file mode, presence exclusion, uncovered paths, opt-out, empty serialization and remaining deadline.
  • Added an HTTP integration case over actual stored chunks and memories, including opt-out.
  • Local unit tests were not run at the requester's instruction. Integration execution remains for CI; merging does not wait for CI at the requester's instruction.
  • No benchmark performance or quality claim. The running evaluation uses its original frozen code; this change needs a separate measurement.

AI assistance in the code (leave one; writing this description with AI is fine):

  • AI-generated: Codex implemented the change and checked the existing authorization, cache and deadline paths. An independent agent reviews the final head.

  • I can explain every line of this diff and how it interacts with the rest of Loom.

Checklist

  • Local format, lint, type checks and focused tests pass. Static checks pass; unit tests remain for CI at the requester's instruction.
  • Generated SDK and reference files are regenerated.
  • No migration changes.
  • No plugin changes.
  • No frontend changes.
  • Documentation describes the behavior and wire changes are listed above.
  • Repository text follows the public-copy rules.
  • Commits are signed off.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
@vercel

vercel Bot commented Nov 21, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
loom-docs Ready Ready Preview Nov 21, 2026 10:14pm UTC

Request Review

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
@zlareb1
zlareb1 merged commit 5fc3648 into main Nov 21, 2026
59 of 60 checks passed
@zlareb1
zlareb1 deleted the feat/grep-linked-lessons branch November 21, 2026 22:19
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