Compare commits

...

1 Commits

Author SHA1 Message Date
arvinxx 2ef1e55625 🐛 fix(test): update contextEngineering test for new document injection format
Agent documents are now injected via AgentDocumentContextInjector
(BaseFirstUserContentProvider) as a user-role message before the first
user message, not as a system message with <documents> XML tag.
Update test assertion to match the new injection position and format.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 23:19:46 +08:00
@@ -87,21 +87,13 @@ describe('contextEngineering', () => {
});
expect(agentDocumentService.getDocuments).not.toHaveBeenCalled();
const documentsMessage = output.find(
(message) =>
message.role === 'system' &&
typeof message.content === 'string' &&
message.content.includes('<documents>'),
);
expect(documentsMessage).toEqual({
content: expect.stringContaining('<documents>'),
role: 'system',
});
expect(documentsMessage).toEqual({
content: expect.stringContaining('setup.md'),
role: 'system',
});
// Agent documents are injected via AgentDocumentContextInjector as a user-role
// message before the first user message (BaseFirstUserContentProvider pattern)
const hasDocumentContent = output.some(
(msg) => typeof msg.content === 'string' && msg.content.includes('Project setup steps'),
);
expect(hasDocumentContent).toBe(true);
});
describe('handle with files content in server mode', () => {