Describe the bug
/resume (and copilot --resume) filters sessions by the current git repository, but newly created sessions are missing git_root, repository, and branch fields in their workspace.yaml. This causes them to be invisible in the session picker.
Root cause
In the CLI source, initializeWorkspace() only passes {cwd: workingDir} when creating a new session — it does not call git detection (the jF() function that runs git rev-parse, etc.). Git context is only populated on the resume path via updateContext().
As a result, every new session's workspace.yaml looks like:
id: 257baeb7-2c85-4c1c-870f-9cf2dd1b704d
cwd: /root/copilot-workspace
summary: Add Root Directories To Allow List
created_at: 2026-04-01T13:24:42.022Z
Missing: git_root, repository, branch, host_type.
When /resume filters by the current repository, these sessions don't match and are excluded from the list.
Affected version
GitHub Copilot CLI 1.0.14 (confirmed also present in earlier versions).
Steps to reproduce
cd into a git repository
- Run
copilot — a new session starts
- Have a conversation (so the session is non-empty)
- Exit the session
- Run
copilot again, then /resume
- The session from step 2 may not appear in the picker (depending on how many older sessions with correct git fields exist)
Alternatively, inspect ~/.copilot/session-state/<session-id>/workspace.yaml for any recently created session — git_root, repository, and branch will be absent even though the working directory is inside a git repo.
Expected behavior
New sessions should have git context populated in workspace.yaml at creation time, so /resume can find them.
Workaround
Manually patch workspace.yaml for affected sessions:
cd ~/.copilot/session-state
for dir in */; do
yaml="$dir/workspace.yaml"
if [ -f "$yaml" ] && ! grep -q "git_root:" "$yaml"; then
cat >> "$yaml" << EOF
git_root: /path/to/your/repo
repository: owner/repo-name
branch: main
host_type: github
EOF
fi
done
Describe the bug
/resume(andcopilot --resume) filters sessions by the current git repository, but newly created sessions are missinggit_root,repository, andbranchfields in theirworkspace.yaml. This causes them to be invisible in the session picker.Root cause
In the CLI source,
initializeWorkspace()only passes{cwd: workingDir}when creating a new session — it does not call git detection (thejF()function that runsgit rev-parse, etc.). Git context is only populated on the resume path viaupdateContext().As a result, every new session's
workspace.yamllooks like:Missing:
git_root,repository,branch,host_type.When
/resumefilters by the current repository, these sessions don't match and are excluded from the list.Affected version
GitHub Copilot CLI 1.0.14 (confirmed also present in earlier versions).
Steps to reproduce
cdinto a git repositorycopilot— a new session startscopilotagain, then/resumeAlternatively, inspect
~/.copilot/session-state/<session-id>/workspace.yamlfor any recently created session —git_root,repository, andbranchwill be absent even though the working directory is inside a git repo.Expected behavior
New sessions should have git context populated in
workspace.yamlat creation time, so/resumecan find them.Workaround
Manually patch
workspace.yamlfor affected sessions: