- report Copilot CLI version freshness as latest, outdated, or unknown - expose active Copilot account metadata from the SDK auth status - add best-effort GitHub organization context when gh is available - document the frontend follow-up in HANDOVER.md Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
6.0 KiB
Handover: Copilot version + account context UI
This document is for the frontend/UX agent that will extend the existing Copilot connection UI.
Goal
Build on top of the current Settings → AI Provider → Connection view so it can show:
- whether the installed Copilot CLI is current or outdated
- which GitHub account Copilot is currently using
- organization context when it can be discovered
Do not add provider-secret management for this flow. Kopaya still relies on the system-installed GitHub Copilot CLI.
Backend changes now implemented
1. SidecarCapabilities.connection has new structured fields
File: src/shared/contracts/sidecar.ts
New payload shape:
connection: {
status: 'ready' | 'copilot-cli-missing' | 'copilot-auth-required' | 'copilot-error';
summary: string;
detail?: string;
copilotCliPath?: string;
checkedAt: string;
copilotCliVersion?: {
status: 'latest' | 'outdated' | 'unknown';
installedVersion?: string;
latestVersion?: string;
detail?: string;
};
account?: {
authenticated: boolean;
login?: string;
host?: string;
authType?: string;
statusMessage?: string;
organizations?: string[];
};
}
2. Version state is now resolved by the sidecar
Files:
sidecar/src/Kopaya.AgentHost/Services/CopilotConnectionMetadataResolver.cssidecar/src/Kopaya.AgentHost/Services/SidecarProtocolHost.cs
The sidecar now runs copilot version and classifies the result as:
latest: the CLI explicitly reported that the install is currentoutdated: the CLI reported that a newer version is availableunknown: the version command timed out, failed, or did not return a recognizable update state
Important nuance:
- this does not change
connection.status connection.statusstill means install/auth/model-list health- version freshness is a separate concern and should be rendered separately in the UI
3. Account context is now resolved by the sidecar
Files:
sidecar/src/Kopaya.AgentHost/Services/CopilotConnectionMetadataResolver.cssidecar/src/Kopaya.AgentHost/Services/SidecarProtocolHost.cs
The sidecar now uses the Copilot SDK auth-status call to populate:
account.authenticatedaccount.loginaccount.hostaccount.authTypeaccount.statusMessage
4. Organization context is best-effort
When the Copilot auth status provides a login + host, the sidecar also makes a best-effort gh CLI lookup for org memberships:
- it verifies the
ghauthenticated user matches the Copilot login on the same host - if that succeeds, it fetches
user/orgs - those org logins are returned as
account.organizations
Important nuance:
organizationsmay be missing entirely- that can mean
ghis not installed, not authenticated, lacksread:org, timed out, or the accounts did not match - the frontend should treat organizations as optional enhancement data, not a guaranteed field
Files changed
Backend / shared contracts:
src/shared/contracts/sidecar.tssidecar/src/Kopaya.AgentHost/Contracts/ProtocolModels.cssidecar/src/Kopaya.AgentHost/Services/SidecarProtocolHost.cssidecar/src/Kopaya.AgentHost/Services/CopilotConnectionMetadataResolver.cs
Tests:
sidecar/tests/Kopaya.AgentHost.Tests/SidecarProtocolHostTests.cssidecar/tests/Kopaya.AgentHost.Tests/CopilotConnectionMetadataResolverTests.cs
Validation status
Validated successfully after the change:
bun testdotnet test sidecar\Kopaya.AgentHost.slnx -p:BaseOutputPath="<session-sidecar-build-path>"
Current renderer state
There is already a Copilot settings surface:
src/renderer/components/SettingsPanel.tsxsrc/renderer/components/CopilotStatusCard.tsx
Current behavior:
- shows connection readiness / missing CLI / auth required / generic error
- shows model count, CLI path, and checked timestamp
- does not yet render the new
copilotCliVersionoraccountfields
Recommended frontend follow-up
1. Show the active GitHub account prominently
Good options:
- a compact identity row like
davidkaya · github.com - a small pill/chip under the connection status
- a labeled metadata grid in the expanded details area
Suggested fallback behavior:
- if
account.loginexists, show it - if
account.hostexists, show it next to the login - if
account.statusMessageexists but login is missing, use that as secondary text
2. Show CLI freshness as a separate badge/state
Recommended mapping:
latest→ subtle positive/neutral badge likeUp to dateoutdated→ amber warning badge likeUpdate availableunknown→ low-emphasis muted label likeVersion unknown
Good details to show in the expanded area:
- installed version
- latest version (when known)
- raw
detailtext only as secondary / technical detail
3. Show organizations only when present
If account.organizations exists and has values:
- render them as small pills/tags
- cap the visible count if the list is long
- consider
+N moreif there are many
If it is missing:
- do not show an empty placeholder
- fall back to host/account info instead
4. Keep account/version separate from the main connection summary
Do not overload the existing top-level connection state.
Recommended mental model:
- main status row = “Can Kopaya use Copilot right now?”
- version badge = “Should the CLI be updated?”
- account info = “Who is Kopaya connected as?”
- org pills = “What org context is discoverable?”
Suggested UI copy
For account:
Signed in as davidkayagithub.com
For version:
Copilot CLI is up to dateCopilot CLI update availableCould not determine Copilot CLI version
For orgs:
Organizations
Non-goals of this backend change
Still not implemented:
- an in-app
copilot updateaction - an in-app
copilot loginaction - direct provider credentials for OpenAI / Anthropic / Google
- guaranteed authoritative “active organization” selection semantics
The new org data is “best effort discovered context,” not a firm entitlement model.