Warn about broad tool response projections
Deploy / deploy (push) Successful in 1m40s
CI / Rust Checks (push) Failing after 5m3s
CI / UI Checks (push) Has been skipped
CI / Frontend E2E (push) Has been skipped
CI / Deployment Manifests (push) Has been skipped

This commit is contained in:
github-ops
2026-06-20 21:05:30 +00:00
parent 5970db5449
commit ce773e6196
10 changed files with 328 additions and 8 deletions
+29
View File
@@ -490,6 +490,29 @@ test('wizard shows agent-facing MCP preview from current draft fields', async ({
},
);
await page.route(
`/api/admin/workspaces/${encodeURIComponent(workspace.id)}/operations/analyze-quality`,
async (route) => {
const payload = route.request().postDataJSON();
expect(payload.output_mapping.rules.length).toBeGreaterThan(0);
await route.fulfill({
contentType: 'application/json',
body: JSON.stringify({
blocking: false,
findings: [
{
severity: 'warning',
code: 'response_projection_full_body',
message: 'Результат инструмента отдает агенту весь ответ API.',
suggested_action: 'Выберите только поля, которые нужны агенту.',
field_path: 'output_mapping.rules.0.source',
},
],
}),
});
},
);
await page.goto(`/wizard/?mode=edit&operationId=${operationId}`);
await page.locator('#btn-continue').click();
await page.locator('#btn-continue').click();
@@ -502,6 +525,12 @@ test('wizard shows agent-facing MCP preview from current draft fields', async ({
await expect(page.locator('#agent-preview-tool-call')).toHaveValue(/"name": "frankfurter_monthly_rates"/);
await expect(page.locator('#agent-preview-tool-call')).toHaveValue(/"from": "USD"/);
await expect(page.locator('#agent-preview-success-response')).toHaveValue(/0\.91/);
await page.evaluate(() => window.CrankWizardShell.doGoToStep(5));
await expect(page.locator('#step-panel-5')).toBeVisible();
await page.locator('#wizard-run-quality').scrollIntoViewIfNeeded();
await page.locator('#wizard-run-quality').click();
await expect(page.locator('#wizard-quality-findings')).toContainText(/весь ответ API|full response/i);
await expect(page.locator('#wizard-quality-findings')).toContainText('output_mapping.rules.0.source');
});
test('wizard edit mode preserves explicit request mapping targets on save', async ({ page }) => {