Skip to content

Fix: stop recording Cline CLI prompt recalls that Cline drops - #191

Merged
aayank13 merged 1 commit into
mainfrom
fix/cline-cli-prompt-recall
Oct 10, 2026
Merged

aayank13 merged 1 commit into
mainfrom
fix/cline-cli-prompt-recall

Conversation

@aayank13

Copy link
Copy Markdown
Owner

Fixes #155

The Cline CLI fires prompt_submit and moves on without reading the reply, so it can't add context to a prompt. The adapter still rendered a contextModification for 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.

render now returns nothing for a prompt unless it came from the extension's UserPromptSubmit hook, 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_HOME at a scratch store with one learned procedure, and piped CLI prompt_submit payloads into trodden hook cline. Before the change it printed the contextModification reply and recorded one injection per prompt. After it, it prints nothing and no injection is recorded, while an extension UserPromptSubmit payload 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.

@aayank13
aayank13 merged commit 40c87ad into main Oct 10, 2026
7 of 8 checks passed
@aayank13
aayank13 deleted the fix/cline-cli-prompt-recall branch October 10, 2026 21:56
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.

Cline CLI prompt recalls are recorded as shown though Cline drops them

1 participant