nanocoder icon indicating copy to clipboard operation
nanocoder copied to clipboard

[Feature] Add an description field when agent make tool calls

Open coralsundy opened this issue 2 months ago • 5 comments

Description

It would be useful for tool card to accept an optional description/intent field and render it above the command in the tool card.

Such as “Run the test suite to verify the changes” followed by pnpm test; or "Commit the change and push to repo" followed by git commit/push.

Or explain what the diff/string_replace change actually does, like "Add a variable as a cache version so that parameters values hold in memory can invalidate when cache version increase, etc."

This would improve transparency without changing execution or approval behavior. I sometimes reach an execute_bash approval where the raw command does not make the model’s intent obvious, so I have to cancel it and ask for an explanation.

This description might add a bit more to token usage, but I would argue that cancel a tool call and ask AI to explain again would waste more tokens overall.


Example 1


 Tool Approval
╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│                                                                                                                                                                                                      │
│  ⚒ execute_bash                                                                                                                                                                                      │
|  Description:                                              <-------------------------------------------------- New
|   Commit the staged files and push to remote repository.   <-------------------------------------------------- Here
│  Command:                                                                                                                                                                                            │
│  git commit -m "Change 123" && git push origin test-branch                                                                                                                                                                                    │
│                                                                                                                                                                                                      │
│                                                                                                                                                                                                      │
│  Do you want to execute tool "execute_bash"?                                                                                                                                                         │
│                                                                                                                                                                                                      │
│  > ✓ Yes, execute this tool                                                                                                                                                                          │
│    ✗ No, cancel execution                                                                                                                                                                            │
│                                                                                                                                                                                                      │
│  Press Escape to cancel 

Example 2

 Tool Approval
╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│                                                                                                                                                                                                      │
│  ⚒ string_replace                                                                                                                                                                                    │
|  Description:                                                   <-------------------------------------------------- New
|   Replace two as 2 as user requests using digits for numbers.   <-------------------------------------------------- Here
│  Path: demo.txt                                                                                                                                                                                      │
│  Location: line 2                                                                                                                                                                                    │
│                                                                                                                                                                                                      │
│  ✓ Replacing 1 line with 1 line                                                                                                                                                                      │
│     1 line one                                                                                                                                                                                       │
│     2 -line two                                                                                                                                                                                      │
│     2 +line 2                                                                                                                                                                                        │
│     3 line three                                                                                                                                                                                     │
│                                                                                                                                                                                                      │
│                                                                                                                                                                                                      │
│                                                                                                                                                                                                      │
│  Do you want to execute tool "string_replace"?                                                                                                                                                       │
│                                                                                                                                                                                                      │
│  > ✓ Yes, execute this tool                                                                                                                                                                          │
│    ✗ No, cancel execution                                                                                                                                                                            │
│                                                                                                                                                                                                      │
│  Press Escape to cancel  

Use Case

See above

Proposed Solution

See above

Alternatives Considered

AI Reply with the description then call execute_bash, but sometimes that is a bit far away from the execute_bash section and easy to forget

Additional Context

  • [x] I have searched existing issues to ensure this is not a duplicate
  • [x] This feature aligns with the project's goals (local-first AI assistance)

Implementation Notes (optional)

If you have thoughts on how this could be implemented, share them here

coralsundy avatar Sep 16 '26 02:09 coralsundy

Have two other issues on my plate now. Anyone can take this task here. If nothing happens I will pick up later.

coralsundy avatar Sep 16 '26 02:09 coralsundy

Hey @coralsundy @akramcodez can you assign me this issue, would love to work on this

Shreyasnalle avatar Sep 16 '26 03:09 Shreyasnalle

sure @Shreyasnalle 👍

akramcodez avatar Sep 16 '26 09:09 akramcodez

Hey, @akramcodez can you have a look at the raised pr for this issue https://github.com/Nano-Collective/nanocoder/pull/1367

Shreyasnalle avatar Sep 17 '26 11:09 Shreyasnalle

Hey, @akramcodez the PR was not merged, is there any other changes to be made in the code, if yes then please let me know, I will work on it, thanks

Shreyasnalle avatar Sep 19 '26 13:09 Shreyasnalle