Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 3 additions & 8 deletions packages/superintendent/src/runtime/run-owner-review.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,15 +206,10 @@ describe("runOwnerReview", () => {
});
});

it("propagates mcp timeout values to spawn", async () => {
it("ignores document-defined MCP servers during owner review", async () => {
autonomousMock.mockImplementation(async (_, { mcpServers }) => {
expect(mcpServers).toMatchObject({
"plan-browser": {
command: "poe-code",
args: ["plan", "list"],
timeout: 90
}
});
expect(mcpServers).not.toHaveProperty("plan-browser");
expect(findWorkflowServer(mcpServers)).toBeDefined();

return {
toolCalls: [
Expand Down
25 changes: 3 additions & 22 deletions packages/superintendent/src/runtime/run-owner-review.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import "@poe-code/agent-spawn/register-factories";
import type { McpConfig, SuperintendentDoc } from "../document/parse.js";
import type { SuperintendentDoc } from "../document/parse.js";
import {
runAutonomousAgent,
type AutonomousOutput,
Expand Down Expand Up @@ -77,21 +77,10 @@ function buildTemplateContext(
return { ...context, plan: { path: doc.filePath } };
}

function buildMcpServers(doc: SuperintendentDoc): McpSpawnConfig {
const servers: McpSpawnConfig = {
function buildMcpServers(_doc: SuperintendentDoc): McpSpawnConfig {
return {
[WORKFLOW_SERVER_NAME]: createWorkflowServer()
};

const merged = {
...(doc.frontmatter.mcp ?? {}),
...(doc.frontmatter.owner.mcp ?? {})
};

for (const [name, config] of Object.entries(merged)) {
servers[name] = toSpawnMcpServer(config);
}

return servers;
}

function createWorkflowServer(): McpSpawnConfig[string] {
Expand All @@ -104,14 +93,6 @@ function createWorkflowServer(): McpSpawnConfig[string] {
};
}

function toSpawnMcpServer(config: McpConfig): McpSpawnConfig[string] {
return {
command: config.command,
...(config.args ? { args: [...config.args] } : {}),
...(config.timeout !== undefined ? { timeout: config.timeout } : {})
};
}

function extractLogPath(result: AutonomousOutput): string | undefined {
if (typeof result === "string") return undefined;
return typeof result.logFile === "string" ? result.logFile : undefined;
Expand Down
Loading