mirror of
https://github.com/microsoft/vscode.git
synced 2026-07-08 15:55:15 +01:00
a97573159d
* Agent Host changes for agents/adhoc-request-sender-mode-extension-55e2bb6f * Remove unconfigured react-hooks/exhaustive-deps eslint directive The eslint-disable directive referenced a rule that isn't registered in this repo's ESLint config, which caused ESLint to error with "Definition for rule 'react-hooks/exhaustive-deps' was not found" and failed the Compile & Hygiene and Copilot - Test CI checks. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Coalesce adhoc tag-decoration rescans with requestAnimationFrame Rescanning the whole editor text on every content change is wasteful for bursty updates (e.g. a streamed response). Debounce the decoration update to at most once per animation frame and cancel any pending frame during cleanup so the callback can't run after the editor is disposed. The initial scan stays synchronous so tags are highlighted immediately on mount. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Address PR feedback: dispose token source; validate adhoc request JSON - adhocRequestSender: always dispose the per-send CancellationTokenSource in the finally block (separate from the current-send guard) so its cancellation listeners don't leak across repeated Send/Stop cycles. - simulationMain: validate and normalize the adhoc request JSON before use so malformed input (missing/null/wrong-typed model/user/system) yields a focused error message instead of a thrown stack trace. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
28 lines
1.2 KiB
TypeScript
28 lines
1.2 KiB
TypeScript
/*---------------------------------------------------------------------------------------------
|
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
*--------------------------------------------------------------------------------------------*/
|
|
|
|
import { SimulationStorage, SimulationStorageValue } from './simulationStorage';
|
|
|
|
/**
|
|
* Persisted inputs for the "Adhoc request sender" mode in the simulation workbench.
|
|
*/
|
|
export class AdhocRequestOptions {
|
|
|
|
/** The system message to send. */
|
|
public readonly systemMessage: SimulationStorageValue<string>;
|
|
|
|
/** The user message to send. */
|
|
public readonly userMessage: SimulationStorageValue<string>;
|
|
|
|
/** The model name (e.g. `gpt-4.1`) to send the request to. */
|
|
public readonly model: SimulationStorageValue<string>;
|
|
|
|
constructor(storage: SimulationStorage) {
|
|
this.systemMessage = new SimulationStorageValue(storage, 'adhocRequestSystemMessage', '');
|
|
this.userMessage = new SimulationStorageValue(storage, 'adhocRequestUserMessage', '');
|
|
this.model = new SimulationStorageValue(storage, 'adhocRequestModel', '');
|
|
}
|
|
}
|