File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -380,13 +380,16 @@ export function buildWizardMetadata(
380380}
381381
382382/**
383- * Build env for the SDK subprocess: process.env plus ANTHROPIC_CUSTOM_HEADERS from wizard metadata/flags.
383+ * Build env for the SDK subprocess: process.env plus ANTHROPIC_CUSTOM_HEADERS, which always
384+ * includes `x-posthog-use-bedrock-fallback: true` so the LLM gateway falls back to Bedrock on
385+ * Anthropic 5xx, plus any wizard metadata/flags.
384386 */
385387function buildAgentEnv (
386388 wizardMetadata : Record < string , string > ,
387389 wizardFlags : Record < string , string > ,
388390) : string {
389391 const headers = createCustomHeaders ( ) ;
392+ headers . add ( 'x-posthog-use-bedrock-fallback' , 'true' ) ;
390393 for ( const [ key , value ] of Object . entries ( wizardMetadata ) ) {
391394 headers . add (
392395 key . startsWith ( POSTHOG_PROPERTY_HEADER_PREFIX )
You can’t perform that action at this time.
0 commit comments