Skip to content

fix(api-proxy): trace Copilot image content across proxy boundaries - #11265

Merged
lpcox merged 4 commits into
mainfrom
copilot/awf-api-proxy-image-tool-results
Nov 7, 2026
Merged

lpcox merged 4 commits into
mainfrom
copilot/awf-api-proxy-image-tool-results

Conversation

Copilot AI commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

Copilot view can report PNG success while subsequent inference requests contain only text. This change adds evidence to distinguish client-side image omission from proxy transformation; it does not assume a Copilot CLI root cause.

  • Diagnostics: Add debug-level request_shape records before transforms and each upstream HTTP attempt. Count allowlisted message and tool-output types; exclude payloads, URLs, credentials, and arbitrary type labels.
  • Passthrough coverage: Exercise the Copilot adapter against a local upstream, asserting byte-identical Responses message images and function_call_output image arrays when no rewrite is required.
  • Size boundaries: Cover exact-limit chunked requests and oversized-body rejection. Preserve the 10 MiB encoded-request limit and HTTP 413 behavior—no partial forwarding.
  • Troubleshooting: Document shape-log interpretation, Squid’s default TLS-splice behavior, and conditional Copilot CLI handoff when image parts are absent at ingress.

Copilot AI changed the title [WIP] Fix image tool results forwarding to model inference fix(api-proxy): trace Copilot image content across proxy boundaries Nov 7, 2026
Copilot AI requested a review from lpcox November 7, 2026 15:19
@lpcox
lpcox marked this pull request as ready for review November 7, 2026 15:26
Copilot AI adaptive review requested due to automatic review settings November 7, 2026 15:26

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.

🟢 Approval recommended

No active review issues are identified for the request-shape diagnostics and regression-coverage changes.

No open issues 🎉

What changed in this PR

This PR adds diagnostics and regression coverage to help distinguish Copilot client-side image omission from changes made by AWF’s API proxy, without assuming the root cause.

Changes:

  • Add payload-free request-shape logs before transforms and each upstream HTTP attempt.
  • Add tests for byte-identical image forwarding, exact-limit chunked requests, and oversized-body rejection.
  • Document log interpretation, size limits, Squid behavior, and conditional upstream reporting.
File Description
docs/​troubleshooting.md Explain image diagnostics, request limits, and upstream handoff.
containers/​api-proxy/​upstream-http.js Log request shape before each upstream HTTP attempt.
containers/​api-proxy/​server.multimodal.test.js Cover image passthrough and 10 MiB size boundaries.
containers/​api-proxy/​proxy-request.js Log inbound request shape before body transforms.
containers/​api-proxy/​logging.test.js Cover type counts, payload exclusion, and malformed bodies.
containers/​api-proxy/​logging.js Implement Copilot request-shape logging with allowlisted type labels.

Review effort: Balanced (auto)

@lpcox

lpcox commented Nov 7, 2026

Copy link
Copy Markdown
Collaborator

@copilot merge main and resolve conflicts and review feedback

Copilot AI commented Nov 7, 2026

Copy link
Copy Markdown
Contributor Author

@copilot merge main and resolve conflicts and review feedback

Merged main cleanly with no conflicts in merge commit 69082eb. The existing review approval reports no open issues.

@github-actions

github-actions Bot commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

✅ Copilot review passed with no inline comments.

@copilot Add the ready-for-aw label to this PR to trigger agentic CI smoke tests.

@github-actions

github-actions Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

Documentation Preview

Documentation has been built for this PR.

Download preview artifact

To view locally:

  1. Download the docs-preview-pr-11265 artifact from the workflow run
  2. Unzip and open index.html in your browser

Built from commit 4e0e8f0

@github-actions

github-actions Bot commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

✅ Coverage Check Passed

Overall Coverage

Metric Base PR Delta
Lines 93.77% 93.77% ➡️ +0.00%
Statements 92.30% 92.31% 📈 +0.01%
Functions 93.02% 93.02% ➡️ +0.00%
Branches 86.57% 86.57% ➡️ +0.00%
📁 Per-file Coverage Changes (1 files)
File Lines (Before → After) Statements (Before → After)
src/enclave/host-executor-server.ts 91.2% → 91.2% (+0.00%) 89.8% → 90.1% (+0.29%)

Coverage comparison generated by scripts/ci/compare-coverage.ts

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[awf] api-proxy: image tool results not forwarded to model inference (Copilot view PNG)

3 participants