nanocoder icon indicating copy to clipboard operation
nanocoder copied to clipboard

[Bug] git_log ignores branch argument and mislabels current-branch commits

Open akramcodez opened this issue 1 month ago • 3 comments

Description

The git_log tool accepts a branch argument but completely ignores it when fetching commits. It defaults to fetching commits from HEAD, yet the UI misleadingly prints that the commits belong to the requested branch.

Environment

  • OS: macOS 14.0 / Ubuntu 22.04 / Windows 11
  • Node version: v20.x
  • Nanocoder version: Latest
  • Provider: N/A
  • Model: N/A

Steps to Reproduce

  1. Checkout a main branch.
  2. Ask the assistant to "Show me the git log for the feature branch".
  3. The assistant calls git_log with { "branch": "feature" }.

Expected Behavior

The tool should pass the branch argument down to the getCommits utility and return the commits that actually belong to the feature branch.

Actual Behavior

The tool ignores the branch argument when calling getCommits(). It returns commits from main (the current HEAD) but outputs the header Showing X commit(s) on feature:.

Logs/Screenshots

N/A

Additional Context

  • [x] I have searched existing issues to ensure this is not a duplicate
  • [x] I can reproduce this issue consistently
  • [x] This issue occurs with the latest version of nanocoder

akramcodez avatar Oct 06 '26 10:10 akramcodez

Hi @akramcodez, i'd like to take this.

plan - I'll pass branch as a filter to getCommits function, reject values starting with - so it can't be read as a git flag, and add a spec that runs against a real repo with a feature branch.

karthikponna avatar Oct 06 '26 13:10 karthikponna

Picking this up - a fix will follow shortly.

awhite0030 avatar Oct 06 '26 15:10 awhite0030

sounds good @karthikponna

akramcodez avatar Oct 06 '26 15:10 akramcodez