Describe the bug
Summary
/resume is effectively unusable for any session that was created while the
working directory was NOT a git repository. Such sessions store
repository = '/', and the resume picker's git gate then makes them
impossible to select — a true catch-22. Separately, cross-machine sessions
can't be recovered, and --connect silently starts an empty session instead
of surfacing the problem.
Environment
The catch-22 (core bug)
A session created outside a git repo has repository = '/' in its metadata
(upstream cause: #2655 — cwd/branch/repository not persisted). The /resume
picker enforces two mutually exclusive requirements:
- Must be INSIDE a git repo, else:
Error: Not in a git repository. Please navigate to your repository directory.
- The repo must EQUAL the session's stored repo (
'/'), else:
Error: Repository mismatch: You are in 'owner/name' but the remote session is for '/'.
No directory satisfies both. In a repo → mismatch; not in a repo → "not a git
repository." The session becomes permanently unreachable via the picker.
Reproduction
- Run
copilot in a NON-git folder, hold a conversation, exit.
- Later, from a git repo:
copilot → /resume → pick that session
→ "Repository mismatch … session is for '/'".
- From a non-git folder:
copilot → /resume → "Not in a git repository."
Workarounds attempted (all fail)
copilot --resume=<id> → No session, task, or name matched (session isn't
in this machine's local store when it originated elsewhere).
- Running
/resume from a non-git dir → "Not in a git repository."
copilot --connect=<id> → bypasses the git gate BUT starts a brand-new empty
session (returns NO-HISTORY, emits a fresh --resume=<new-id>); the original
transcript is not recovered.
Impact
- Sessions created before a folder became a git repo are lost to
/resume
(e.g., a session started, then git init run later — the very act of adding
git makes prior sessions unmatchable).
- Cross-machine continuation is broken: a session created on machine A cannot be
resumed on machine B at all.
--connect failing silently (new empty session) hides the real problem.
Suggested fixes
- Treat stored
repository of '/' or empty as "unscoped" and SKIP the
repository-match gate for those sessions — allow resume from any directory.
- Don't hard-require a git repo to open the resume picker; git context should
be optional metadata, not a precondition.
- When
--connect can't attach to the requested session, error explicitly
instead of spawning a new empty session.
Related issues
#3694 (repo-name mismatch, closed), #2655 (repo/cwd not persisted),
#2446, #3671 (cloud-session resume), #3908 (empty resume dir),
#2836 (orphaned session folders), #1381 (rewind git gate), #3931.
Affected version
GitHub Copilot CLI: 1.0.69-0
Steps to reproduce the behavior
Reproduction
- Run
copilot in a NON-git folder, hold a conversation, exit.
- Later, from a git repo:
copilot → /resume → pick that session
→ "Repository mismatch … session is for '/'".
- From a non-git folder:
copilot → /resume → "Not in a git repository."
Expected behavior
Session should resume.
Additional context
Environment
Describe the bug
Summary
/resumeis effectively unusable for any session that was created while theworking directory was NOT a git repository. Such sessions store
repository = '/', and the resume picker's git gate then makes themimpossible to select — a true catch-22. Separately, cross-machine sessions
can't be recovered, and
--connectsilently starts an empty session insteadof surfacing the problem.
Environment
The catch-22 (core bug)
A session created outside a git repo has
repository = '/'in its metadata(upstream cause: #2655 — cwd/branch/repository not persisted). The
/resumepicker enforces two mutually exclusive requirements:
Error: Not in a git repository. Please navigate to your repository directory.'/'), else:Error: Repository mismatch: You are in 'owner/name' but the remote session is for '/'.No directory satisfies both. In a repo → mismatch; not in a repo → "not a git
repository." The session becomes permanently unreachable via the picker.
Reproduction
copilotin a NON-git folder, hold a conversation, exit.copilot→/resume→ pick that session→ "Repository mismatch … session is for '/'".
copilot→/resume→ "Not in a git repository."Workarounds attempted (all fail)
copilot --resume=<id>→No session, task, or name matched(session isn'tin this machine's local store when it originated elsewhere).
/resumefrom a non-git dir → "Not in a git repository."copilot --connect=<id>→ bypasses the git gate BUT starts a brand-new emptysession (returns
NO-HISTORY, emits a fresh--resume=<new-id>); the originaltranscript is not recovered.
Impact
/resume(e.g., a session started, then
git initrun later — the very act of addinggit makes prior sessions unmatchable).
resumed on machine B at all.
--connectfailing silently (new empty session) hides the real problem.Suggested fixes
repositoryof'/'or empty as "unscoped" and SKIP therepository-match gate for those sessions — allow resume from any directory.
be optional metadata, not a precondition.
--connectcan't attach to the requested session, error explicitlyinstead of spawning a new empty session.
Related issues
#3694 (repo-name mismatch, closed), #2655 (repo/cwd not persisted),
#2446, #3671 (cloud-session resume), #3908 (empty resume dir),
#2836 (orphaned session folders), #1381 (rewind git gate), #3931.
Affected version
GitHub Copilot CLI: 1.0.69-0
Steps to reproduce the behavior
Reproduction
copilotin a NON-git folder, hold a conversation, exit.copilot→/resume→ pick that session→ "Repository mismatch … session is for '/'".
copilot→/resume→ "Not in a git repository."Expected behavior
Session should resume.
Additional context
Environment