mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-16 04:01:56 +00:00
fix(coding-agent): only update extension in scope it's in
update(source) unconditionally called updateSourceForScope for both user and project scopes, creating a local install even when the source was only registered globally. Unify into a single code path that iterates settings per scope, filtering by identity when a source is provided.
This commit is contained in:
parent
7f78c383c9
commit
bc3fda518d
2 changed files with 5 additions and 6 deletions
|
|
@ -27,6 +27,7 @@
|
|||
- Fixed tree selector losing focus state when navigating entries ([#1142](https://github.com/badlogic/pi-mono/pull/1142) by [@Perlence](https://github.com/Perlence))
|
||||
- Fixed `cacheRetention` option not being passed through in `buildBaseOptions` ([#1154](https://github.com/badlogic/pi-mono/issues/1154))
|
||||
- Fixed OAuth login/refresh not using HTTP proxy settings (`HTTP_PROXY`, `HTTPS_PROXY` env vars) ([#1132](https://github.com/badlogic/pi-mono/issues/1132))
|
||||
- Fixed `pi update <source>` installing packages locally when the source is only registered globally ([#1163](https://github.com/badlogic/pi-mono/pull/1163) by [@aliou](https://github.com/aliou))
|
||||
|
||||
## [0.50.9] - 2026-02-01
|
||||
|
||||
|
|
|
|||
|
|
@ -742,20 +742,18 @@ export class DefaultPackageManager implements PackageManager {
|
|||
}
|
||||
|
||||
async update(source?: string): Promise<void> {
|
||||
if (source) {
|
||||
await this.updateSourceForScope(source, "user");
|
||||
await this.updateSourceForScope(source, "project");
|
||||
return;
|
||||
}
|
||||
|
||||
const globalSettings = this.settingsManager.getGlobalSettings();
|
||||
const projectSettings = this.settingsManager.getProjectSettings();
|
||||
const identity = source ? this.getPackageIdentity(source) : undefined;
|
||||
|
||||
for (const pkg of globalSettings.packages ?? []) {
|
||||
const sourceStr = typeof pkg === "string" ? pkg : pkg.source;
|
||||
if (identity && this.getPackageIdentity(sourceStr) !== identity) continue;
|
||||
await this.updateSourceForScope(sourceStr, "user");
|
||||
}
|
||||
for (const pkg of projectSettings.packages ?? []) {
|
||||
const sourceStr = typeof pkg === "string" ? pkg : pkg.source;
|
||||
if (identity && this.getPackageIdentity(sourceStr) !== identity) continue;
|
||||
await this.updateSourceForScope(sourceStr, "project");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue