The editor's inline **Ask AI** button now sends a grounded prompt to…#422
Merged
Conversation
…aste (#2341) * fix(open-knowledge): ground inline Ask AI selection before terminal paste The WYSIWYG bubble-menu Ask AI button pasted the raw selected text into the running CLI. It now sends the same grounded selection prompt the bottom Ask AI composer builds (composeSelectionPrompt): the doc named as an @-mention plus the passage inline, or a locus read-via-OK-MCP pointer when the selection is large. Terminal reuse is unchanged; only the payload is grounded. Adds specs/2026-07-01-terminal-ask-ai-selection-grounding and a changeset. * test(open-knowledge): cover docName-null Ask AI fallback; use NOTE marker Addresses PR review: adds a DOM test for the docName === null composer fallback branch, and swaps the novel ponytail: comment prefix for the repo-standard NOTE: marker. * docs(open-knowledge): fix stale ponytail ref + non-Cursor threshold wording Addresses PR review: the spec still said ponytail: (code uses NOTE:), and both the call-site comment and spec called claude-code the 'most generous' target when only Cursor double-encodes — every non-Cursor target shares the same widest inline-vs-locus threshold. * test(open-knowledge): reuse makeEditor for docName-null case; fix stale comment Addresses PR pending recs: the docName-null test now reuses makeEditor (widened to accept null) instead of hand-building the editor, and the grounded-prompt test comment no longer says the host is 'mocked away' — the real pub/sub runs; only TerminalSessionsHost is unmounted. GitOrigin-RevId: 693c0ea134a405eb970cd3f692b35decd654fa76
Contributor
There was a problem hiding this comment.
Automated approval from agents-private public-mirror-sync (run: https://github.com/inkeep/agents-private/actions/runs/28541422150). Source of truth is the monorepo; direct edits on inkeep/open-knowledge are overwritten on next sync.
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.
The editor's inline Ask AI button now sends a grounded prompt to the docked terminal instead of the raw selected text. When you highlight a passage and click Ask AI with a terminal open, the running CLI receives the passage together with a reference to the document it came from (or a pointer to read the full passage via the OpenKnowledge MCP server when the selection is large), so the agent can place it in your knowledge base instead of getting an unattributed blob.