feat: Add modelId support when exporting tasks (#2142)

Added modelId to the task export process.

Signed-off-by: feifei <liuyansheng1121@gmail.com>
This commit is contained in:
feifei 2025-04-14 19:20:40 +08:00 committed by GitHub
parent 3ffe61f548
commit 4fe0b3c419
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 10 additions and 0 deletions

View file

@ -2309,6 +2309,7 @@ export class Cline extends EventEmitter<ClineEvents> {
const {
mode,
customModes,
apiModelId,
customModePrompts,
experiments = {} as Record<ExperimentId, boolean>,
customInstructions: globalCustomInstructions,
@ -2323,6 +2324,7 @@ export class Cline extends EventEmitter<ClineEvents> {
details += `\n\n# Current Mode\n`
details += `<slug>${currentMode}</slug>\n`
details += `<name>${modeDetails.name}</name>\n`
details += `<model>${apiModelId}</model>\n`
if (Experiments.isEnabled(experiments ?? {}, EXPERIMENT_IDS.POWER_STEERING)) {
details += `<role>${modeDetails.roleDefinition}</role>\n`
if (modeDetails.customInstructions) {

View file

@ -1355,6 +1355,7 @@ export class ClineProvider extends EventEmitter<ClineProviderEvents> implements
apiConfiguration: providerSettings,
lastShownAnnouncementId: stateValues.lastShownAnnouncementId,
customInstructions: stateValues.customInstructions,
apiModelId: stateValues.apiModelId,
alwaysAllowReadOnly: stateValues.alwaysAllowReadOnly ?? false,
alwaysAllowReadOnlyOutsideWorkspace: stateValues.alwaysAllowReadOnlyOutsideWorkspace ?? false,
alwaysAllowWrite: stateValues.alwaysAllowWrite ?? false,

View file

@ -129,6 +129,13 @@ const ApiOptions = ({
[apiConfiguration],
)
// Update apiConfiguration.aiModelId whenever selectedModelId changes.
useEffect(() => {
if (selectedModelId) {
setApiConfigurationField("apiModelId", selectedModelId)
}
}, [selectedModelId, setApiConfigurationField])
// Debounced refresh model updates, only executed 250ms after the user
// stops typing.
useDebounce(