@volter/supercode-frontend-vscode 0.1.44 → 0.1.45

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.
Files changed (2) hide show
  1. package/dist/extension.js +12 -10
  2. package/package.json +1 -1
package/dist/extension.js CHANGED
@@ -411,7 +411,7 @@ export async function activate(context) {
411
411
  const boundId = (resource) => resolveSessionBinding(resource, controls?.state.sessions ?? [], resourceBindings);
412
412
  let applying = Promise.resolve();
413
413
  // the reason the last send from a new chat made no conversation, said by that draft's request handler
414
- let refusedSend;
414
+ const refusedSends = new Map(); // by the draft's resource ('' when the send named none)
415
415
  let pendingDraft;
416
416
  let focusedResource;
417
417
  let focusGeneration = 0;
@@ -734,12 +734,10 @@ export async function activate(context) {
734
734
  if (!controls)
735
735
  throw new Error('This host does not expose harness or model configuration.');
736
736
  const active = managed();
737
- // A send from a blank chat lands here, and the workbench does not show its error: say it, then refuse.
737
+ // its caller (a new chat's first send) says the refusal in that chat
738
738
  const refusal = busyRefusal(active, 'starting a new chat');
739
- if (refusal) {
740
- void vscode.window.showWarningMessage(refusal);
739
+ if (refusal)
741
740
  throw new Error(refusal);
742
- }
743
741
  if (active)
744
742
  await saveManagedHistory(active);
745
743
  const state = await controls.select(selection);
@@ -851,7 +849,9 @@ export async function activate(context) {
851
849
  if (busy)
852
850
  throw new Error(busy);
853
851
  const draft = activeDraft();
854
- await draft?.choosing;
852
+ // the picker ends in a cancellation for a sign-in choice too: the draft's choice says which (sign-in is refused
853
+ // below, in the chat); a draft that went away is the real cancellation
854
+ await draft?.choosing?.catch(() => undefined);
855
855
  if (draft && activeDraft() !== draft)
856
856
  throw new vscode.CancellationError();
857
857
  await controls.refresh();
@@ -928,7 +928,7 @@ export async function activate(context) {
928
928
  catch (error) {
929
929
  if (error instanceof vscode.CancellationError)
930
930
  throw error;
931
- refusedSend = String(error?.message ?? error);
931
+ refusedSends.set(activeDraft()?.resource.toString() ?? '', String(error?.message ?? error));
932
932
  return undefined;
933
933
  }
934
934
  },
@@ -1177,9 +1177,11 @@ export async function activate(context) {
1177
1177
  const handler = async (request, chatContext, stream, token) => {
1178
1178
  await applying;
1179
1179
  const requestedResource = chatContext.chatSessionContext?.chatSessionItem?.resource;
1180
- if (refusedSend && requestedResource?.path.startsWith('/untitled-') && !boundId(requestedResource)) {
1181
- const refusal = refusedSend;
1182
- refusedSend = undefined;
1180
+ const refusedKey = requestedResource?.path.startsWith('/untitled-') && !boundId(requestedResource)
1181
+ ? [requestedResource.toString(), ''].find(key => refusedSends.has(key)) : undefined;
1182
+ if (refusedKey !== undefined) {
1183
+ const refusal = refusedSends.get(refusedKey);
1184
+ refusedSends.delete(refusedKey);
1183
1185
  // thrown as is: the workbench writes a handler's error into the chat
1184
1186
  throw new Error(`${refusal} Nothing was sent; send it again in a new chat.`);
1185
1187
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@volter/supercode-frontend-vscode",
3
3
  "displayName": "Volter Harness",
4
- "version": "0.1.44",
4
+ "version": "0.1.45",
5
5
  "type": "module",
6
6
  "description": "VS Code chat-view frontend for an existing Volter Harness SDK runtime",
7
7
  "publisher": "volter-ai-dev",