You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
🐛 Copilot: an agent's config.json silently stops following the shared login, and restarts never re-link it #18443
On the Bluefin hosted hive, the scanner agent was stuck at a Copilot login prompt while every other agent worked. The device-flow login from the dashboard succeeded and wrote the new login to the shared file, but scanner never picked it up. The hive restarted scanner three times, then gave up.
Root cause
The link breaks silently. Each agent's ~/.copilot/config.json is meant to be a symlink to the shared /data/home/.copilot/config.json (src/crux/agent/interactive_home.go ~125, 142-144). The Copilot CLI saves its config by writing a temp file and renaming it over the original. That replaces the symlink with a private regular file. A leftover config.json.tmp.* in the shared folder is consistent with this. On Bluefin, scanner's CLI saved a private copy with no login in it, and the agent was stranded.
Restarts never repair it.bridgeHomeEntry never replaces a real file (interactive_home.go ~315-317). Claude credentials have a re-link step first (rebridgeClaudeCredential, ~428-433), but Copilot has none. Token sync only writes the shared file (manager_tokens.go ~618, 689).
The health check looks at the wrong file. The "has a valid credential" check passes on the shared file or the in-memory token (authprobe.go ~352-362), not on the file the agent actually reads. So the hive kept restarting (manager_poll.go ~219) and gave up (manager_poll.go ~201) while the agent was still logged out.
The other agents are at risk. On the same hive, every other agent also holds a private regular file, not a link. They only work because those copies still carry an older token. They will all fail the same way when it expires.
Fix
Before launching an agent, and on restart, if ~/.copilot/config.json is a regular file rather than a link to the shared file:
move it aside to config.json.bak-<timestamp>, keeping only the newest backup;
re-link it to the shared file, mirroring rebridgeClaudeCredential.
After the CLI rewrites the file mid-run, the next restart repairs it. Optionally, a watchdog re-links on change.
Make the Copilot credential check evaluate the file the agent actually reads, so a broken per-agent copy is detected and repaired rather than restarted endlessly.
Never log file contents. Tests use fixtures without real tokens.
Tests: a regular-file copy with an empty login gets re-linked on restart. A valid symlink is left alone. The backup is created. The health check fails when the per-agent file differs from the shared one. Repeated restarts converge.
Manual workaround until fixed
Move the agent's ~/.copilot/config.json aside, then restart only that agent with POST /api/restart/<agent>.
@clubanderson this issue was closed by @kubestellar-prow[bot] as completed.
If this was closed by a merged PR, the fix only takes effect once it ships in a tagged release and your deployment updates to it — check your running version against the fix before concluding the fix failed.
If you are still seeing the problem, comment /reopen and it will be reopened for you — you do not need write access. Please add what you are still observing (running version, logs, steps) so it is not closed the same way again.
Fixed by #18445 (merged as 4db377b). Agent launch and restart now move a private Copilot config.json aside to config.json.bak- (newest backup kept) and relink it to the shared login; the Copilot credential probe evaluates the file the agent actually reads, and the pane poller relinks a diverged copy before the token-triggered restart. Stale config.json.tmp.* files older than HIVE_COPILOT_CONFIG_TMP_MAX_AGE (default 1h) are swept at launch. Existing hives pick this up on the next agent restart after upgrading.
Activity
clubanderson commentedon Nov 16, 2026
working this in a PR now
github-actions commentedon Nov 16, 2026
@clubanderson this issue was closed by @kubestellar-prow[bot] as completed.
If this was closed by a merged PR, the fix only takes effect once it ships in a tagged release and your deployment updates to it — check your running version against the fix before concluding the fix failed.
If you are still seeing the problem, comment
/reopenand it will be reopened for you — you do not need write access. Please add what you are still observing (running version, logs, steps) so it is not closed the same way again.clubanderson commentedon Nov 16, 2026
Fixed by #18445 (merged as 4db377b). Agent launch and restart now move a private Copilot config.json aside to config.json.bak- (newest backup kept) and relink it to the shared login; the Copilot credential probe evaluates the file the agent actually reads, and the pane poller relinks a diverged copy before the token-triggered restart. Stale config.json.tmp.* files older than HIVE_COPILOT_CONFIG_TMP_MAX_AGE (default 1h) are swept at launch. Existing hives pick this up on the next agent restart after upgrading.