fix(coding): close PI-100 review findings

This commit is contained in:
2026-08-23 20:55:49 +08:00
parent 22b4a9f9c4
commit 52b2467d5d
16 changed files with 679 additions and 122 deletions

View File

@@ -14,6 +14,7 @@ import type {
ForkConversationInput,
ForkResult,
PrepareConversationInput,
ProductModelRef,
PromptAcceptance,
PromptConversationInput,
QueueAcceptance,
@@ -316,6 +317,17 @@ export class InMemoryConversationRuntime implements CodingConversationRuntime {
}, current.runId);
}
async validateModel(model: ProductModelRef): Promise<ProductModelRef> {
if (!model.accountId.trim() || !model.modelId.trim()) {
throw new CodingRuntimeContractError(
'CODING_MODEL_UNAVAILABLE',
'The selected model is unavailable',
true,
);
}
return clone(model);
}
async setModel(input: SetConversationModelInput): Promise<ConversationModelState> {
const snapshot = this.snapshot(input.conversationId);
const thinkingLevel = snapshot.conversation.model.model?.thinkingLevel ?? 'off';