Skip to content

Open-source AI browser agent for Chrome and Firefox (monorepo) 🧠

Merge main into research-sharing branch

Emre Sokullu6c3c131a5de9
diff --cc src/chrome/src/providers/manager.js
index eb03b90f2,54fe85ea6..77a0b5719
--- a/src/chrome/src/providers/manager.js
+++ b/src/chrome/src/providers/manager.js
@@@ -1886,12 -1927,25 +1956,31 @@@ export class ProviderManager
}
}
this.providers.set(id, this._createProvider(id, merged));
+ // Revocation is permanent for queued data, even if sharing is enabled
+ // again before another agent run. Await deletion before acknowledging it.
+ // Explicit off updates also retry a previously failed purge.
+ if (Object.hasOwn(updates, 'shareQueriesForResearch') && merged.shareQueriesForResearch !== true) {
+ await purgeShareGenerations(entry => String(entry?.provider_id || '') === id);
+ }
+ // Editing the model of the active WebGPU provider to an undownloaded
+ // target would leave every chat failing readiness (setActive() guards
+ // selection but not edits). Fall back so the active selection stays usable.
+ if (id === 'webgpu' && this.activeProviderId === 'webgpu' && Object.hasOwn(updates, 'model')) {
+ try {
+ const download = await this.providers.get('webgpu')?.downloadStatus?.();
+ if (download && download.ready !== true) {
+ const fallback = this.providers.has(WEBBRAIN_CLOUD_PROVIDER_ID)
+ ? WEBBRAIN_CLOUD_PROVIDER_ID
+ : [...this.providers.keys()].find((candidate) => candidate !== 'webgpu') || WEBBRAIN_CLOUD_PROVIDER_ID;
+ // Reuse normal switching so the abandoned resident model releases
+ // its GPU allocations as well as persisting the new selection.
+ await this.setActive(fallback);
+ return;
+ }
+ } catch {
+ // Probe failures must not block saving; chat will report the missing download.
+ }
+ }
await this.save();
}