Commit Graph
3 Commits
Author SHA1 Message Date
yetone 411769e9c7 library: GitHub Copilot gets the Library's instructions with VS Code or JetBrains alone
@codealc on X (0.1.3827, Windows, Codex with Copilot as the provider):
资源库 › 指令 has no way to give GitHub Copilot instructions. The only
Copilot row was Copilot CLI's, listed only when the CLI was detected
(settings.json or the copilot command) and not uninstalled, so a user of
Copilot in VS Code or JetBrains saw none.

Which file Copilot reads, from each surface's own source:
- Copilot CLI 1.0.95: $COPILOT_HOME/copilot-instructions.md, else
  ~/.copilot/copilot-instructions.md (run for real, below).
- VS Code (microsoft/vscode d95071e96, promptsServiceImpl /
  computeAutomaticInstructions): ~/.copilot/copilot-instructions.md, plus
  ~/.copilot/instructions/**/*.instructions.md; its docs' reference table
  gives the same for the Copilot harness's user scope.
- GitHub Copilot for JetBrains 1.21.0 (javap of the plugin's classes):
  getCopilotCliHomePath() (COPILOT_HOME, else ~/.copilot) +
  copilot-instructions.md.

So Copilot CLI's agent now has shared "GitHub Copilot" (as Cursor CLI's
~/.cursor is the Cursor editor's) and a sharedApp check: VS Code, VS Code
Insiders, or the JetBrains plugin is here. agent.SharedRead says so;
SharedHere is true with it even before ~/.copilot exists, and
targetsAsleep keeps a CLIMissing agent whose folder such an app still
reads. The Library's row is named GitHub Copilot; the agent stays Copilot
CLI on the Agents page. SharedName also names Copilot CLI's chats in
Sessions, which are now "GitHub Copilot" as Cursor CLI's are "Cursor".
The user's own text in copilot-instructions.md stays outside magpie's
block, and comes back whole when magpie's instructions are emptied.

Tests (internal/library/copilot_shared_test.go): row named GitHub
Copilot; VS Code alone (no ~/.copilot) gets the row and the file written
without making Copilot CLI detected; JetBrains plugin alone; the user's
own file kept; CLI uninstalled with VS Code still here keeps the row,
with nothing reading it drops it; COPILOT_HOME followed.
TestCursorIsCursorCLI and TestCursorFolderFromTheEditorIsNotTheCLI now
allow Copilot beside Cursor.

Run:
- The six new tests on the old code (source files checked out from
  aa358555f, new test kept): all six red. Broken by hand: the
  targetsAsleep `&& !a.SharedRead()` taken out turns
  TestCopilotCLIGoneVSCodeKeepsTheRow red.
- go test ./internal/library -run Copilot on win-run (Windows 11) and
  wsl-run (Ubuntu 24.04): ok.
- Real Copilot CLI 1.0.95 with COPILOT_HOME at a scratch folder (signed-in
  config copied there, cwd an empty folder), copilot-instructions.md
  holding a user section and magpie's block with a codeword: copilot -p
  answered the codeword; without the file it answered NONE.
- gofmt -l internal: nothing. go vet ./..., GOOS=linux go vet -tags nogui
  ./..., GOOS=windows go vet ./... (mica): ok.
- Full go test -timeout 45m ./... on mote at f32bdee76 (rebased on
  0b8c4bfc3): 99 ok, red only TestEveryRouteHasACommandOrIsNamed
  (#6677, POST /api/providers/delete) and TestEveryWordHasZh (#6686, "permission
  mode"), both red alone on a fresh origin/main 221c91fae.
- Rebased on 221c91fae (6 commits, none in internal/library or the
  agent files here): library, agent, cli, tui and gui packages again at
  6946baa72: library, agent, gui ok; cli and tui red only on #6677 and #6686.
- Rebased on a4dd893af (5 commits in gui/admin, gateway, docs; none in
  library or agent): library, agent and gui again at the pushed head: ok.

Not changed: no GUI file; the row's name comes from the server.
Not tried: VS Code and JetBrains reading the file for real (read from
their source only).
2026-11-15 00:23:13 +08:00
yetone b75e21be31 agent: the Qoder app counts as Qoder again, found by the status file it writes to ~/.qoder (#2138, xiaozicoder)
xiaozicoder's Windows 11 has the Qoder app and the Qoder CN app
(Qoder-win-x64-user.exe, Qoder-CN-win-x64-user.exe from qoder.com and
qoder.cn) and no qodercli, and since v0.1.1220 magpie's Agents page lists
no Qoder at all. Qoder-win-x64-user.exe is the Qoder app (com.qoder.app,
qoder-app/releases/latest.yml at 0.4.7), not the Qoder IDE. Its app.asar
runs Qoder's CLI as its agent (qodercli 1.1.64's worker runtime, config dir
.qoder / .qoder-cn, QODER_CONFIG_DIR, with BYOK config management), so
~/.qoder/settings.json's providers.magpie reaches it. It writes the
enabledPlugins of its bundled qoder-context plugin to settings.json, which
alone stopped counting in the same change, so the app's Qoder was lost.

The app also writes .qoder-app-status.json (-canary-, -dev- for its other
channels) into ~/.qoder, or ~/.qoder-cn for the China product (the map is
in its app.asar; this Mac's Qoder.app 0.4.3 wrote one). Agent gets sign, one
more sign the agent is here for a dirShared folder, and Qoder's (both
builds) is that file. The JetBrains plugin's folder of #1495 has none, so it
still isn't Qoder.

Run: TestQoderAppIsQoder (both builds: plugin-only settings.json not
detected; each of the three status files detected; the status file with no
settings.json detected; a folder of that name not) red on the old code
(Qoder CN subtests fail), green now; TestQoderSettingsFromAnIDEPluginIsNotTheCLI
still green; go test ./internal/agent -count=1 -timeout 45m ok (1576s, the
machine at load ~350; a first run hit the default 10m package timeout mid
TestCodexAgentsV1WarnsWhenCodexOwnV2IsOn at 1s, not a hang). gofmt -l
clean; go vet darwin, GOOS=linux -tags nogui, GOOS=windows clean. A
nogui build's `magpie ls` in a sandbox HOME (PATH=/usr/bin:/bin) with
~/.qoder holding the plugin-only settings.json and a copy of this Mac's real
.qoder-app-status.json, and ~/.qoder-cn the same with a qoder-cn status,
lists Qoder and Qoder CN.
Not tried: the Qoder app on Windows itself, and whether its agent takes
magpie's provider from settings.json in practice (would need a live
~/.qoder changed).
2026-10-14 18:21:44 +08:00
yetone c6da41b04c agent: an IDE plugin's ~/.copilot or ~/.qoder-cn isn't taken for the CLI (#1495, v5tech)
v5tech traced two agents listed with no CLI installed to the JetBrains
plugins that write the CLI's folder:
- GitHub Copilot's JetBrains plugin writes ~/.copilot (ide/, instructions/,
  prompts/, agents/, skills/, hooks/; the paths are in its jar). Copilot
  CLI was detected by that folder alone.
- Qoder CN's JetBrains plugin fills ~/.qoder-cn (its indexer in
  shared_client/, app/, plugins/) and writes a settings.json holding only
  {"enabledPlugins":{...}}, which is the CLI's Path, so the CLI was found
  by its "config file".

What changed:
- Copilot CLI sets dirShared, as omp does for Pi's folder: settings.json
  or the copilot command still finds it.
- Agent gets pathOwn: when set, the file at Path counts only if it says
  the file is the agent's. Qoder (both builds, one qoderAt) sets dirShared
  and pathOwn = !qoderPluginOnly: a settings.json that parses as an object
  of enabledPlugins alone is the plugin's. Any other key, {}, or a file
  that can't be read or parsed still counts (unknown is not "the
  plugin's"), and so does qodercli / qoderclicn on PATH. The global build
  is held to the same because the code and the plugin are shared; that
  the intl plugin writes ~/.qoder the same way is by analogy, not seen.
- docs/subsystems/agent-wiring.md says so.

Run: go test ./internal/agent/ -count=1 (ok, 226s), including the new
TestCopilotFolderFromAnIDEPluginIsNotTheCLI and
TestQoderSettingsFromAnIDEPluginIsNotTheCLI (the reporter's folders,
then the command on PATH, then the CLI's own settings).
Broken by hand: Copilot's dirShared off -> the Copilot test fails; Qoder's
pathOwn nil -> both qoder subtests fail; Qoder's dirShared off -> both
fail.
Not tried: a real JetBrains plugin or Qoder CLI; WSL (its probe counts the
distro's folder and isn't changed; a Windows JetBrains writes the Windows
home, not the distro's).
2026-10-13 07:07:18 +08:00