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
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased] — `crd-well-oiled-machine`

### Fixed — `--runtime langgraph` accepted (canonical spelling)

`kars add <name> --runtime langgraph` previously failed with
`Unknown --runtime value: langgraph` because the CLI flag parser only
accepted the hyphenated `lang-graph`, even though the `--runtime` help
text, the docs (`cli-reference.md`, `runtimes.md`, `README.md`), the
controller (`plan_langgraph`), the runtime images
(`kars-runtime-langgraph`) and the Helm values all use the unhyphenated
`langgraph`. `langgraph` is now the canonical CLI flag; `lang-graph`
continues to work as a back-compat alias (accepted by `flagToKind`,
but not surfaced in pickers or the "Valid values" error text). Fixes
the `--runtime langgraph` example shown in the getting-started guide and
launch materials. (`cli/src/runtime.ts`, `cli/src/commands/operator/dialogs/spawn.ts`)

### Upstream alignment — AGT mesh-identity hardening merged

[microsoft/agent-governance-toolkit#2719](https://github.com/microsoft/agent-governance-toolkit/pull/2719)
Expand Down
2 changes: 1 addition & 1 deletion cli/src/commands/operator/dialogs/spawn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export function openSpawnDialog(ctx: SpawnDialogContext): void {
"openclaw": "OpenClaw",
"openai-agents": "OpenAI Agents",
"microsoft-agent-framework": "Microsoft Agent Framework",
"lang-graph": "LangGraph",
"langgraph": "LangGraph",
"anthropic": "Anthropic Claude SDK",
"pydantic-ai": "Pydantic AI",
"hermes": "Hermes",
Expand Down
22 changes: 21 additions & 1 deletion cli/src/runtime.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,30 @@ describe("flagToKind", () => {
expect(flagToKind("OPENAI-AGENTS")).toBe("OpenAIAgents");
});

it("resolves LangGraph via the canonical `langgraph` flag", () => {
expect(flagToKind("langgraph")).toBe("LangGraph");
expect(flagToKind("LangGraph")).toBe("LangGraph");
});

it("accepts the legacy hyphenated `lang-graph` as a back-compat alias", () => {
// `lang-graph` was the original flag spelling; `langgraph` is now
// canonical (matches images/controller/docs/help text). The alias
// must keep resolving so existing scripts don't break.
expect(flagToKind("lang-graph")).toBe("LangGraph");
expect(flagToKind("LANG-GRAPH")).toBe("LangGraph");
});

it("throws with a helpful error on unknown flags", () => {
expect(() => flagToKind("autogen")).toThrow(/Unknown --runtime value: autogen/);
expect(() => flagToKind("")).toThrow(/Unknown --runtime value/);
});

it("does not advertise the `lang-graph` alias in the canonical valid-values list", () => {
// The alias is accepted but must stay out of the error text and
// pickers — only the canonical `langgraph` should surface.
expect(() => flagToKind("autogen")).toThrow(/langgraph/);
expect(() => flagToKind("autogen")).not.toThrow(/lang-graph/);
});
});

describe("assertRuntimeWired", () => {
Expand Down Expand Up @@ -213,7 +233,7 @@ describe("wiredRuntimeFlags", () => {
"openclaw",
"openai-agents",
"microsoft-agent-framework",
"lang-graph",
"langgraph",
"anthropic",
"pydantic-ai",
"hermes",
Expand Down
22 changes: 19 additions & 3 deletions cli/src/runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export type RuntimeFlag =
| "openai-agents"
| "microsoft-agent-framework"
| "semantic-kernel"
| "lang-graph"
| "langgraph"
| "anthropic"
| "pydantic-ai"
| "hermes"
Expand All @@ -44,7 +44,7 @@ const FLAG_TO_KIND: Record<RuntimeFlag, RuntimeKind> = {
"openai-agents": "OpenAIAgents",
"microsoft-agent-framework": "MicrosoftAgentFramework",
"semantic-kernel": "SemanticKernel",
"lang-graph": "LangGraph",
"langgraph": "LangGraph",
"anthropic": "Anthropic",
"pydantic-ai": "PydanticAi",
"hermes": "Hermes",
Expand Down Expand Up @@ -96,8 +96,24 @@ export function wiredRuntimeFlags(): RuntimeFlag[] {
});
}

/**
* Back-compat aliases accepted by `flagToKind` but intentionally NOT
* listed in `FLAG_TO_KIND`, so they never leak into pickers
* (`wiredRuntimeFlags`), the reverse `KIND_TO_FLAG` map, or the
* canonical "Valid values" error text. `lang-graph` was the original
* hyphenated flag; `langgraph` is now canonical and matches the
* runtime images, controller (`plan_langgraph`), Helm values, docs,
* and the `--runtime` help text. Old scripts using `lang-graph` keep
* working.
*/
const FLAG_ALIASES: Record<string, RuntimeFlag> = {
"lang-graph": "langgraph",
};

export function flagToKind(flag: string): RuntimeKind {
const k = FLAG_TO_KIND[flag.toLowerCase() as RuntimeFlag];
const normalized = flag.toLowerCase();
const canonical = (FLAG_ALIASES[normalized] ?? normalized) as RuntimeFlag;
const k = FLAG_TO_KIND[canonical];
if (!k) {
throw new Error(
`Unknown --runtime value: ${flag}. ` +
Expand Down
Loading