[Bug] git_log ignores branch argument and mislabels current-branch commits
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
- Checkout a
mainbranch. - Ask the assistant to "Show me the git log for the
featurebranch". - The assistant calls
git_logwith{ "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
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.
Picking this up - a fix will follow shortly.
sounds good @karthikponna