feat(copilot): add first-class session detection, resume, model/allow-all config#851
Open
toughhou wants to merge 1 commit into
Open
feat(copilot): add first-class session detection, resume, model/allow-all config#851toughhou wants to merge 1 commit into
toughhou wants to merge 1 commit into
Conversation
…-all config - Add copilot_hooks.go: file-based session detection via ~/.copilot/session-state/ events.jsonl, command builder with --resume/--model/--allow-all, async detection - Wire copilot into Instance.Start(), PostStartSync(), SyncSessionIDs*(), clearSessionBindingForFreshStart() in instance.go - Extend CopilotOptions with Model/AllowAll fields and ToArgs() generation - Extend CopilotSettings with DefaultModel/AllowAll config (TOML) - Enhance copilot tmux patterns: busy indicators (Thinking, Generating, etc.), braille spinner regex, prompt pattern for idle detection - Add comprehensive tests in copilot_session_test.go and update copilot_test.go Closes asheshgoplani#556
SaitoJP
added a commit
to SaitoJP/agent-deck
that referenced
this pull request
May 12, 2026
Merge the changes from PR asheshgoplani#851 and translate the Copilot design note to Japanese. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds first-class GitHub Copilot CLI integration with session detection, resume support, and model/allow-all configuration — upgrading copilot from pattern-only support to full session-aware lifecycle management.
Motivation
Currently, agent-deck's copilot support is limited to basic tmux patterns for busy/idle detection. The Copilot CLI (
copilotv1.0+) supports--resume,--model,--allow-all, and writes session state to~/.copilot/session-state/<session-id>/events.jsonl. This PR enables agent-deck to:events.jsonlforsession.startevents matching the working directory)--resume <session-id>when conversation data exists~/.agent-deck.tomlconfigArchitecture
Follows the same file-based async detection pattern used by Codex integration:
copilot_hooks.go: Core implementation — session detection via~/.copilot/session-state/scanning, command builder, async goroutine detectorCOPILOT_CONFIG_DIRenv override for non-standard installationsChanges
New Files
internal/session/copilot_hooks.go— Session detection, command building, async detectioninternal/session/copilot_session_test.go— Comprehensive tests (disk detection, event parsing, command building)docs/feature-copilot/copilot-session-issues-and-improvements.md— Design documentModified Files
internal/session/instance.go— Added CopilotSessionID/Model/AllowAll fields, wired into Start(), PostStartSync(), SyncSessionIDs*(), clearSessionBinding()internal/session/tooloptions.go— Extended CopilotOptions with Model/AllowAll, updated ToArgs()internal/session/userconfig.go— Extended CopilotSettings with DefaultModel/AllowAll (TOML)internal/session/copilot_test.go— Updated existing tests for new config fieldsinternal/tmux/patterns.go— Enhanced copilot busy patterns (Thinking, Generating, Reading, Searching, Running, braille spinner) and prompt patternsConfig Example
Testing
go test ./internal/session/ -run Copilot)go test ./internal/tmux/ -run Pattern)go build ./...)Closes #556