feat(agent): use deepseek flash for complete SCADA investigations
Generic Container CI/CD / test-build-publish (push) Successful in 1m39s
Agent CI/CD / build-test-publish-and-deploy (push) Successful in 1m39s

This commit is contained in:
2026-11-07 21:15:01 +08:00
parent e1ca2f56f9
commit d8eb29466a
6 changed files with 45 additions and 16 deletions
+24
View File
@@ -17,6 +17,30 @@ afterEach(async () => {
});
const productTool: Tool = { name: "get_task_context", description: "Bound task", inputSchema: { type: "object", properties: { report_revision: { type: "integer", minimum: 1 } }, additionalProperties: false } };
it("delivers complete SCADA metadata and observations through native MCP without narrowing device scope", async () => {
const data = {
devices: Array.from({ length: 168 }, (_, index) => ({ device_id: `D${index}`, node_id: `J${index}`, description: "x".repeat(100) })),
readings: Array.from({ length: 2184 }, (_, index) => ({ device_id: `D${index % 168}`, monitored_value: index, cleaned_value: null })),
coverage: { mode: "all_scada", query_complete: true, queried_device_count: 168, reading_count: 2184 },
};
const upstream = { content: [{ type: "text" as const, text: JSON.stringify(data) }], structuredContent: {
source: "query_scada_readings", evidence_id: "mcp:all-scada", data, truncated: false,
} };
const query = mock(async () => upstream);
const tool: Tool = { name: "query_scada_readings", inputSchema: { type: "object", properties: {
start: { type: "string" }, end: { type: "string" },
device_ids: { type: "array", items: { type: "string" }, maxItems: 20 },
}, required: ["start", "end"], additionalProperties: false } };
const { call } = await setup({ productTools: [tool], productClient: { query } });
setRuntimeSessionContext({ ...owner, purpose: "task_execution", taskId: "scada-task" });
const args = { start: "2026-07-16T05:00:00+08:00", end: "2026-07-16T08:00:00+08:00" };
const result = await call("query_scada_readings", args);
expect(result.isError).not.toBeTrue();
expect((query.mock.calls[0] as unknown as unknown[])[3]).toEqual(args);
expect(result.structuredContent).toEqual(upstream.structuredContent);
expect(JSON.stringify(result.structuredContent).length).toBeGreaterThan(12000);
});
it("hides HTTP budgets from models and fixes the native connection ceiling", async () => {
const simulation: Tool = { name: "run_simulation", inputSchema: { type: "object", properties: {
timeout_seconds: { type: "integer", minimum: 1, maximum: 240, default: 120 },