Marius 4c0b067bf8 Poll local workspace git stats in Agent Manager (#6405)
* Poll local workspace git stats in Agent Manager

Extend the stats polling mechanism (renamed from WorktreeStatsPoller to
GitStatsPoller) to also poll the local workspace's branch name, diff
stats, and unpushed commits on the same 5s interval used for worktrees.

Previously the local branch name was only fetched on-demand when the
user clicked the Local sidebar item or when the panel first opened,
and no diff stats were shown for local at all.

Changes:
- GitStatsPoller now accepts getWorkspaceRoot and onLocalStats callbacks
- Each poll cycle fetches local branch, resolves tracking branch, and
  computes additions/deletions/commits against remote
- New agentManager.localStats message type pushes data to the webview
- Local sidebar item displays diff stats badges (+N / -N / ↑N)
- Diff toggle button shows change indicator when local has changes
- Poller always enabled (not gated on worktree count)

* Fix review issues: gate polling on worktrees/panel, preserve stats on failure

- Only enable GitStatsPoller when worktrees exist or the panel is open,
  avoiding unnecessary background git fetch for users without worktrees
- On transient HTTP client or diff fetch failure, skip emitting instead
  of zeroing stats, preserving last-known values in the UI

* Refactor poller and fix the edge case that users cannot access origin

* Remove unrelated changes

* Extract GitOps from GitStatsPoller, fix PR review comments

- Extract git operations into GitOps class backed by simple-git
- GitStatsPoller now requires GitOps injection (no internal creation)
- AgentManagerProvider creates shared GitOps, passes to poller and WorktreeManager
- Remove duplicate getRemoteTrackingBranch/git methods from AgentManagerProvider
- WorktreeManager delegates currentBranch/defaultBranch to GitOps when available
- Fix: preserve last-known local stats on HTTP client failure
- Fix: fall back to origin/HEAD for branches with no upstream
- Fix: preserve throw behavior in WorktreeManager.currentBranch delegation
- Add GitOps unit tests (17 tests) and update poller tests

* Handle remaining edge cases

* Fix branch stripping
2026-02-27 14:02:21 +00:00
2026-02-25 18:34:18 +01:00
2026-02-26 12:54:06 +01:00
2026-02-26 15:39:58 +00:00
2026-02-27 01:53:55 +00:00
2026-02-27 01:53:55 +00:00
2025-06-29 21:12:58 -04:00
2026-02-02 18:32:22 -03:00
2026-02-24 19:53:15 +01:00
2026-02-27 01:53:55 +00:00
2026-01-01 17:54:11 -05:00
2026-02-19 10:59:42 -03:00
2026-02-23 11:47:15 -03:00
2026-02-13 14:18:59 +00:00
2026-02-27 01:53:55 +00:00
2026-02-23 20:12:28 +01:00
2025-09-27 04:10:56 -04:00
2026-02-25 18:34:18 +01:00

VS Code Marketplace X (Twitter) Substack Blog Discord Reddit

🚀 Kilo

Kilo is the all-in-one agentic engineering platform. Build, ship, and iterate faster with the most popular open source coding agent. #1 on OpenRouter. 1.5M+ Kilo Coders. 25T+ tokens processed

  • Generate code from natural language
  • Checks its own work
  • 🧪 Run terminal commands
  • 🌐 Automate the browser
  • Inline autocomplete suggestions
  • 🤖 Latest AI models
  • 🎁 API keys optional
  • 💡 Get $20 in bonus credits when you top-up for the first time Credits can be used with 500+ models like Gemini 3.1 Pro, Claude 4.6 Sonnet & Opus, and GPT-5.2

Key Features

  • Code Generation: Kilo can generate code using natural language.
  • Inline Autocomplete: Get intelligent code completions as you type, powered by AI.
  • Task Automation: Kilo can automate repetitive coding tasks to save time.
  • Automated Refactoring: Kilo can refactor and improve existing code efficiently.
  • MCP Server Marketplace: Kilo can easily find, and use MCP servers to extend the agent capabilities.
  • Multi Mode: Plan with Architect, Code with Coder, and Debug with Debugger, and make your own custom modes.

Get Started in Visual Studio Code

  1. Install the Kilo Code extension from the VS Code Marketplace.
  2. Create your account to access 500+ cutting-edge AI models including Gemini 3 Pro, Claude 4.5 Sonnet & Opus, and GPT-5 with transparent pricing that matches provider rates exactly.
  3. Start coding with AI that adapts to your workflow. Watch our quick-start guide to see Kilo in action:

Watch the video

Get Started with the CLI

# npm
npm install -g @kilocode/cli

# Or run directly with npx
npx @kilocode/cli

Then run kilo in any project directory to start.

Autonomous Mode (CI/CD)

Use the --auto flag with kilo run to enable fully autonomous operation without user interaction. This is ideal for CI/CD pipelines and automated workflows:

kilo run --auto "run tests and fix any failures"

Important: The --auto flag disables all permission prompts and allows the agent to execute any action without confirmation. Only use this in trusted environments like CI/CD pipelines.

Contributing

We welcome contributions from developers, writers, and enthusiasts! To get started, please read our Contributing Guide. It includes details on setting up your environment, coding standards, types of contribution and how to submit pull requests.

Code of Conduct

Our community is built on respect, inclusivity, and collaboration. Please review our Code of Conduct to understand the expectations for all contributors and community members.

License

This project is licensed under the MIT License. Youre free to use, modify, and distribute this code, including for commercial purposes as long as you include proper attribution and license notices. See License.

Where did Kilo CLI come from?

Kilo CLI is a fork of OpenCode, enhanced to work within the Kilo agentic engineering platform.

S
Description
Kilo is the all-in-one agentic engineering platform. Build, ship, and iterate faster with the most popular open source coding agent. #1 coding agent on OpenRouter. 1.5M+ Kilo Coders. 25T+ tokens processed
Readme MIT
1.3 GiB
Languages
TypeScript 81.2%
Kotlin 12.5%
CSS 3.1%
JavaScript 2.6%
HTML 0.3%
Other 0.2%