<?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: ZAKARIA KHCHICHE</title>
    <description>The latest articles on DEV Community by ZAKARIA KHCHICHE (@zakaria_khchiche_490919ed).</description>
    <link>https://dev.to/zakaria_khchiche_490919ed</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%2F4154395%2Fbd112ff7-0b35-43bb-98ba-63a508f209cf.png</url>
      <title>DEV Community: ZAKARIA KHCHICHE</title>
      <link>https://dev.to/zakaria_khchiche_490919ed</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/zakaria_khchiche_490919ed"/>
    <language>en</language>
    <item>
      <title>Three silent bugs in an open-source AI agent framework</title>
      <dc:creator>ZAKARIA KHCHICHE</dc:creator>
      <pubDate>Thu, 01 Oct 2026 10:23:24 +0000</pubDate>
      <link>https://dev.to/zakaria_khchiche_490919ed/three-silent-bugs-in-an-open-source-ai-agent-framework-igd</link>
      <guid>https://dev.to/zakaria_khchiche_490919ed/three-silent-bugs-in-an-open-source-ai-agent-framework-igd</guid>
      <description>&lt;p&gt;A bug that crashes gets noticed right away. A bug that returns a plausible but wrong result can run in production for months without anyone noticing.&lt;/p&gt;

&lt;p&gt;While auditing the code of OGX, an open-source framework for building AI agents, I found three of them. None raises an error. Each one quietly skews a result: search relevance, a document filter, or a token bill.&lt;/p&gt;

&lt;h2&gt;
  
  
  Context: OGX, formerly Llama Stack
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://github.com/ogx-ai/ogx" rel="noopener noreferrer"&gt;OGX&lt;/a&gt; is the continuation of Meta's Llama Stack project. It provides the standard building blocks of an agentic application: inference, an OpenAI-compatible Responses API, and vector stores for RAG (Elasticsearch, pgvector, Qdrant…).&lt;/p&gt;

&lt;p&gt;Teams that build agents on this kind of foundation trust those blocks without rereading them. That is exactly where an audit pays off: looking for what "almost" works.&lt;/p&gt;

&lt;h2&gt;
  
  
  Bug 1: one extra letter disables a search setting
&lt;/h2&gt;

&lt;p&gt;Elasticsearch hybrid search merges a keyword search and a vector search (RRF). The &lt;code&gt;rank_window_size&lt;/code&gt; parameter sets how many candidates enter that merge.&lt;/p&gt;

&lt;p&gt;In the code, the list of allowed parameters contained &lt;code&gt;rank_windows_size&lt;/code&gt;, with an extra "s". The correct parameter was treated as unknown and silently dropped.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# before
&lt;/span&gt;&lt;span class="n"&gt;allowed_rrf_params&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;rank_constant&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;rank_windows_size&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;filter&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="c1"&gt;# after
&lt;/span&gt;&lt;span class="n"&gt;allowed_rrf_params&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;rank_constant&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;rank_window_size&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;filter&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Requested&lt;/th&gt;
&lt;th&gt;Actually sent (before)&lt;/th&gt;
&lt;th&gt;After fix&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;rank_window_size = 50&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;10 (default)&lt;/td&gt;
&lt;td&gt;50&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;A one-character fix, submitted in &lt;a href="https://github.com/ogx-ai/ogx/pull/6697" rel="noopener noreferrer"&gt;pull request #6697&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Bug 2: pgvector filters that never match booleans
&lt;/h2&gt;

&lt;p&gt;With pgvector you can filter documents on their metadata, for example "published = true". For "in list" (IN) and "not in list" (NOT IN) filters, the code converted each value to Python text: &lt;code&gt;True&lt;/code&gt; became &lt;code&gt;"True"&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;PostgreSQL extracts the JSON metadata as &lt;code&gt;"true"&lt;/code&gt;. The two never match. Same problem for a number stored as &lt;code&gt;2023.0&lt;/code&gt; filtered on &lt;code&gt;2023&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Tested on a real PostgreSQL 16 database with two documents:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Filter&lt;/th&gt;
&lt;th&gt;Before&lt;/th&gt;
&lt;th&gt;After fix&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;published in [true]&lt;/td&gt;
&lt;td&gt;no result&lt;/td&gt;
&lt;td&gt;document 0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;published not in [true]&lt;/td&gt;
&lt;td&gt;documents 0 and 1&lt;/td&gt;
&lt;td&gt;document 1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;year in [2023]&lt;/td&gt;
&lt;td&gt;no result&lt;/td&gt;
&lt;td&gt;document 1&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The worst case is the exclusion filter: it lets through documents you meant to exclude. In a RAG pipeline, that means unpublished or outdated sources injected into the model's context. The fix applies to lists the same typed casts already used for single-value comparisons.&lt;/p&gt;

&lt;p&gt;Fix submitted in &lt;a href="https://github.com/ogx-ai/ogx/pull/6698" rel="noopener noreferrer"&gt;pull request #6698&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Bug 3: a token counter that forgets earlier calls
&lt;/h2&gt;

&lt;p&gt;An agent often makes several model calls for a single response, for example when it uses tools. The Responses API correctly sums input and output tokens across those calls.&lt;/p&gt;

&lt;p&gt;But two detailed counters were overwritten instead of summed: cached tokens and reasoning tokens. Only the last call counted.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Example over 2 calls&lt;/th&gt;
&lt;th&gt;Before&lt;/th&gt;
&lt;th&gt;After fix&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Cached tokens (80 + 120)&lt;/td&gt;
&lt;td&gt;120&lt;/td&gt;
&lt;td&gt;200&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Reasoning tokens (10 + 15)&lt;/td&gt;
&lt;td&gt;15&lt;/td&gt;
&lt;td&gt;25&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;These are exactly the two figures used for cost tracking. Caching lowers the bill, reasoning raises it. A dashboard built on these values under-estimated both.&lt;/p&gt;

&lt;p&gt;Reported in &lt;a href="https://github.com/ogx-ai/ogx/issues/6699" rel="noopener noreferrer"&gt;issue #6699&lt;/a&gt;, with a proposed fix (&lt;a href="https://github.com/Zakariakhchiche/ogx/commit/e8177d053f2a72a81909a5b9d9c21ede5ba895ee" rel="noopener noreferrer"&gt;commit e8177d0&lt;/a&gt;).&lt;/p&gt;

&lt;h2&gt;
  
  
  What this means for teams shipping agents
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Test what is silent.&lt;/strong&gt; An ignored parameter or a filter that doesn't filter triggers no alert. You need a test that checks the value actually sent, not just the absence of errors.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Test with real types.&lt;/strong&gt; Bugs 2 and 3 only show up with booleans, floats or chained calls. "Strings and a single call" test suites miss them.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Don't blindly trust the foundation.&lt;/strong&gt; A popular open-source framework is still code written fast. Reviewing the critical blocks (filtering, costs) before production takes a few hours.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Contribute back.&lt;/strong&gt; Each fix here is a few lines. Submitting it upstream helps everyone who builds on the same foundation.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Building agents on OGX or another framework? I'd love to hear which silent bugs you've run into.&lt;/p&gt;

&lt;p&gt;Let's talk, or get your own agents audited: &lt;a href="https://www.linkedin.com/in/zakariakhchiche/" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt; · &lt;a href="https://www.malt.fr/profile/zakariakhchiche" rel="noopener noreferrer"&gt;Malt&lt;/a&gt; · &lt;a href="https://medium.com/@ZKHCHICHE" rel="noopener noreferrer"&gt;Medium&lt;/a&gt;&lt;/p&gt;

</description>
      <category>agents</category>
      <category>ai</category>
      <category>bug</category>
      <category>security</category>
    </item>
  </channel>
</rss>
