Skip to content

Add built-in support for GitHub Copilot CLI agent#23

Merged
nicosuave merged 3 commits intosidequery:mainfrom
greggroth:copilot-cli
Mar 3, 2026
Merged

Add built-in support for GitHub Copilot CLI agent#23
nicosuave merged 3 commits intosidequery:mainfrom
greggroth:copilot-cli

Conversation

@greggroth
Copy link

Summary

Add Copilot CLI as a supported agent alongside Claude, Codex, and OpenCode.

Changes

Session Discovery & Parsing

  • WorktrunkStore.swift: New .copilotCli case in SessionSource enum, copilotCli dictionary in SessionIndex, session scanning of ~/.copilot/session-state/, and parseCopilotCliSession() which reads workspace.yaml for metadata and events.jsonl for timestamps, user message counts, and snippets.

Agent Lifecycle Events

  • AgentHookInstaller.swift: Wrapper script for copilot binary that emits Start/Stop events to agent-events.jsonl (Copilot CLI lacks a native hooks mechanism unlike Claude/Codex).
  • AgentStatusPaths.swift: New copilotCliWrapperPath constant.

Preferences & Resume

  • WorktrunkPreferences.swift: New .copilotCli cases in WorktrunkAgent and WorktrunkDefaultAction enums.
  • TerminalController.swift: Resume support via copilot --resume <sessionId>.

Shell Integration

  • ghostty.bash and ghostty-integration (zsh): Added copilot() wrapper functions matching the existing claude/codex pattern.

Testing

  • Builds successfully with zig build
  • Follows identical patterns to existing Claude/Codex/OpenCode integrations

greggroth and others added 3 commits March 2, 2026 14:19
Add Copilot CLI as a supported agent alongside Claude, Codex, and
OpenCode. This includes:

- SessionSource: new .copilotCli case with icon and label
- SessionIndex: new copilotCli dictionary for index caching
- Session scanning: discovers sessions from ~/.copilot/session-state/
- Session parsing: reads workspace.yaml for metadata and events.jsonl
  for timestamps, user message counts, and snippets
- Agent wrapper: shell script that emits Start/Stop lifecycle events
  to agent-events.jsonl (Copilot CLI lacks native hooks)
- Shell integration: copilot() wrapper functions for bash and zsh

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add Copilot CLI as a supported agent alongside Claude, Codex, and
OpenCode. This includes:

- SessionSource: new .copilotCli case with icon and label
- SessionIndex: new copilotCli dictionary for index caching
- Session scanning: discovers sessions from ~/.copilot/session-state/
- Session parsing: reads workspace.yaml for metadata and events.jsonl
  for timestamps, user message counts, and snippets
- Agent wrapper: shell script that emits Start/Stop lifecycle events
  to agent-events.jsonl (Copilot CLI lacks native hooks)
- Shell integration: copilot() wrapper functions for bash and zsh
- WorktrunkAgent/WorktrunkDefaultAction: new .copilotCli cases
- TerminalController: resume support via copilot --resume

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@nicosuave
Copy link
Member

Thanks for this @greggroth

@nicosuave nicosuave merged commit 028b06b into sidequery:main Mar 3, 2026
60 of 61 checks passed
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.

2 participants