Merge pull request #2566 from jeremymcs/fix/hydrate-remote-tokens-esm
fix(remote-questions): use static ESM import for AuthStorage hydration
This commit is contained in:
commit
874df9bc43
1 changed files with 3 additions and 5 deletions
|
|
@ -2,7 +2,7 @@
|
|||
* Remote Questions — configuration resolution and validation
|
||||
*/
|
||||
|
||||
import { join } from "node:path";
|
||||
import { AuthStorage } from "@gsd/pi-coding-agent";
|
||||
import { loadEffectiveGSDPreferences, type RemoteQuestionsConfig } from "../gsd/preferences.js";
|
||||
import type { RemoteChannel } from "./types.js";
|
||||
|
||||
|
|
@ -54,9 +54,7 @@ function hydrateRemoteTokensFromAuth(): void {
|
|||
if (needed.length === 0) return;
|
||||
|
||||
try {
|
||||
const { AuthStorage } = require("@gsd/pi-coding-agent") as typeof import("@gsd/pi-coding-agent");
|
||||
const authPath = join(process.env.HOME ?? "~", ".gsd", "agent", "auth.json");
|
||||
const auth = AuthStorage.create(authPath);
|
||||
const auth = AuthStorage.create();
|
||||
|
||||
for (const [providerId, envVar] of needed) {
|
||||
try {
|
||||
|
|
@ -72,7 +70,7 @@ function hydrateRemoteTokensFromAuth(): void {
|
|||
}
|
||||
}
|
||||
} catch {
|
||||
// AuthStorage unavailable (unit tests, stripped build) — skip silently.
|
||||
// AuthStorage unavailable or auth.json missing/unreadable — skip silently.
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue