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:
Vendored
-27
@@ -1,27 +0,0 @@
|
||||
import { Plugin, Rpc } from "../../.opencode/node_modules/@opencode/plugin/dist/promise/index.js";
|
||||
import { z } from "../../.opencode/node_modules/zod/index.js";
|
||||
|
||||
// Loaded only by the opt-in isolated smoke script, never by the Agent service.
|
||||
export default Plugin.define({
|
||||
id: "tjwater.mcp-fixture",
|
||||
async setup(ctx) {
|
||||
// Materialize the native session toolbox, then stop before any model call.
|
||||
await ctx.session.hook("context", () => { throw new Error("MCP fixture stops before model request"); });
|
||||
const evaluated: string[] = [];
|
||||
await ctx.permission.hook("evaluate", (event) => { evaluated.push(event.action); });
|
||||
await ctx.rpc.register(Rpc.define({
|
||||
id: "tjwater.mcp-fixture", events: {}, methods: {
|
||||
call: { input: z.object({ session_id: z.string(), tool: z.enum(["mcp_stdio_echo", "mcp_http_write"]), value: z.string() }), output: z.object({ content: z.unknown(), evaluated: z.array(z.string()), error: z.string().optional() }) },
|
||||
},
|
||||
}), {
|
||||
call: async (input, context) => {
|
||||
const tool = (await ctx.tool.list()).find((tool) => tool.id === input.tool);
|
||||
if (!tool) throw new Error("fixture tool missing");
|
||||
try {
|
||||
const result = await tool.execute({ value: input.value }, { sessionID: input.session_id as never, id: "call-mcp-fixture" as never, messageID: "msg-mcp-fixture" as never, agent: "instruction" as never, signal: context.signal, progress: async () => {} });
|
||||
return { content: result.content ?? [], evaluated };
|
||||
} catch (error) { return { content: [], evaluated, error: String(error) }; }
|
||||
},
|
||||
});
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user