fix(coding-agent): add offline startup mode and network timeouts (#1631)

This commit is contained in:
Matteo Collina 2026-02-25 19:44:49 +01:00 committed by GitHub
parent f129ac93c5
commit 757d36a41b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 147 additions and 8 deletions

View file

@ -65,6 +65,11 @@ function reportSettingsErrors(settingsManager: SettingsManager, context: string)
}
}
function isTruthyEnvFlag(value: string | undefined): boolean {
if (!value) return false;
return value === "1" || value.toLowerCase() === "true" || value.toLowerCase() === "yes";
}
type PackageCommand = "install" | "remove" | "update" | "list";
interface PackageCommandOptions {
@ -535,6 +540,12 @@ async function handleConfigCommand(args: string[]): Promise<boolean> {
}
export async function main(args: string[]) {
const offlineMode = args.includes("--offline") || isTruthyEnvFlag(process.env.PI_OFFLINE);
if (offlineMode) {
process.env.PI_OFFLINE = "1";
process.env.PI_SKIP_VERSION_CHECK = "1";
}
if (await handlePackageCommand(args)) {
return;
}