Skip to content

Commit 9984254

Browse files
authored
Merge pull request #10127 from uinstinct/hub-local
fix: show error for blank inputs when using hub blocks in local config
2 parents 437ac08 + 1a9ea0a commit 9984254

File tree

3 files changed

+17
-2
lines changed

3 files changed

+17
-2
lines changed

core/llm/llms/Anthropic.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ class Anthropic extends BaseLLM {
407407
): AsyncGenerator<ChatMessage> {
408408
if (!this.apiKey || this.apiKey === "") {
409409
throw new Error(
410-
"Request not sent. You have an Anthropic model configured in your config.json, but the API key is not set.",
410+
"Request not sent. You have an Anthropic model configured in your config.yaml, but the API key is not set.",
411411
);
412412
}
413413

core/llm/llms/Anthropic.vitest.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,7 @@ describe("Anthropic", () => {
488488
},
489489
}),
490490
).rejects.toThrow(
491-
"Request not sent. You have an Anthropic model configured in your config.json, but the API key is not set.",
491+
"Request not sent. You have an Anthropic model configured in your config.yaml, but the API key is not set.",
492492
);
493493
});
494494
});

packages/config-yaml/src/load/unroll.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -740,6 +740,21 @@ export async function resolveBlock(
740740
secrets: extractFQSNMap(rawYaml, [id]),
741741
});
742742

743+
// Check for unresolved input template variables (missing required inputs)
744+
const unresolvedInputs = getTemplateVariables(templatedYaml).filter((v) =>
745+
v.startsWith("inputs."),
746+
);
747+
if (unresolvedInputs.length > 0) {
748+
const missingInputNames = unresolvedInputs.map((v) =>
749+
v.replace("inputs.", ""),
750+
);
751+
const blockName = packageIdentifierToShorthandSlug(id);
752+
throw new Error(
753+
`Missing required input(s) for block "${blockName}": ${missingInputNames.join(", ")}. ` +
754+
`Please provide these values in the "with" block.`,
755+
);
756+
}
757+
743758
// Add source slug for mcp servers
744759
const parsed = parseMarkdownRuleOrAssistantUnrolled(templatedYaml, id);
745760
if (

0 commit comments

Comments
 (0)