Skip to content

Fix Crush harness sending chat-completions requests to unresolvable api-proxy host - #52895

Merged
pelikhan merged 3 commits into
mainfrom
copilot/aw-failures-fix-chat-completions
Aug 15, 2026
Merged

Fix Crush harness sending chat-completions requests to unresolvable api-proxy host#52895
pelikhan merged 3 commits into
mainfrom
copilot/aw-failures-fix-chat-completions

Conversation

Copilot AI commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

The Crush harness correctly resolved its LLM endpoint baseUrl via the /reflect probe (rewriting api-proxy to host.docker.internal for sandboxed runs), but then immediately overwrote that value with a base URL re-derived directly from the raw models_url, skipping the rewrite. The crush binary's actual /chat/completions request was thus sent to the bare api-proxy hostname, which the sandbox's DNS cannot resolve, failing every run before the first turn completed.

Changes

  • actions/setup/js/awf_reflect.cjs: added deriveBaseUrlFromModelsURL(), which derives a base URL from models_url (stripping the trailing /models path segment) while applying the same api-proxyhost.docker.internal HOSTALIASES bridge rewrite used elsewhere in this module. Exported alongside the existing reflect helpers.
  • .github/workflows/shared/crush.md: harness-script now calls deriveBaseUrlFromModelsURL() instead of manually reconstructing the URL inline, so the rewrite can no longer be silently bypassed.
  • actions/setup/js/awf_reflect.test.cjs: added unit tests for the new helper, including a regression case that reproduces the exact failure (models_url pointing at api-proxy with HOSTALIASES mapping it to localhost).
  • Recompiled workflows importing shared/crush.md: daily-arxiv-researcher, daily-code-metrics, smoke-crush.
// Before: rewrite bypassed
const modelsURL = new URL(reflectedEndpoint.models_url);
const basePath = modelsURL.pathname.replace(/\/models\/?$/i, "");
baseUrl = `${modelsURL.origin}${basePath}`;

// After: reuses the same bridge rewrite as resolveProviderEndpointFromReflect
baseUrl = deriveBaseUrlFromModelsURL(reflectedEndpoint.models_url);

…host

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix Crush harness hardcoded api-proxy host for chat completions Fix Crush harness sending chat-completions requests to unresolvable api-proxy host Aug 15, 2026
Copilot AI requested a review from pelikhan August 15, 2026 13:39
@pelikhan
pelikhan marked this pull request as ready for review August 15, 2026 13:40
Copilot AI balanced review requested due to automatic review settings August 15, 2026 13:40
@pelikhan

Copy link
Copy Markdown
Collaborator

@copilot apply to other definition based engine files

@pelikhan

Copy link
Copy Markdown
Collaborator

/smoke-crush

@github-actions

github-actions Bot commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

🎯 Smoke Crush Crush delivered.

Warning

Threat Detection Engine Failure — The analysis engine could not complete. This is a tooling failure, not a security finding.

What happened

The threat detection results could not be parsed.

Review the workflow run logs for details.

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • proxy.golang.org

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "proxy.golang.org"

See Network Configuration for more information.

Smoke Crush — Powered by Crush

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes Crush endpoint resolution so chat-completions requests use the sandbox-reachable host bridge.

Changes:

  • Adds and tests a shared base-URL derivation helper.
  • Updates the Crush harness to use the helper.
  • Recompiles affected workflows.
Show a summary per file
File Description
actions/setup/js/awf_reflect.cjs Adds and exports the URL helper.
actions/setup/js/awf_reflect.test.cjs Adds helper regression tests.
.github/workflows/shared/crush.md Applies the helper in the Crush harness.
.github/workflows/daily-arxiv-researcher.lock.yml Regenerates the imported harness.
.github/workflows/daily-code-metrics.lock.yml Regenerates the imported harness.
.github/workflows/smoke-crush.lock.yml Regenerates the imported harness.

Review details

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

  • Files reviewed: 6/6 changed files
  • Comments generated: 2
  • Review effort level: Balanced

Comment thread actions/setup/js/awf_reflect.test.cjs Outdated
});

it("defaults to process.env and fs.readFileSync when not provided, with no path prefix before /models", () => {
expect(deriveBaseUrlFromModelsURL("http://api-proxy:10002/models")).toBe("http://api-proxy:10002");
// api-proxy -> host.docker.internal HOSTALIASES bridge rewrite, so the crush
// binary's own chat-completions request never targets the unresolvable
// "api-proxy" hostname.
baseUrl = deriveBaseUrlFromModelsURL(reflectedEndpoint.models_url);
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>

Copilot AI commented Aug 15, 2026

Copy link
Copy Markdown
Contributor Author

@copilot apply to other definition based engine files

Applied in 59876dd: resolveOpenAICompatibleEndpointFromReflect() now also applies the api-proxy → host bridge rewrite, covering Goose-style definition-based engines, with a regression test for the bridged OpenAI-compatible endpoint path.

@pelikhan
pelikhan merged commit 2f94ee7 into main Aug 15, 2026
1 check passed
@pelikhan
pelikhan deleted the copilot/aw-failures-fix-chat-completions branch August 15, 2026 14:02
@github-actions

Copy link
Copy Markdown
Contributor

🎉 This pull request is included in a new release.

Release: v0.86.3

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

Labels

None yet

Projects

None yet

3 participants