Repository navigation
Fix: stop recording Cline CLI prompt recalls that Cline drops - #191
Merged
Merged
Conversation
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.
Fixes #155
The Cline CLI fires
prompt_submitand moves on without reading the reply, so it can't add context to a prompt. The adapter still rendered acontextModificationfor it, and the hook records an injection whenever the adapter renders something. So every CLI prompt that matched a procedure was recorded as shown, even though Cline dropped it. With a learned pagination procedure, three CLI prompts like "page 3 repeats an item from page 2 in src/paginate.js" left three injection rows, two of them not held out, while the agent never saw anything. Those rows end up in the comparison with held-out matches that decides when a procedure is taken out of recall.rendernow returns nothing for a prompt unless it came from the extension'sUserPromptSubmithook, which is the only prompt hook that can take context. Because the hook only records an injection after the adapter renders something, a CLI prompt is no longer recorded as an injection. It is still journaled, so learning from CLI sessions is unchanged. Recall after a failed command stays as it was in both hosts.The README now says that Cline recalls on a prompt only in its VS Code and JetBrains extension.
To reproduce, I built the binary, pointed
TRODDEN_HOMEat a scratch store with one learned procedure, and piped CLIprompt_submitpayloads intotrodden hook cline. Before the change it printed thecontextModificationreply and recorded one injection per prompt. After it, it prints nothing and no injection is recorded, while an extensionUserPromptSubmitpayload with the same prompt still gets the procedure and is recorded as before. A new test checks that a CLI prompt is journaled but renders nothing; it fails without the change.