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
+6 -7
View File
@@ -15,10 +15,9 @@ describe("OpenCode internal bridge tools", () => {
hostname: "127.0.0.1",
port: 0,
fetch(request) {
const url = new URL(request.url);
receivedToken = request.headers.get("x-agent-internal-token");
receivedSessionId = url.searchParams.get("session_id");
return Response.json({ task: { task_id: "task-1" } });
receivedSessionId = null;
return request.json().then((body) => { receivedSessionId = body.session_id; return Response.json({ task: { task_id: "task-1" } }); });
},
});
@@ -26,8 +25,8 @@ describe("OpenCode internal bridge tools", () => {
processExecPath(),
"-e",
[
'import tool from "./.opencode/tools/get_operational_task_context.ts";',
'const result = await tool.execute({}, { sessionID: "runtime-session-1" });',
'import tool from "./.opencode/tools/memory_manager.ts";',
'const result = await tool.execute({ action: "list", scope: "user", reason: "review existing memory" }, { sessionID: "runtime-session-1" });',
"process.stdout.write(result);",
].join("\n"),
], {
@@ -58,8 +57,8 @@ describe("OpenCode internal bridge tools", () => {
processExecPath(),
"-e",
[
'import tool from "./.opencode/tools/get_operational_task_context.ts";',
'await tool.execute({}, { sessionID: "runtime-session-1" });',
'import tool from "./.opencode/tools/memory_manager.ts";',
'await tool.execute({ action: "list", scope: "user", reason: "review existing memory" }, { sessionID: "runtime-session-1" });',
].join("\n"),
], {
cwd: process.cwd(),