Skip to content

Conversation

@brendan-kellam
Copy link
Contributor

@brendan-kellam brendan-kellam commented Feb 2, 2026

Add listCommits tool to Ask Sourcebot to enable querying commit history for repositories.

image

Linear Issue: SOU-338

Open in Cursor Open in Web

Summary by CodeRabbit

  • New Features

    • Added a commits-listing tool to the chat experience, showing repository commits with shortened hash, refs, message, author, and formatted date in an expandable UI within chat details.
  • Documentation

    • Recorded the new listCommits tool in the changelog under Unreleased.

- Add listCommits to toolNames constant and uiVisiblePartTypes
- Create listCommitsTool with support for filtering by date range, author, and commit message
- Implement ListCommitsToolComponent.tsx for UI display
- Integrate tool into agent and detailsCard

Co-authored-by: brendan <[email protected]>
@cursor
Copy link

cursor bot commented Feb 2, 2026

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 2, 2026

Caution

Review failed

The pull request is closed.

Walkthrough

Adds a new chat tool "listCommits": backend tool implementation, type bindings, agent registration, UI visibility, and a new React component to render commit lists (loading/error/success) in the chat details view.

Changes

Cohort / File(s) Summary
Tool Implementation & Types
packages/web/src/features/chat/tools.ts, packages/web/src/features/chat/types.ts
Added listCommitsTool implementation and exported types (input/output/UI part). Wired ListCommitsTool into chat tool type map. Calls listCommits API and maps commits to standardized output.
Agent Registration & Constants
packages/web/src/features/chat/agent.ts, packages/web/src/features/chat/constants.ts
Registered toolNames.listCommits in agent tool mapping and added tool-listCommits to uiVisiblePartTypes.
UI: Details View & Tool Component
packages/web/src/features/chat/components/chatThread/detailsCard.tsx, packages/web/src/features/chat/components/chatThread/tools/listCommitsToolComponent.tsx
Added ListCommitsToolComponent (collapsible commits list with loading/error/success states) and integrated it into detailsCard rendering for tool-listCommits parts.
Changelog
CHANGELOG.md
Documented addition of listCommits tool under Unreleased Added section.

Sequence Diagram

sequenceDiagram
    participant Agent as Chat Agent
    participant AgentReg as Agent Registry
    participant Tool as listCommitsTool
    participant GitAPI as Git API
    participant UI as ListCommitsToolComponent

    Agent->>AgentReg: request execute tool listCommits (params)
    AgentReg->>Tool: invoke listCommitsTool with params
    Tool->>GitAPI: call listCommits(query, since, until, author, maxCount)
    GitAPI-->>Tool: return commit list or error
    alt success
        Tool->>Tool: map commits -> {hash, message, author, refs, date, totalCount}
        Tool-->>AgentReg: return formatted output
    else error
        Tool-->>AgentReg: return service error
    end
    AgentReg-->>UI: deliver tool UI part (tool-listCommits)
    UI->>UI: determine state (loading / error / success)
    UI-->>UI: render collapsible commits list or error/no-results message
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Ask Sourcebot list commits tool' clearly and specifically summarizes the main change: adding a list commits tool to Ask Sourcebot.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch cursor/SOU-338-ask-sourcebot-list-commits-tool-d137

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@brendan-kellam brendan-kellam marked this pull request as ready for review February 2, 2026 20:26
@brendan-kellam brendan-kellam merged commit 2f36adb into main Feb 2, 2026
1 of 8 checks passed
@brendan-kellam brendan-kellam deleted the cursor/SOU-338-ask-sourcebot-list-commits-tool-d137 branch February 2, 2026 20:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants