Skip to content

engine: expose apiProxy.modelFallback in compiler frontmatter (currently requires lock-file editing to disable middle_power rewrites that break BYOK Azure deployments) #35577

Description

@zarenner

Summary

The compiler emits an inline awf-config.json for the api-proxy sidecar but provides no frontmatter knob to override apiProxy.modelFallback. The default ({enabled: true, strategy: middle_power}) silently rewrites Azure OpenAI deployment names to base-catalog names, causing HTTP 404 DeploymentNotFound (see the proxy-side bug in gh-aw-firewall filed separately and the umbrella symptom in #35483).

Until the proxy-side default is fixed, BYOK Azure / custom-provider users have no supported way to opt out — the only workaround is a post-compile sed against the lock file, which is non-idempotent and gets clobbered by the next gh aw compile.

Why an env var doesn't work (subtle)

A natural attempt is to set AWF_MODEL_FALLBACK in engine.env and rely on awf --env-all. This does not work: awf --env-all propagates host env vars only into the agent container, not into the api-proxy sidecar. The sidecar's env is explicitly constructed by buildApiProxyService() in gh-aw-firewall/src/services/api-proxy-service.ts (~L86–170), which reads AWF_MODEL_FALLBACK only if config.modelFallback is defined in awf-config.json. Therefore the only ways to override are:

  1. Edit the inline awf-config.json in the generated lock file (current sed workaround), or
  2. Have gh-aw expose a frontmatter field that the compiler plumbs into the emitted awf-config.json.

Schema reference

gh-aw-firewall/src/awf-config-schema.json (~L163–182) defines:

{
  "apiProxy": {
    "modelFallback": {
      "enabled": true,
      "strategy": "middle_power"
    }
  }
}

Proposed change

Add an engine.firewall.apiProxy.modelFallback (or engine.apiProxy.modelFallback) field to the gh-aw frontmatter schema and emit the value into the inline awf-config.json written into the generated lock file. Example:

engine:
  id: copilot
  env: { ... }
  firewall:
    apiProxy:
      modelFallback:
        enabled: false
        # strategy: middle_power   # optional

For minimal surface area, a single boolean engine.firewall.modelFallback (default true) is sufficient.

Context

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions