gh-aw icon indicating copy to clipboard operation
gh-aw copied to clipboard

Pi on arc-dind: an aliased model reaches pi empty (`Model "aw-gateway/" not found`)

Open ekbritecore opened this issue 1 month ago • 1 comments

Analysis

With engine: pi, model: opus (or copilot/opus) and runner.topology: arc-dind, the alias resolves correctly, but pi is launched without a model:

[gh-aw/pi-models-json] model resolution: engine=pi role=main configured=opus resolved=claude-opus-5 provider=copilot status=resolved
Error: Model "aw-gateway/" not found. Use --list-models to see available models.

For an alias, pkg/workflow/pi_engine.go builds --model "aw-gateway/$(cat + piResolvedModelFile + )" with piResolvedModelFile = "/tmp/gh-aw/pi-model". In the compiled lock, that path is rewritten to ${RUNNER_TEMP}/gh-aw/pi-model. pi_models_json.cjs writes to process.env.GH_AW_PI_MODEL_FILE || "/tmp/gh-aw/pi-model", and the lock never sets GH_AW_PI_MODEL_FILE, so the file goes to /tmp/gh-aw/pi-model. On arc-dind those are different directories, so pi reads an empty file. pi_runtime.cjs reads the same default.

An exact ID (copilot/claude-opus-5) is compiled straight into --model aw-gateway/claude-opus-5 and works. Seen on v0.93.2. v0.93.5 and v1.0.1 compile the same launch line, with no GH_AW_PI_MODEL_FILE, and main (6cb1976022) has the same code.

Implementation plan

  1. In pkg/workflow/pi_engine.go, when piModelIsAlias, export GH_AW_PI_MODEL_FILE set to the same path the launch line reads, next to GH_AW_PI_MODEL_ID. The compiler's /tmp/gh-aw → ${RUNNER_TEMP}/gh-aw rewrite then applies to the writer, pi_runtime.cjs and the reader alike.
  2. Add a test in pkg/workflow/pi_engine_test.go: for an aliased model, the compiled step sets GH_AW_PI_MODEL_FILE to exactly the path inside the --model "aw-gateway/$(cat …)" substitution.

Acceptance: an arc-dind pi workflow with model: opus launches pi with the resolved model (for example aw-gateway/claude-opus-5).

ekbritecore avatar Oct 28 '26 00:10 ekbritecore

@pelikhan is there something wrong in this request? I see the PR got closed

ekbritecore avatar Oct 30 '26 14:10 ekbritecore