fix: restore ai detail default frame count
Some checks failed
Lint / build (20) (push) Has been cancelled
Playwright Tests / test (push) Has been cancelled

This commit is contained in:
Your Name 2026-03-25 17:14:27 +08:00
parent f97e96c5f9
commit c823910185
3 changed files with 5 additions and 5 deletions

View File

@ -2864,7 +2864,7 @@ export function AgentGenerationWorkspaceDarkV2({
? `\n\n【工作流风格要求】\n${workflowContext.promptText}`
: "";
const detailPromptWithWorkflow = `${detailPrompt}${workflowHint}`.trim();
const detailCount = extractAgentDetailFrameCount(detailPromptWithWorkflow);
const detailCount = extractAgentDetailFrameCount(detailPrompt);
const referenceImageNotes = detailGenerationVisibleSlotIndexes.map((slotIndex, visibleIndex) => {
const config = AGENT_DETAIL_SLOT_CONFIGS[slotIndex];
const current = detailGenerationSlots[slotIndex];

View File

@ -1367,9 +1367,9 @@ function deriveSessionTitleFromMessages(messages: ChatMessage[]): string {
function extractDetailFrameCount(text: string): number {
const normalized = text.replace(/\s+/g, "");
const matched = normalized.match(/(\d{1,2})(?:张|屏|页)/);
if (!matched) return 14;
if (!matched) return 15;
const value = Number(matched[1]);
if (!Number.isFinite(value)) return 14;
if (!Number.isFinite(value)) return 15;
return Math.min(20, Math.max(5, Math.round(value)));
}

View File

@ -139,9 +139,9 @@ export function sanitizeAgentDetailBrief(input: unknown): AgentDetailBriefForm {
export function extractAgentDetailFrameCount(text: string) {
const normalized = String(text || "").replace(/\s+/g, "");
const matched = normalized.match(/(\d{1,2})(?:张|屏|页)/);
if (!matched) return 14;
if (!matched) return 15;
const value = Number(matched[1]);
if (!Number.isFinite(value)) return 14;
if (!Number.isFinite(value)) return 15;
return Math.min(20, Math.max(5, Math.round(value)));
}