fix(agent): 빈 응답 진단 정확도 — MoE 활성 파라미터 인식 (v2.2.254)
약한 모델이 큰 입력에 첫 토큰 EOS로 빈 응답을 낼 때, 모델명 파서가 gemma-4-26b-a4b를 "26B 큰 모델"로 오판하던 문제 수정. - estimateActiveParamsB 추가: MoE 활성 파라미터 추정(a4b→4, A3B→3, e2b→2) - 빈 응답 에러 메시지 개선: 원인이 답변 길이가 아니라 입력 크기임을 명시, MoE 총/활성 파라미터 표기, LM Studio 로드 context length 불일치 1순위 점검 안내 - 테스트 +6건(전체 662 통과) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -7,6 +7,7 @@ import {
|
||||
classifyStopReason,
|
||||
shouldShowTruncationNotice,
|
||||
estimateModelParamsB,
|
||||
estimateActiveParamsB,
|
||||
CONTEXT_OPEN_MARKER,
|
||||
CONTEXT_CLOSE_MARKER,
|
||||
type BudgetMessage,
|
||||
@@ -29,6 +30,22 @@ describe('contextManager.estimateModelParamsB', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('contextManager.estimateActiveParamsB', () => {
|
||||
it('prefers active params for MoE naming (a/e prefix)', () => {
|
||||
expect(estimateActiveParamsB('gemma-4-26b-a4b-it')).toBe(4); // 활성 4B (총 26B 아님)
|
||||
expect(estimateActiveParamsB('Qwen3-30B-A3B')).toBe(3); // 활성 3B
|
||||
expect(estimateActiveParamsB('google/gemma-3n-e2b-it')).toBe(2);
|
||||
});
|
||||
it('falls back to total params when no active hint', () => {
|
||||
expect(estimateActiveParamsB('llama-3.1-8b')).toBe(8);
|
||||
expect(estimateActiveParamsB('qwen2.5-7b-instruct')).toBe(7);
|
||||
});
|
||||
it('returns null when there is no parameter hint', () => {
|
||||
expect(estimateActiveParamsB('phi-3-mini')).toBeNull();
|
||||
expect(estimateActiveParamsB('')).toBeNull();
|
||||
});
|
||||
});
|
||||
|
||||
describe('contextManager.computeOutputBudget', () => {
|
||||
const limits = { contextLength: 32768, maxOutputTokens: 4096, safetyMargin: 2048, minOutputTokens: 512 };
|
||||
it('caps at maxOutputTokens when there is plenty of room', () => {
|
||||
|
||||
Reference in New Issue
Block a user