<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Naresh</title>
    <description>The latest articles on DEV Community by Naresh (@nareshh74).</description>
    <link>https://dev.to/nareshh74</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1100136%2F70d15da1-03f1-41ad-abd4-b9ab3fd3171a.jpeg</url>
      <title>DEV Community: Naresh</title>
      <link>https://dev.to/nareshh74</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/nareshh74"/>
    <language>en</language>
    <item>
      <title>What 84,800 local spans taught me about my coding agents and my local AI services</title>
      <dc:creator>Naresh</dc:creator>
      <pubDate>Mon, 09 Nov 2026 10:45:50 +0000</pubDate>
      <link>https://dev.to/nareshh74/what-84800-local-spans-taught-me-about-my-coding-agents-and-my-local-ai-services-2ln2</link>
      <guid>https://dev.to/nareshh74/what-84800-local-spans-taught-me-about-my-coding-agents-and-my-local-ai-services-2ln2</guid>
      <description>&lt;p&gt;When I run one coding agent in one terminal, I can scroll up to find out what failed. My setup stopped working that way a few months ago.&lt;/p&gt;

&lt;p&gt;On my workstation I run two kinds of software at the same time. The first kind is coding agents: Claude Code with subagents, OpenAI Codex CLI, GitHub Copilot CLI, Aider, and Cline. The second kind is the local services those agents call: a LiteLLM router for model routing and fallbacks, Ollama for local models, SearXNG for search, Firecrawl for scraping, and a local memory service.&lt;/p&gt;

&lt;p&gt;Failures in that setup rarely print a stack trace. A parent agent stops answering. A nightly job produces nothing. A scrape-and-summarize run dies in the middle. I could not tell whether the fault was in the agent, in the router, or in a service.&lt;/p&gt;

&lt;p&gt;Tools like ccusage and CodeBurn answer how many tokens I spent. agentsview lets me read transcripts. I needed something different: one place to see which child session hung, which service was slow, and whether last night's jobs ran.&lt;/p&gt;

&lt;p&gt;So I wrote &lt;a href="https://github.com/nareshh74/agent-tap" rel="noopener noreferrer"&gt;agent-tap&lt;/a&gt;. It reads the logs, databases, and health endpoints that my agents and services already produce, and it stores them in one SQLite file. A dashboard at &lt;code&gt;http://127.0.0.1:6007&lt;/code&gt; shows the result.&lt;/p&gt;

&lt;h3&gt;
  
  
  What the first run showed
&lt;/h3&gt;

&lt;p&gt;The local SQLite database indexed 21,032 traces and 84,866 spans across 21,030 sessions. I looked at the error and correlation tables and found five problems that I had not noticed before.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;An MCP token refresh failed about 2,030 times.&lt;/strong&gt; An MCP server returned HTTP 400 on every OAuth refresh (&lt;code&gt;mcp_oauth_400_refresh_loop&lt;/code&gt;), and the harness retried in the background without showing an error. Grouping spans by &lt;code&gt;error.class&lt;/code&gt; made the loop visible in one query.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The local router closed connections after 120 seconds.&lt;/strong&gt; Long prompts took more than 120 seconds to reach the first token, so the router hit its &lt;code&gt;first_byte_timeout&lt;/code&gt; and logged &lt;code&gt;gateway_http_499&lt;/code&gt; drops. I found it by joining harness spans with gateway spans.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;LiteLLM 1.85.0 crashed in the middle of a stream.&lt;/strong&gt; Delegated runs died with truncated tool calls (&lt;code&gt;litellm_midstream_fallback_error&lt;/code&gt;). The parent-to-child link took me from the failed parent to the exact line in the gateway log.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Child agents hung for 600 seconds.&lt;/strong&gt; A child session waited on an interactive prompt with no terminal attached, and the parent looked frozen until the 600 second ACP timeout (&lt;code&gt;acp_prompt_timeout_600s&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Codex background jobs failed with HTTP 401.&lt;/strong&gt; In a terminal, an expired credential fails loudly. In a job without a terminal, the 401 turned into an empty review. A query for Codex spans with status &lt;code&gt;ERROR&lt;/code&gt; listed every affected job.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Agents and services in one model
&lt;/h3&gt;

&lt;p&gt;An agent run fails in the agent, or in a service the agent called. To see both, agent-tap treats every target as a service with a kind.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A &lt;code&gt;harness&lt;/code&gt; is a coding agent such as Claude Code, Codex, Copilot CLI, Aider, or Cline. It appears in Harness Activity with sessions, turns, tool calls, skill calls, and parent-to-child links.&lt;/li&gt;
&lt;li&gt;A &lt;code&gt;gateway&lt;/code&gt; is a model router or proxy such as LiteLLM or an OpenAI-compatible local gateway.&lt;/li&gt;
&lt;li&gt;A &lt;code&gt;service&lt;/code&gt; is anything else, such as Ollama, SearXNG, or Firecrawl. A service can be an HTTP endpoint, a Docker container, a process, or a log file.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Gateways and services appear in Running Services &amp;amp; Gateways with their status, request count, error count, and p50 and p90 latency. All targets share the error classes, the trace drawer, and the schedule view. To add a service of your own, run &lt;code&gt;agent-tap onboard --name my-api --kind service --health-url http://127.0.0.1:9000/health&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  How it works
&lt;/h3&gt;

&lt;p&gt;agent-tap does not wrap your agents or sit in front of them. It reads files and databases that already exist and remembers its position in each one, so every poll reads only new data. The storage is one SQLite file in WAL mode. The tables have the same shape as Arize Phoenix, and you can query them with &lt;code&gt;agent-tap query&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Prompt text is off by default. Before agent-tap writes a span, it drops prompt and response text and tool arguments. It keeps sizes, token counts, tool names, durations, session links, and error classes. If you turn prompt storage on, a redaction pass still masks bearer tokens, &lt;code&gt;sk-&lt;/code&gt; keys, GitHub tokens, and JSON Web Tokens.&lt;/p&gt;

&lt;p&gt;If an adapter misreads your logs, run &lt;code&gt;agent-tap bug-report&lt;/code&gt;. It prints a diagnostic bundle with secrets masked and your home directory replaced by &lt;code&gt;~&lt;/code&gt;, and &lt;code&gt;--open&lt;/code&gt; starts a pre-filled GitHub issue.&lt;/p&gt;

&lt;h3&gt;
  
  
  Try it
&lt;/h3&gt;

&lt;p&gt;agent-tap is MIT licensed and needs Python 3.11 or later. It runs on Linux, macOS, Windows, and WSL2.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pipx &lt;span class="nb"&gt;install &lt;/span&gt;agent-tap
agent-tap init
agent-tap run &lt;span class="nt"&gt;--once&lt;/span&gt;
agent-tap serve
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Run &lt;code&gt;agent-tap doctor&lt;/code&gt; first if you only want to see what it finds. The code and documentation are at &lt;a href="https://github.com/nareshh74/agent-tap" rel="noopener noreferrer"&gt;https://github.com/nareshh74/agent-tap&lt;/a&gt;. If you run several agents or local services, I would like to know which one your logs break first.&lt;/p&gt;

&lt;p&gt;Naresh Kumar&lt;/p&gt;

</description>
      <category>ai</category>
      <category>opensource</category>
      <category>observability</category>
      <category>devtools</category>
    </item>
  </channel>
</rss>
