Skip to content

[#208] /log and /fetch: give the model their output - #337

Open
shahmeerabdul wants to merge 1 commit into
mnemosyne-systems:mainfrom
shahmeerabdul:log-fetch-llm-context-208
Open

shahmeerabdul wants to merge 1 commit into
mnemosyne-systems:mainfrom
shahmeerabdul:log-fetch-llm-context-208

Conversation

@shahmeerabdul

Copy link
Copy Markdown

/log and /fetch returned plain Output, so the model never saw what the user saw, while /diff, /show and /grep already pass their output on as LLM context. They now return OutputWithLlmContext as well, so a follow-up like "which of these commits touched the parser?" works after /log.

A few details:

  • /log runs git with colours forced on, so the output has terminal escape codes in it. I strip them for the model's copy (reusing strip_ansi from export.rs, now pub(crate)) and leave the user's display untouched.
  • The context message looks like the other commands': The user executed `/log 5`. Output: followed by the text in a code block.
  • I did not run these through the diff compression, since that is made for diffs and /log output is already bounded by its count.

I added two tests: one for the message format and colour stripping, and one that runs /log against a real temporary git repo. I ran cargo test --bin orangu (688 passed), cargo fmt --check and cargo clippy --bin orangu -- -D warnings on 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 plain Output and could get the same treatment if you want that: /status, /ls, the /branch list and /get comments. I kept this PR to /log and /fetch as 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

@sksingh2005 sksingh2005 added the enhancement An enhancement to an existing feature label Nov 13, 2026
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
shahmeerabdul force-pushed the log-fetch-llm-context-208 branch from 9fa7b4f to eaaeb8d Compare November 14, 2026 09:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement An enhancement to an existing feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

/log and /fetch commands skip LLM context — inconsistent with /diff and /show

2 participants