feat(consultation): unify server-distributed agents without fixed roles

This commit is contained in:
2026-09-24 11:56:42 +08:00
parent 248776d855
commit 8a157be4f6
35 changed files with 625 additions and 668 deletions

View File

@@ -76,13 +76,14 @@ describe('teacher published reasoning wire contract', () => {
const fetch = setup();
const config = definition({ mode: 'disabled' });
config.limits.max_input_tokens = 3000;
config.system_prompt = '运营配置的超长说明。'.repeat(1000);
const source = { messages: [], cursor: { workerGeneration: 1, seq: 1 }, capturedAt: 'now' };
const prepared = await prepareTeacherModel(account, config, {
projectPath: tmpdir(), source, assertCurrent: () => undefined,
});
expect(() => compileTeacherContext(config, source, [], '你好', [], prepared.inputLimit,
'question', discussionInstructions({ definition: config } as TeacherTopic), true))
.toThrow('老师配置或当前整理内容超过上下文预算');
.toThrow('智能体配置或当前整理内容超过上下文预算');
expect(fetch).not.toHaveBeenCalled();
});
@@ -185,7 +186,7 @@ describe('teacher published reasoning wire contract', () => {
])('keeps rejecting unsupported choice %j', async (choice, canDisable) => {
const fetch = setup(Boolean(canDisable));
await expect(prepareTeacherModel(account, definition(choice)))
.rejects.toThrow('老师所用思考选项已不可用,请联系运营调整。');
.rejects.toThrow('智能体所用思考选项已不可用,请联系运营调整。');
expect(fetch).not.toHaveBeenCalled();
});
});