<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Learn you an AI]]></title><description><![CDATA[Practical notes on AI, coding agents, and the tools behind them. Walkthroughs, experiments, and lessons from figuring out what actually works ... usually shortl]]></description><link>https://blog.lyaa.dev</link><generator>RSS for Node</generator><lastBuildDate>Sun, 06 Dec 2026 12:54:18 GMT</lastBuildDate><atom:link href="https://blog.lyaa.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[How to see what coding agents actually send: inspecting with agentgateway]]></title><description><![CDATA[See what Copilot CLI and Claude Code send to models. Inspect prompts, tool calls, context and token usage to improve your skills and instructions.]]></description><link>https://blog.lyaa.dev/how-to-see-what-coding-agents-actually-send-inspecting-with-agentgateway</link><guid isPermaLink="true">https://blog.lyaa.dev/how-to-see-what-coding-agents-actually-send-inspecting-with-agentgateway</guid><category><![CDATA[github copilot]]></category><category><![CDATA[claude-code]]></category><category><![CDATA[ai agents]]></category><category><![CDATA[Developer Tools]]></category><category><![CDATA[observability]]></category><category><![CDATA[skills]]></category><category><![CDATA[agentgateway]]></category><dc:creator><![CDATA[Chas]]></dc:creator><pubDate>Tue, 01 Dec 2026 01:30:00 GMT</pubDate><content:encoded><![CDATA[<p>When I first learned the web, being able to watch Apache logs and Netscape's View Source made me a better developer.</p>
<p>Instead of guessing why your coding agent's behaving a certain way, try inspecting the instructions, tool calls, and results behind its answer... you may be surprised.</p>
<p>Here's a quick guide to connect either <a href="https://claude.com/product/claude-code">Claude Code</a> or Copilot to a <a href="https://docs.github.com/en/copilot/tutorials/roll-out-at-scale/assign-licenses/choose-enterprise-plan">GitHub Copilot business or enterprise account</a> using the wonderful <a href="https://agentgateway.dev/">agentgateway.</a></p>
<h2>Pre-requisite - have a GitHub Copilot license:</h2>
<p>Find out where your Copilot endpoints are:</p>
<pre><code class="language-bash">$ gh api /copilot_internal/user -q '.endpoints'
{
  "api": "https://api.enterprise.githubcopilot.com",
  "exp": "https://exp.enterprise.githubcopilot.com",
  "origin-tracker": "https://origin-tracker.enterprise.githubcopilot.com",
  "proxy": "https://proxy.enterprise.githubcopilot.com",
  "telemetry": "https://telemetry.enterprise.githubcopilot.com"
}
</code></pre>
<h2>Run agentgateway</h2>
<p>Install/upgrade agentgateway locally:</p>
<pre><code class="language-bash">$ curl -sL https://agentgateway.dev/install | bash
</code></pre>
<p>In a new terminal, set your GitHub token as an env var:</p>
<pre><code class="language-bash">export GH_COPILOT_TOKEN=$(gh auth token)
</code></pre>
<p>And create the agentgateway <code>config.yaml</code> - in our case to run on port 3000:</p>
<pre><code class="language-yaml"># yaml-language-server: $schema=https://agentgateway.dev/schema/config
gateways:
  default:
    port: 3000
    protocol: HTTP

llm:
  models:
    - name: "*"
      provider: copilot
      params:
        baseUrl: https://api.enterprise.githubcopilot.com
        apiKey: "$GH_COPILOT_TOKEN"
</code></pre>
<p>Run it:</p>
<pre><code class="language-shell">agentgateway -f ./config.yaml
</code></pre>
<p>CTRL+C to end.</p>
<h2>Test agentgateway is proxying requests to GitHub APIs</h2>
<p>You should be able to make <code>curl</code> requests</p>
<pre><code class="language-bash"> curl localhost:3000/models
</code></pre>
<p>Test with inference with completions and responses endpoints:</p>
<pre><code class="language-bash">curl http://localhost:3000/chat/completions \
 -H "Content-Type: application/json" \
 -d '{
   "model": "claude-haiku-4.5",
   "messages": [{"role": "user", "content": "Reply with OK"}],
   "max_tokens": 32
 }'
</code></pre>
<pre><code class="language-bash">curl http://localhost:3000/responses \
  -H "Content-Type: application/json" \
  -d '{
    "model": "mai-code-2-flash",
    "input": "Reply with OK"
  }'
</code></pre>
<p>And access the admin UI on <a href="http://localhost:15000/ui">http://localhost:15000/ui</a> where you should find access logs already there:</p>
<img src="https://cdn.hashnode.com/uploads/covers/6b1538d095f368bf9e51e4d9/922733d0-f643-4642-b862-3fa50cb4cf9d.png" alt="" style="display:block;margin:0 auto" />

<h2>Connect Github Copilot CLI to agentgateway:</h2>
<p>Now, due to the way Copilot CLI connects to models, you need to set the API format &amp; set a model for a given launch of Copilot. In a new terminal:</p>
<pre><code class="language-bash">export COPILOT_PROVIDER_BASE_URL="http://localhost:3000/v1"
export COPILOT_PROVIDER_TYPE="openai"
export COPILOT_PROVIDER_WIRE_API="responses"
export COPILOT_MODEL="gpt-6.1-sol"

copilot  
</code></pre>
<p>Important: note the <code>/v1</code> on the base URL.</p>
<h2>Connect Claude Code to agentgateway:</h2>
<p>We can also connect Claude Code to agentgateway (assuming your Copilot license allows you select from Anthropic models). This is much simpler:</p>
<pre><code class="language-shell">$ export ANTHROPIC_BASE_URL="http://localhost:3000"
$ export ANTHROPIC_API_KEY="dummy-key"

claude
</code></pre>
<h2>Configure full logging:</h2>
<p>Add agentgateway configuration to persist logs and enable full payload capture. The full <code>config.yaml</code> should now be:</p>
<pre><code class="language-yaml">gateways:
  default:
    port: 3000
    protocol: HTTP

llm:
  gateways:
    - default
  models:
    - name: "*"
      provider: copilot
      params:
        baseUrl: https://api.enterprise.githubcopilot.com
        apiKey: "$GH_COPILOT_TOKEN"

  policies:
    cors:
      allowOrigins:
      - http://localhost:15000
      allowHeaders:
      - '*'
      allowMethods:
      - GET
      - POST
config:
  logging:
    database:
      url: ./request-logs.sqlite
frontendPolicies:
  http:
    maxBufferSize: 33554432 
  accessLog:
    database:
      llm: full
      add:
        debug.http.request_body: 'string(request.body)'
</code></pre>
<blockquote>
<p>NB: yes, this is full-payload capture - meant for local development only.</p>
</blockquote>
<p>Restart agentgateway, make some new requests (via curl or your coding agent) and check the <a href="http://localhost:15000/ui/llm/logs">http://localhost:15000/ui/llm/logs</a> page for metrics on each request:</p>
<img src="https://cdn.hashnode.com/uploads/covers/6b1538d095f368bf9e51e4d9/61e397d3-1f60-4855-b9fa-a88a423fdc57.png" alt="" style="display:block;margin:0 auto" />

<p>Click the expandable "conversation" element to see the details:</p>
<img src="https://cdn.hashnode.com/uploads/covers/6b1538d095f368bf9e51e4d9/9897baa2-15ec-4e92-9e53-8b7f95853fb3.png" alt="" style="display:block;margin:0 auto" />

<p>Spend some time reading through these. Understand what the agent already receives before deciding what your skills and instructions need to add.</p>
<h2>Next steps</h2>
<p>In further articles, we will look at some of the things you can learn from this.</p>
<p>In the meantime, see this starter repo for more details, including running persisting logs to a database, and optional connecting <a href="https://arize.com/phoenix/">Arize Phoenix</a> AI observability &amp; evaluation.</p>
]]></content:encoded></item></channel></rss>