Skip to content

Add agent status to Home view#5128

Merged
ianhattendorf merged 5 commits intomainfrom
ai-agent-status-bar-exploration
Apr 28, 2026
Merged

Add agent status to Home view#5128
ianhattendorf merged 5 commits intomainfrom
ai-agent-status-bar-exploration

Conversation

@ianhattendorf
Copy link
Copy Markdown
Contributor

@ianhattendorf ianhattendorf commented Apr 13, 2026

Summary

Adds real-time AI agent status tracking to the Home view, starting with Claude Code as the first provider.

  • Introduces an agent status provider framework (AgentStatusService, AgentStatusProvider) with a Claude Code implementation that discovers running sessions via process inspection and IPC
  • Adds Home webview components (agent-status, agent-session-card, agent-status-pill) to display active agent sessions, their current state, and token usage
  • Hardens the GK CLI IPC server and adds a dev-only local CLI path override
image image image

Closes #5041

Test plan

  • Verify agent status appears in Home view when Claude Code is running
  • Verify status updates in real-time as agent sessions change state (idle, working, waiting for input)
  • Verify graceful handling when no agents are running (no errors, clean empty state)
  • Verify browser/web environment builds successfully (browser stubs in place)
  • Run pnpm run build — no new errors

@ianhattendorf ianhattendorf added this to the 17.12 milestone Apr 13, 2026
@ianhattendorf ianhattendorf added area-ai Issues or features related to AI area-home Issues or features related to Home labels Apr 13, 2026
@ianhattendorf ianhattendorf marked this pull request as draft April 13, 2026 23:15
@augmentcode
Copy link
Copy Markdown

augmentcode Bot commented Apr 13, 2026

🤖 Augment PR Summary

Summary: Adds real-time AI agent session/status tracking to the Home view, starting with Claude Code.

Changes:

  • Introduces a shared @gitlens/agents package (types, IPC server, discovery file support) plus a Claude Code session provider
  • Adds AgentStatusService to manage providers, expose sessions, and register agent commands (install hook / open session / resolve permissions)
  • Extends Home webview state + RPC to stream agent session updates and show them in new UI components (status pills, session cards, Overview “Agents” tab)
  • Updates branch cards to display agent status pills when a session matches the branch/worktree
  • Adds branch metadata support for “agent last activity” (gk-agent-last-activity) and wires agent activity to update it
  • Hardens IPC request handling (query parsing + request size limit) and adds a dev-only local GK CLI binary override
  • Adds new telemetry events for hook install, session start/end, and permission resolution
  • Adds browser stubs and build config/aliases for the new agents package

Technical Notes: Agent discovery uses per-window tmpdir JSON files to query sibling windows for session state, and the Home view computes an attention badge when sessions are waiting on user input.

🤖 Was this summary useful? React with 👍 or 👎

Copy link
Copy Markdown

@augmentcode augmentcode Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review completed. 6 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

Comment thread src/env/node/agents/claudeCodeProvider.ts Outdated
Comment thread src/env/node/agents/claudeCodeProvider.ts Outdated
Comment thread src/env/node/agents/claudeCodeProvider.ts Outdated
Comment thread src/env/node/agents/claudeCodeProvider.ts Outdated
Comment thread src/webviews/apps/plus/home/components/branch-card.ts
Comment thread src/env/node/gk/cli/integration.ts
@trevor-polidore trevor-polidore modified the milestones: 17.12, 18.0 Apr 14, 2026
@ianhattendorf ianhattendorf force-pushed the ai-agent-status-bar-exploration branch from 286f732 to 7a38088 Compare April 15, 2026 22:18
@ianhattendorf
Copy link
Copy Markdown
Contributor Author

augment review

Copy link
Copy Markdown

@augmentcode augmentcode Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review completed. 4 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

Comment thread packages/plus/agents/src/providers/claudeCodeProvider.ts
Comment thread src/webviews/apps/plus/home/components/agent-status.ts Outdated
Comment thread src/env/node/focusWindow.ts
Comment thread src/container.ts
@ianhattendorf ianhattendorf force-pushed the ai-agent-status-bar-exploration branch from 7a38088 to a6aa928 Compare April 16, 2026 01:14
@ianhattendorf ianhattendorf marked this pull request as ready for review April 16, 2026 01:15
@ianhattendorf
Copy link
Copy Markdown
Contributor Author

Still some questions on the exact UI/UX, and I still need to test Windows/macOS Window focusing (or we can just remove that if we feel it's not useful), but it's probably better to get the core merged sooner rather than later so we can iterate on it.

Copy link
Copy Markdown

@augmentcode augmentcode Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review completed. 3 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

Comment thread packages/plus/agents/src/ipcServer.ts
Comment thread packages/plus/agents/src/providers/claudeCodeProvider.ts
Comment thread packages/git/src/providers/branches.ts
@ianhattendorf ianhattendorf force-pushed the ai-agent-status-bar-exploration branch from a6aa928 to 1c5d295 Compare April 16, 2026 18:19
Logger.debug(`AgentIpcServer listening on ${this._server.ipcAddress}`);
} catch (ex) {
Logger.error(ex, 'AgentIpcServer.start');
this._server = undefined;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should you do a this._server?.dispose() first here?

async start(options: AgentIpcServerOptions): Promise<void> {
if (this._server != null) return;

this._workspacePaths = options.workspacePaths;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this is only set on start, what happens if I add or remove a folder to the workspace? Do we need to listen to onDidChangeWorkspaceFolders?

Comment thread src/env/node/providers.ts Outdated
export function getAgentSessionProviders(container: Container): AgentSessionProvider[] {
return [
new ClaudeCodeProvider({
sendTelemetryEvent: (name, props) => container.telemetry.sendEvent(name as any, props as any),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a way around the "as any" casts here and in onGateDeadlock?

);
}

switch (event.event) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We will probably want to explicitly add no-op cases for TeammateIdle, TaskCompleted, InstructionsLoaded, ConfigChange, WorktreeCreate, WorktreeRemove, etc. if we aren't handling them yet or intentionally skipping them, just so it doesn't look like we missed them.

Comment thread packages/plus/agents/src/ipcServer.ts Outdated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would this still be "Cli Integration IPC server" or is it more generic now?

@ianhattendorf ianhattendorf force-pushed the ai-agent-status-bar-exploration branch 2 times, most recently from 954275c to 895f524 Compare April 23, 2026 18:12
@ianhattendorf
Copy link
Copy Markdown
Contributor Author

@ramin-t addressed feedback, also push up a commit simplifying some aspects since it's gone through a few iterations now.

@ramin-t
Copy link
Copy Markdown
Contributor

ramin-t commented Apr 23, 2026

Code changes LGTM - but I have a repo with a session open in my workspace, and I don't see that session in the workspace filter but I do see it in the all filter - any idea why (the open repo is core-tools and it's checked out on main)?

image image

@gitkraken-services
Copy link
Copy Markdown

gitkraken-services Bot commented Apr 26, 2026

🟢 Conflict resolved with 100% confidence

Apply conflict resolution in GitKraken

Comment gitkraken apply to apply this conflict resolution.


Resolution details

🟢 packages/git-cli/src/providers/branches.ts (merged, 100%)

Merged agent status metadata tracking from 'theirs' into the new cached provider structure from 'ours'. This involves updating the regex to include 'agent-last-activity' and adding the logic to parse 'gk-agent-last-activity' into 'metadata.agentLastActivityAt'.

🟢 src/webviews/apps/plus/home/components/branch-card.ts (merged, 100%)

Merged imports by adopting the refactored path for 'merge-target-status.js' from 'ours' and adding the new 'agent-status-pill.js' import from 'theirs'.


Generated by GitKraken at 2026-04-28 21:48:15 UTC

GK CLI's default `gk ai hook install claude-code` registers every
event as non-blocking, so Claude Code fires PermissionRequest and
proceeds before GitLens can intercept the prompt. Pass explicit
`--event`/`--blocking-event` flags so PermissionRequest is installed
with `--blocking` and GitLens can surface allow/deny UI in the home
webview.
Mirrors the install command: delegates to `gk ai hook uninstall
claude-code`, which removes GitLens-owned hook entries from
`~/.claude/settings.json` while leaving entries owned by other
tools untouched.
@ianhattendorf ianhattendorf force-pushed the ai-agent-status-bar-exploration branch from 13e4564 to 049e2fd Compare April 28, 2026 23:39
@ianhattendorf ianhattendorf merged commit d67f876 into main Apr 28, 2026
7 checks passed
@ianhattendorf ianhattendorf deleted the ai-agent-status-bar-exploration branch April 28, 2026 23:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-ai Issues or features related to AI area-home Issues or features related to Home

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Show agent status in home view

3 participants