Remove legacy orchestration and MCP aliases; reroute recursive pipeline API

This commit is contained in:
2026-02-23 16:02:20 -05:00
parent 62e2491cde
commit 1363bceecc
15 changed files with 88 additions and 102 deletions

View File

@@ -107,8 +107,7 @@ test("recursive fanout/fan-in avoids deadlock at maxConcurrentAgents=1", async (
const session = manager.createSession("recursive-deadlock");
const executionOrder: string[] = [];
const result = await manager.runRecursiveAgent({
sessionId: session.id,
const result = await session.runRecursive({
depth: 0,
run: async ({ sessionId, intent }) => {
executionOrder.push(`${sessionId}:${intent?.task ?? "root"}`);
@@ -151,8 +150,7 @@ test("rejects recursive child spawn above depth limit", async () => {
await assert.rejects(
() =>
manager.runRecursiveAgent({
sessionId: session.id,
session.runRecursive({
depth: 0,
run: async ({ depth }) => {
if (depth < 3) {
@@ -195,8 +193,7 @@ test("closing parent session aborts active recursive work and releases child res
let abortCount = 0;
let releaseCount = 0;
const runPromise = manager.runRecursiveAgent({
sessionId: session.id,
const runPromise = session.runRecursive({
depth: 0,
run: async ({ intent, signal }) => {
if (!intent) {
@@ -286,8 +283,7 @@ test("recursive children can be isolated via middleware-backed suballocation", a
const childLeases = new Map<string, Awaited<ReturnType<typeof provisioner.provisionChildSession>>>();
try {
await manager.runRecursiveAgent({
sessionId: session.id,
await session.runRecursive({
depth: 0,
run: async ({ intent, sessionId }) => {
if (!intent) {

View File

@@ -37,7 +37,6 @@ test("prefers CLAUDE_CODE_OAUTH_TOKEN over ANTHROPIC_API_KEY", () => {
assert.equal(config.provider.anthropicOauthToken, "oauth-token");
assert.equal(config.provider.anthropicApiKey, "api-key");
assert.equal(config.provider.anthropicToken, "oauth-token");
assert.equal(resolveAnthropicToken(config.provider), "oauth-token");
const authEnv = buildClaudeAuthEnv(config.provider);
@@ -52,7 +51,6 @@ test("falls back to ANTHROPIC_API_KEY when oauth token is absent", () => {
assert.equal(config.provider.anthropicOauthToken, undefined);
assert.equal(config.provider.anthropicApiKey, "api-key");
assert.equal(config.provider.anthropicToken, "api-key");
assert.equal(resolveAnthropicToken(config.provider), "api-key");
const authEnv = buildClaudeAuthEnv(config.provider);

View File

@@ -117,3 +117,22 @@ test("rejects relationship cycles", () => {
assert.throws(() => parseAgentManifest(manifest), /Relationship graph must be acyclic/);
});
test("rejects legacy edge trigger aliases", () => {
const manifest = validManifest() as {
pipeline: {
edges: Array<{ from: string; to: string; on: string }>;
};
};
manifest.pipeline.edges[0] = {
from: "product-node",
to: "coder-node",
on: "onValidationFail",
};
assert.throws(
() => parseAgentManifest(manifest),
/unsupported event "onValidationFail"/,
);
});

View File

@@ -43,40 +43,35 @@ test("maps shared headers to codex http_headers", () => {
});
});
test("normalizes header aliases into a single headers object", () => {
test("normalizes headers into a single headers object", () => {
const normalized = normalizeSharedMcpServer({
url: "http://localhost:3000/mcp",
http_headers: {
"X-Source": "legacy",
},
headers: {
Authorization: "Bearer token",
},
});
assert.deepEqual(normalized.headers, {
"X-Source": "legacy",
Authorization: "Bearer token",
});
assert.equal("http_headers" in normalized, false);
});
test("maps legacy http_headers alias for claude conversion", () => {
const claudeConfig = toClaudeServerConfig("legacy-http-headers", {
type: "http",
url: "http://localhost:3000/mcp",
http_headers: {
Authorization: "Bearer token",
},
});
assert.deepEqual(claudeConfig, {
type: "http",
url: "http://localhost:3000/mcp",
headers: {
Authorization: "Bearer token",
},
});
test("rejects legacy shared MCP header alias http_headers", () => {
assert.throws(
() =>
parseMcpConfig({
servers: {
legacy: {
type: "http",
url: "http://localhost:3000/mcp",
http_headers: {
Authorization: "Bearer token",
},
},
},
}),
/unrecognized key/i,
);
});
test("throws for claude http server without url", () => {

View File

@@ -135,7 +135,7 @@ function createManifest(): unknown {
when: [
{
type: "history_has_event",
event: "validation_fail",
event: "validation_failed",
},
],
},