<?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: Riya</title>
    <description>The latest articles on DEV Community by Riya (@riyat121).</description>
    <link>https://dev.to/riyat121</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%2F4227963%2F3cafc558-4331-497d-a5d5-f46d0cb3ad63.jpg</url>
      <title>DEV Community: Riya</title>
      <link>https://dev.to/riyat121</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/riyat121"/>
    <language>en</language>
    <item>
      <title>A refund desk where AI agents stop and ask a human: building it with Switch on a Windows laptop</title>
      <dc:creator>Riya</dc:creator>
      <pubDate>Thu, 05 Nov 2026 08:04:14 +0000</pubDate>
      <link>https://dev.to/riyat121/a-refund-desk-where-ai-agents-stop-and-ask-a-human-building-it-with-switch-on-a-windows-laptop-13e5</link>
      <guid>https://dev.to/riyat121/a-refund-desk-where-ai-agents-stop-and-ask-a-human-building-it-with-switch-on-a-windows-laptop-13e5</guid>
      <description>&lt;p&gt;Refunds are money. An agent that approves everything is risky, and an agent that asks a human about everything is useless. For the Flip the Switch hackathon I built &lt;strong&gt;Refund Desk&lt;/strong&gt;: three agents that decide the easy cases, stop at the risky ones, and wait for a person.&lt;/p&gt;

&lt;h2&gt;
  
  
  What it does
&lt;/h2&gt;

&lt;p&gt;Three OpenCode agents (free models) share one Switch room backed by Mattermost:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Records&lt;/strong&gt; reads &lt;code&gt;orders.json&lt;/code&gt; and posts the order facts.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Policy&lt;/strong&gt; applies the rules in &lt;code&gt;refund_policy.md&lt;/code&gt; and posts a verdict.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Reply&lt;/strong&gt; writes the customer message.&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Order&lt;/th&gt;
&lt;th&gt;What happened&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;$20&lt;/td&gt;
&lt;td&gt;Auto-approved, the customer got an approval message&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;$320&lt;/td&gt;
&lt;td&gt;Policy stopped and asked me. Only after &lt;code&gt;@riyaa-policy APPROVE&lt;/code&gt; did Reply write&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;$180&lt;/td&gt;
&lt;td&gt;I rejected it, the customer got a polite refusal&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;$899&lt;/td&gt;
&lt;td&gt;Flagged as fraud (4 refunds in 90 days, mismatched addresses). No refund, and the customer was only told the account is under review&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Why Switch matters here
&lt;/h2&gt;

&lt;p&gt;The agents hand work to each other by @mention, with no glue code. They share one room history, so when I asked for an order that was already approved, Policy replied &lt;code&gt;DUPLICATE&lt;/code&gt; and Reply did not send a second message. The human gate is just a room message: Policy waits until a person replies.&lt;/p&gt;

&lt;h2&gt;
  
  
  Setting it up as a first-timer on Windows
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Install Docker Desktop and Switch Console (the Windows build is early access).&lt;/li&gt;
&lt;li&gt;In Console, choose "Run Switch on this computer".&lt;/li&gt;
&lt;li&gt;Install OpenCode and use one of its free models.&lt;/li&gt;
&lt;li&gt;Create three agents with New agent (provider OpenCode, run location This computer) and paste each agent's instructions.&lt;/li&gt;
&lt;li&gt;Create a room with the Mattermost bridge and add the three agents.&lt;/li&gt;
&lt;li&gt;Post &lt;code&gt;@riyaa-records Refund request for order 1007&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Things that tripped me up
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Switch's OpenCode sign-in failed with "Database is not empty and has no session table". Stopping the &lt;code&gt;opencode-cli&lt;/code&gt; process and renaming the &lt;code&gt;opencode.db*&lt;/code&gt; files in &lt;code&gt;~/.local/share/opencode&lt;/code&gt; to &lt;code&gt;.backup&lt;/code&gt; fixed it. I renamed instead of deleting, so nothing was lost.&lt;/li&gt;
&lt;li&gt;Creating my first room failed with an HTTP 500. It worked after I shortened the description and changed the name, but I can't be sure which one fixed it.&lt;/li&gt;
&lt;li&gt;Agents only listen when mentioned, so even the human approval must be &lt;code&gt;@riyaa-policy APPROVE &amp;lt;order&amp;gt;&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;A room template can only add agents that already exist, so I created the agents by hand.&lt;/li&gt;
&lt;li&gt;Free models can take up to a minute per step.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What I would add next
&lt;/h2&gt;

&lt;p&gt;Real orders from an API instead of a JSON file, and PII redaction before messages reach the room.&lt;/p&gt;

&lt;h2&gt;
  
  
  Demo and code
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Video: &lt;a href="https://youtu.be/w-_5FaQ517U" rel="noopener noreferrer"&gt;https://youtu.be/w-_5FaQ517U&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Code: &lt;a href="https://github.com/Riyat121/refund-desk" rel="noopener noreferrer"&gt;https://github.com/Riyat121/refund-desk&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I built this with AI assistance (Claude) and can explain every part of it.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>hackathon</category>
      <category>opensource</category>
      <category>devops</category>
    </item>
  </channel>
</rss>
