dsh-github-copilot 0.4.0-alpha.117 → 0.4.0-alpha.119

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.js CHANGED
@@ -2998,7 +2998,7 @@ function createAccountProvider(descriptors, guard, baseURL) {
2998
2998
  var package_default = {
2999
2999
  name: "dsh-github-copilot",
3000
3000
  description: "DSH companion for GitHub Copilot sign-in, account-aware model profiles, tool compatibility, and provider-hosted search.",
3001
- version: "0.4.0-alpha.117",
3001
+ version: "0.4.0-alpha.119",
3002
3002
  publishConfig: {
3003
3003
  "access": "public",
3004
3004
  "registry": "https://registry.npmjs.org/",
@@ -3948,10 +3948,25 @@ var CopilotAccountsHost = class {
3948
3948
  fenced = true;
3949
3949
  if (!(await this.membership()).some((row) => row.id === accountId && row.configured)) fail("COPILOT_ACCOUNTS_SELECTED_MISSING");
3950
3950
  const binding = this.capture(accountId);
3951
- const signal = AbortSignal.any([this.abort.signal, AbortSignal.timeout(6e4)]);
3952
- await this.identity(binding, signal);
3953
- const identityKey = this.identities.get(accountId)?.key;
3954
- await this.validateModels(binding, signal);
3951
+ const preflightAbort = new AbortController();
3952
+ const signal = AbortSignal.any([
3953
+ this.abort.signal,
3954
+ preflightAbort.signal,
3955
+ AbortSignal.timeout(6e4)
3956
+ ]);
3957
+ const identity = (async () => {
3958
+ await this.identity(binding, signal);
3959
+ return this.identities.get(accountId)?.key;
3960
+ })();
3961
+ const models = this.validateModels(binding, signal);
3962
+ let identityKey;
3963
+ try {
3964
+ [identityKey] = await Promise.all([identity, models]);
3965
+ } catch (error) {
3966
+ preflightAbort.abort(error);
3967
+ await Promise.allSettled([identity, models]);
3968
+ throw error;
3969
+ }
3955
3970
  await this.assertIdentityCurrent(binding, identityKey);
3956
3971
  binding.assertCurrent();
3957
3972
  const finalRoute = this.routeDiagnostic();
@@ -8731,7 +8746,15 @@ let GitHubCopilotAuthorizationController = (() => {
8731
8746
  this.modelPreferenceFailure = void 0;
8732
8747
  const saved = view();
8733
8748
  const readback = field === "excludedModelIds" ? saved.excludedModelIds : saved.highCostModelIds;
8734
- if (!saved.writable || readback === void 0 || readback.length !== next.length || readback.some((id, index) => id !== next[index])) this.modelPreferenceFailure = "COPILOT_MODEL_EXCLUSION_SAVE_FAILED";
8749
+ if (!saved.writable || readback === void 0 || readback.length !== next.length || readback.some((id, index) => id !== next[index])) {
8750
+ this.modelPreferenceFailure = "COPILOT_MODEL_EXCLUSION_SAVE_FAILED";
8751
+ return {
8752
+ ...saved,
8753
+ state: "error",
8754
+ error: this.modelPreferenceFailure
8755
+ };
8756
+ }
8757
+ return saved;
8735
8758
  } catch (cause) {
8736
8759
  const record = object$3(cause);
8737
8760
  this.modelPreferenceFailure = record?.code === "SETTINGS_CONFLICT" || cause instanceof Error && /conflict/i.test(cause.message) ? "COPILOT_MODEL_EXCLUSION_CONFLICT" : "COPILOT_MODEL_EXCLUSION_SAVE_FAILED";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "dsh-github-copilot",
3
3
  "description": "DSH companion for GitHub Copilot sign-in, account-aware model profiles, tool compatibility, and provider-hosted search.",
4
- "version": "0.4.0-alpha.117",
4
+ "version": "0.4.0-alpha.119",
5
5
  "publishConfig": {
6
6
  "access": "public",
7
7
  "registry": "https://registry.npmjs.org/",