-
Notifications
You must be signed in to change notification settings - Fork 393
Compare AWF wiring in smoke-copilot vs smoke-pi lock workflows
#32504
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
d443dff
f35a4a0
5b135b0
d0a03d9
0892d98
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -58,6 +58,13 @@ describe("pi_provider.cjs", () => { | |
| ]); | ||
| }); | ||
|
|
||
| it("resolves reflect URL from provider model", () => { | ||
| expect(module.resolveReflectUrl("copilot/claude-sonnet-4")).toBe("http://api-proxy:10000/reflect"); | ||
| expect(module.resolveReflectUrl("openai/gpt-5")).toBe("http://api-proxy:10000/reflect"); | ||
| expect(module.resolveReflectUrl("custom/provider-model")).toBe("http://api-proxy:10000/reflect"); | ||
| expect(module.resolveReflectUrl("claude-sonnet-4")).toBe("http://api-proxy:10000/reflect"); | ||
| }); | ||
|
Comment on lines
+61
to
+66
|
||
|
|
||
| it("logs the configured provider using GH_AW_PI_MODEL during agent_start", async () => { | ||
| process.env.GH_AW_PI_MODEL = "copilot/claude-sonnet-4"; | ||
| global.fetch = vi.fn().mockRejectedValue(new Error("network disabled")); | ||
|
|
@@ -74,5 +81,6 @@ describe("pi_provider.cjs", () => { | |
| await handlers.agent_start(); | ||
|
|
||
| expect(stderrOutput.some(line => line.includes("provider=copilot model=copilot/claude-sonnet-4"))).toBe(true); | ||
| expect(global.fetch).toHaveBeenCalledWith("http://api-proxy:10000/reflect", expect.any(Object)); | ||
| }); | ||
| }); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [/tdd] The Consider adding: it("uses provider-specific reflect URL during agent_end", async () => {
process.env.GH_AW_PI_MODEL = "copilot/claude-sonnet-4";
global.fetch = vi.fn().mockRejectedValue(new Error("network disabled"));
const { handlers } = piProviderExtension(mockPi);
await handlers.agent_end();
expect(global.fetch).toHaveBeenCalledWith("(apiproxy/redacted) expect.any(Object));
});Without this, a future regression that breaks |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,71 @@ | ||
| # AWF configuration diff: smoke-copilot vs smoke-pi (`*.lock.yml`) | ||
|
|
||
| This note compares: | ||
|
|
||
| - `/home/runner/work/gh-aw/gh-aw/.github/workflows/smoke-copilot.lock.yml` | ||
| - `/home/runner/work/gh-aw/gh-aw/.github/workflows/smoke-pi.lock.yml` | ||
|
|
||
| Line references below are from the current lockfile snapshot in this branch and may shift after future workflow recompiles. | ||
|
|
||
| ## Top-level workflow env | ||
|
|
||
| No differences were found in top-level `env:`. Both workflows set the same OTEL/GH_AW telemetry variables. | ||
|
|
||
| ## AWF execution env differences (agent job) | ||
|
|
||
| Copilot-specific env present in `smoke-copilot.lock.yml` but not in `smoke-pi.lock.yml`: | ||
|
|
||
| - `GH_AW_MCP_CONFIG` (`smoke-copilot.lock.yml:1801`) | ||
| - `GITHUB_MCP_SERVER_TOKEN` (`smoke-copilot.lock.yml:1811`) | ||
| - `COPILOT_AGENT_RUNNER_TYPE` (`smoke-copilot.lock.yml:1797`) | ||
| - `GITHUB_COPILOT_INTEGRATION_ID` (`smoke-copilot.lock.yml:1809`) | ||
| - Also present only for copilot execute path: | ||
| - `AWF_REFLECT_ENABLED` | ||
| - `COPILOT_API_KEY` | ||
| - `COPILOT_MODEL` | ||
| - `GITHUB_API_URL` | ||
| - `GITHUB_HEAD_REF` | ||
| - `GITHUB_REF_NAME` | ||
| - `GITHUB_SERVER_URL` | ||
| - `XDG_CONFIG_HOME` | ||
|
|
||
| Pi-specific env present in `smoke-pi.lock.yml` but not in `smoke-copilot.lock.yml`: | ||
|
|
||
| - `GH_AW_PI_MODEL` (`smoke-pi.lock.yml:848`) | ||
| - `PI_CODING_AGENT_DIR` (`smoke-pi.lock.yml:860`) | ||
|
|
||
| ## AWF command/CLI argument differences | ||
|
|
||
| `awf` invocation in copilot includes an extra artifact mount not present in pi: | ||
|
|
||
| - Copilot has `--mount "${RUNNER_TEMP}/gh-aw/safeoutputs/upload-artifacts:...:rw"` (`smoke-copilot.lock.yml:1793`) | ||
| - Pi does not include this mount (`smoke-pi.lock.yml:843`) | ||
|
|
||
| Inner engine command executed via `awf` differs significantly: | ||
|
|
||
| - Copilot runs `copilot_harness.cjs` + `/usr/local/bin/copilot` with copilot flags: | ||
| - `--disable-builtin-mcps` | ||
| - `--autopilot` | ||
| - `--max-autopilot-continues 2` | ||
| - `--allow-all-tools` | ||
| - `--allow-all-paths` | ||
| - `--no-custom-instructions` | ||
| - (`smoke-copilot.lock.yml:1794`) | ||
| - Pi runs `pi --print --mode json --no-session --model ... --extension ...`: | ||
| - no copilot-equivalent autopilot/allow-all-paths/no-custom-instructions flags | ||
| - (`smoke-pi.lock.yml:844`) | ||
|
|
||
| ## Guard/integrity policy differences around AWF execution | ||
|
|
||
| - Copilot path configures `GH_AW_MIN_INTEGRITY: approved` (`smoke-copilot.lock.yml:619`) and `CLI_PROXY_POLICY` with `"min-integrity":"approved"` (`smoke-copilot.lock.yml:1772`) | ||
| - Pi path configures `GH_AW_MIN_INTEGRITY: none` (`smoke-pi.lock.yml:480`) and `CLI_PROXY_POLICY` with `"min-integrity":"none"` (`smoke-pi.lock.yml:826`) | ||
|
|
||
| ## Conclusion (focused on env/CLI mismatch) | ||
|
|
||
| The strongest configuration mismatches tied to AWF behavior are: | ||
|
|
||
| 1. Pi execute env lacks copilot-path variables used for MCP wiring/session integration (`GH_AW_MCP_CONFIG`, `GITHUB_MCP_SERVER_TOKEN`, integration vars). | ||
| 2. Pi executes a different engine command (`pi ...`) with a different CLI contract than copilot harness flags. | ||
| 3. Pi runs under a less strict integrity policy (`none` vs `approved`), which changes guard behavior around tool access/proxying. | ||
|
|
||
| These are the primary environment/CLI differences that explain why AWF can be correctly wired for copilot while pi behaves differently. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[/tdd] The JSDoc says "Falls back to the api-proxy management endpoint when provider is unknown" but because of the
|| "copilot"default on the first line,resolveGatewayUrlis never called with an unknown/null provider — theAWF_API_PROXY_REFLECT_URLfallback branch is unreachable.The two JSDoc sentences are mutually contradictory. If defaulting to Copilot for no-prefix models is the intent, remove the "falls back to management endpoint" sentence. If
AWF_API_PROXY_REFLECT_URLis the intended safety net, the logic should not default to"copilot"before the gateway lookup: