feat(agent): unify MCP tools and adopt Responses delivery

Move project and host queries into native MCP with host-owned OAuth/context,
while retaining memory, skills, actions and publication plugins. Add nearby-model
queries and explicit chat/task/learning model defaults.

Adopt Responses HTTP/SSE and native steer/queue inbox delivery, preserving scoped
session ownership, pending input edits and investigation communication.

Disable local-provider discovery: Server /health allowed native vLLM to probe
/v1/models on port 8000. A native before/after regression prevents recurrence.

Validation: 170 focused Bun tests; service/plugin typechecks; native discovery,
provider-discovery and input-inbox smoke checks; no paid model inference.
This commit is contained in:
2026-10-19 18:46:58 +08:00
parent f5c3cde2c2
commit 6a49d2209e
164 changed files with 12286 additions and 2368 deletions
+5 -4
View File
@@ -26,7 +26,7 @@ describe("MCP configuration and grants", () => {
]) expect(() => normalizeMcpConfig({ servers })).toThrow();
});
it("requires an exact service allow rule and keeps later denials and MCP confirmations effective", () => {
it("requires an exact service allow rule, keeps later denials and applies round mode to MCP requests", () => {
expect(mcpReadonlyTools({ permissions: [{ action: "mcp_*", resource: "*", effect: "allow" }] })).toEqual([]);
const permissions = [
{ action: "mcp_*", resource: "*", effect: "ask" },
@@ -36,9 +36,10 @@ describe("MCP configuration and grants", () => {
];
expect(mcpReadonlyTools({ permissions })).toEqual(["mcp_fixture_read"]);
expect(mcpReadonlyTools({ permissions, agents: { instruction: { permissions: [{ action: "mcp_fixture_read", resource: "*", effect: "deny" }] } } })).toEqual([]);
expect(canAutomaticallyApprove("always", "mcp_fixture_write")).toBe(false);
expect(canAutomaticallyApprove("always", "opencode_read_mcp_resource")).toBe(false);
expect(canAutomaticallyApprove("always", "query_project_data")).toBe(true);
for (const action of ["mcp_fixture_write", "opencode_read_mcp_resource", "mcp_tjwater_query_scada_readings"]) {
expect(canAutomaticallyApprove("request", action)).toBe(false);
expect(canAutomaticallyApprove("always", action)).toBe(true);
}
});
it("shadows inherited credentials and reserved overrides for a trusted stdio process", () => {