Merge pull request #10127 from uinstinct/hub-local

fix: show error for blank inputs when using hub blocks in local config
This commit is contained in:
Dallin Romney 2026-02-03 00:15:04 -08:00 • committed by GitHub
commit 998425438b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 17 additions and 2 deletions

View file

@ -407,7 +407,7 @@ class Anthropic extends BaseLLM {
): AsyncGenerator<ChatMessage> {
if (!this.apiKey || this.apiKey === "") {
throw new Error(
"Request not sent. You have an Anthropic model configured in your config.json, but the API key is not set.",
"Request not sent. You have an Anthropic model configured in your config.yaml, but the API key is not set.",
);
}

View file

@ -488,7 +488,7 @@ describe("Anthropic", () => {
},
}),
).rejects.toThrow(
"Request not sent. You have an Anthropic model configured in your config.json, but the API key is not set.",
"Request not sent. You have an Anthropic model configured in your config.yaml, but the API key is not set.",
);
});
});

View file

@ -740,6 +740,21 @@ export async function resolveBlock(
secrets: extractFQSNMap(rawYaml, [id]),
});
// Check for unresolved input template variables (missing required inputs)
const unresolvedInputs = getTemplateVariables(templatedYaml).filter((v) =>
v.startsWith("inputs."),
);
if (unresolvedInputs.length > 0) {
const missingInputNames = unresolvedInputs.map((v) =>
v.replace("inputs.", ""),
);
const blockName = packageIdentifierToShorthandSlug(id);
throw new Error(
`Missing required input(s) for block "${blockName}": ${missingInputNames.join(", ")}. ` +
`Please provide these values in the "with" block.`,
);
}
// Add source slug for mcp servers
const parsed = parseMarkdownRuleOrAssistantUnrolled(templatedYaml, id);
if (