Repository navigation
[#208] /log and /fetch: give the model their output - #337
Open
shahmeerabdul wants to merge 1 commit into
Open
shahmeerabdul wants to merge 1 commit into
shahmeerabdul wants to merge 1 commit into
Conversation
The /log and /fetch commands returned plain output, so the model never saw it, unlike /diff, /show and /grep. Return it as LLM context too, with the terminal colour codes stripped.
shahmeerabdul
force-pushed
the
log-fetch-llm-context-208
branch
from
November 14, 2026 09:14
9fa7b4f to
eaaeb8d
Compare
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.
/logand/fetchreturned plainOutput, so the model never saw what the user saw, while/diff,/showand/grepalready pass their output on as LLM context. They now returnOutputWithLlmContextas well, so a follow-up like "which of these commits touched the parser?" works after/log.A few details:
/logruns git with colours forced on, so the output has terminal escape codes in it. I strip them for the model's copy (reusingstrip_ansifromexport.rs, nowpub(crate)) and leave the user's display untouched.The user executed `/log 5`. Output:followed by the text in a code block./logoutput is already bounded by its count.I added two tests: one for the message format and colour stripping, and one that runs
/logagainst a real temporary git repo. I rancargo test --bin orangu(688 passed),cargo fmt --checkandcargo clippy --bin orangu -- -D warningson Linux, all clean. I could not try it in the interactive terminal itself.Jesper asked in the issue whether all commands were checked. I went through the local commands in
dispatch.rs, and these read-only ones also return plainOutputand could get the same treatment if you want that:/status,/ls, the/branchlist and/get comments. I kept this PR to/logand/fetchas the issue describes, so say if you would like me to extend it or send a follow-up.Also, this issue is assigned to @AdeshDeshmukh. I did not see a PR for it, so I went ahead, but happy to close this if they already have one in progress.
fixes #208