Custom-agent session creation races deferred worktree checkout and fails with “Custom agent not found”
Nessuno ha ancora preso questa issue.
- Lingua principale
- Nessun dato sulla lingua
- Stelle
- 2.1k
- Fork
- 157
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
Short summary
Custom-agent session creation races deferred worktree checkout and fails with “Custom agent not found”
Affected version or release
1.1.19
Installation context
- GitHub Copilot App:
1.1.19 - Bundled Copilot CLI:
1.0.84-4 - OS: Windows 11, x86_64
- Project type: local Git repository
- Session workspace type: worktree
What happened?
Starting a new worktree session with a repository-defined custom agent selected for the initial kickoff intermittently or consistently fails with:
Failed to create session: RPC error -32603: Request session.create failed with message: session construction failed: Custom agent 'orchestrator' not found
Repository setup
The default branch contains:
.github/
└── agents/
└── orchestrator.agent.md
The agent is visible in the custom-agent selector before session creation.
Steps to reproduce
- Open a local Git repository in GitHub Copilot App.
- Commit a user-invocable custom agent to:
.github/agents/orchestrator.agent.md. - Create a new worktree-backed session.
- Select
orchestratoras the custom agent. - Provide an initial kickoff prompt so the session starts immediately.
- Create the session.
Session creation fails:
RPC error -32603: Request session.create failed with message:
session construction failed: Custom agent 'orchestrator' not found
The worktree itself is created, but its session does not start with the selected agent.
Expected behavior
The application completes checkout of the new worktree before constructing the session, or resolves the selected repository agent from the project's existing checkout.
The worktree session starts using the selected orchestrator agent.
Additional context
Impact
Repository custom agents cannot reliably be selected when creating worktree-backed sessions with an initial prompt.
Suspected cause
Worktree creation and session construction are running concurrently:
- An incomplete worktree is exposed with
deferred_checkout=true. session.createperforms repository configuration discovery..github/agents/has not been populated yet.- Validation of the selected agent fails.
- Deferred checkout completes afterward.
Log evidence
The relevant sequence is:
12:02:07.979 create worktree completed
deferred_checkout=true
12:02:08.327 kickoff: creating session
12:02:08.334 session.create begins with
enable_config_discovery=true
12:02:08.621 session creation failed:
Custom agent 'orchestrator' not found
12:02:10.864 deferred worktree checkout complete
Suggested fixes
- Make agent-dependent
session.createwait for deferred checkout completion. - Resolve the selected repository custom agent from the project's fully populated main checkout while the worktree is being initialized.
- Preload the selected agent profile before beginning deferred checkout.
- Disable deferred checkout when the kickoff specifies a repository-defined custom agent.
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia tracciando session.create e il checkout differito del worktree usando i passaggi di riproduzione e la sequenza di log fornita. Esamina come viene individuato .github/agents/orchestrator.agent.md prima e dopo il checkout. Il lavoro è completato quando un avvio basato su worktree inizia in modo affidabile con l’agente del repository selezionato e l’ordine del checkout e della costruzione della sessione è coperto dai test pertinenti del progetto.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- git, github
- Ambito
- desktop, developer-experience
- Tipo di issue
- Bug
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Attiva
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 52/100