CLI plugin host: handle send/render HTTP requests (#415)

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Gregory Schier
2026-03-03 16:41:53 -08:00
committed by GitHub
parent 3c12074db6
commit 30f006401a
18 changed files with 1800 additions and 350 deletions

View File

@@ -317,7 +317,8 @@ async function getResponse(
finalBehavior === 'always' ||
(finalBehavior === BEHAVIOR_TTL && shouldSendExpired(response, ttl))
) {
// NOTE: Render inside this conditional, or we'll get infinite recursion (render->render->...)
// Explicitly render the request before send (instead of relying on send() to render) so that we can
// preserve the render purpose.
const renderedHttpRequest = await ctx.httpRequest.render({ httpRequest, purpose });
response = await ctx.httpRequest.send({ httpRequest: renderedHttpRequest });
}