SShortSingh.
Back to feed

Developer spends $402 on one AI ticket, builds fix to track per-turn costs accurately

0
·7 views

A software team lead at Oizom discovered that a single ticket on his AI-powered board had accumulated $402 across nine agent runs, with no cost visibility in the app. The issue stemmed from how Claude Code reports total_cost_usd as a cumulative session total rather than a per-run figure, causing naive readings to double-count earlier runs. To fix this, the open-source orchestrator was updated to subtract the previously saved session total from the new one at the end of each turn, isolating the actual spend per run. Edge cases such as new sessions, resumed sessions, and runs that exit without a result line were all accounted for in the revised logic. The solution was implemented in the project's ticket-tracker orchestrator, which manages headless Claude Code sessions for AI agents acting as board members.

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingDEV Community ·

How One Developer Escaped $11/hr Freelance Pricing With a Value-Based Framework

A mid-career freelance developer realized he was effectively earning around $6.50 per hour after accounting for non-billable time, taxes, and overhead — despite charging $11.40 per hour. The turning point came when a logistics client revealed that a reporting automation he had built at a low hourly rate was saving the company roughly $18,000 a year in labor costs. This gap between his effort-based pricing and the client's actual outcome highlighted a core flaw in hourly billing: it rewards slow work and penalizes efficiency. The developer subsequently rebuilt his pricing approach around value to the client rather than time spent, shifting from hourly rates to project-based fees tied to measurable outcomes. He now shares this framework with freelancers stuck in a cycle of undercharging, arguing that small hourly numbers invite easy negotiation while fixed project prices prompt more deliberate consideration from clients.

0
ProgrammingDEV Community ·

structuredClone() vs JSON.stringify(): The Right Tool for Deep Copying in JS

JavaScript developers have long used JSON.parse(JSON.stringify()) as a quick workaround for deep-copying objects, but the technique has notable limitations. It fails to correctly handle data types like Date, Map, Set, and undefined, and throws a TypeError when encountering circular references. The structuredClone() API, built specifically for cloning structured data, handles all these cases more reliably and even preserves circular reference relationships in the cloned output. However, structuredClone() is not without constraints — it cannot clone functions, DOM nodes, or prototype chains. Developers are advised to use structuredClone() for deep copying data and reserve JSON.stringify() for its intended purpose of serialization.

0
ProgrammingDEV Community ·

PackAI Uses AI and Memory Layers to Guide Small Food Businesses on Packaging

PackAI is a prototype AI-powered tool designed to help small food businesses choose appropriate packaging materials without needing an in-house packaging engineer. The system analyzes a food item and recommends materials based on factors such as barrier performance, shelf life, cost, and recyclability. A memory layer built on the Hindsight agent memory system allows PackAI to recall user preferences from past sessions and prioritize relevant options in future recommendations. The current version relies on rule-based logic with manually set profiles rather than trained machine-learning models, so its outputs are meant as guidance rather than validated engineering specifications. Planned improvements include password security upgrades, expert-validated material data, data-driven models, regional recyclability information, and a user-feedback loop to refine recommendations over time.

0
ProgrammingDEV Community ·

Developer Seeks Testers for Open-Source Flutter Security Tool Aqiron

A solo developer has built Aqiron Security, an open-source, local-first application security tool that runs as a VS Code extension with an initial focus on Flutter workspaces. The tool aims to consolidate fragmented security workflows — including static analysis, findings triage, and reporting — into a single interface. Its architecture separates a TypeScript security runtime from the VS Code UI via a Node.js process, and supports optional integrations with external scanners and AI providers like Ollama and OpenRouter. After redesigning core workflows to improve usability, the developer acknowledges that single-person development poses risks for a security product and is now actively seeking external developers to test, critique, and stress-test the tool. Rather than stars or praise, the creator is specifically asking for bug reports, architectural feedback, and real-world Flutter project test cases.