Most Notion templates are built by hand: click a database into existence, add properties, drag views around, copy the page. That works once. It does not work when you want to rebuild it after a Notion change, review exactly what it will create, or ship several templates that share a style. So I build mine as code. Each template is a small Node.js project that generates a list of Notion API calls, lets me read them, and only then pushes them. This post walks through the design using one of them, an Architecture Snippet Vault: a Snippets database and a Collections database linked both ways, six views, a dashboard page and sample content. The script works in two steps: Local review. It writes the exact API payloads to schema.json and the page text to layout.md. No token and no network needed. Push. It shows what it will create, asks for confirmation, and on yes runs the files on disk through the official @notionhq/client. The second point matters. What gets pushed is not regenerated in memory. It is the file I (or a buyer) just edited, so a changed property name or a deleted view in schema.json is exactly what reaches Notion. Command Regenerates files Prompts Pushes npm run review yes no no npm start yes (overwrites edits) yes on yes npm run push no yes on yes The confirmation is a plain yes. Anything else exits without contacting Notion. schema.json is an ordered list of API calls (33 of them for this template). A file that tells a script what to call is a file that could call anything, so the runner only accepts a fixed set: // The only API calls schema.json may make. An edited or foreign schema cannot call anything else. const CALLS = { "pages.create": (notion, payload) => notion.pages.create(payload), "pages.updateMarkdown": (notion, payload) => notion.pages.updateMarkdown(payload), "databases.create": async (notion, payload) => { /* ... */ }, "dataSources.update": (notion, payload) => notion.dataSources.update(payload), "views.create": (notion, payload) => notion.
A WordPress login redirect loop looks scary: you enter valid credentials and land back on the login form. In practice it is almost always an access problem, not data loss, and the causes follow a predictable order. After login, WordPress sets an auth cookie and sends you to the dashboard. The dashboard checks for that cookie. If it is missing, blocked, or set for a different host, WordPress treats you as logged out and redirects you back. So almost every cause is one of three things: an address mismatch, a redirect conflict, or something blocking the cookie. Clear cookies for the site and try a private window Try a second browser (rules out extensions) Make sure you are on the canonical host (https, www or non-www) The most common cause, usually after an SSL, www, or domain change. If you can't open Settings, General, force the values in wp-config.php: define( 'WP_HOME', 'https://example.com' ); define( 'WP_SITEURL', 'https://example.com' ); Remove them once the real settings are correct, since they override the dashboard. If that doesn't help, update the siteurl and home rows in the options table (check your table prefix). Cloudflare's Flexible SSL talks HTTPS to the visitor but HTTP to your origin. If the origin also forces HTTPS, the two bounce each other until the browser reports too many redirects. Switch to Full (strict) with a valid origin certificate. Behind a proxy, WordPress may need to trust the forwarded header: if ( isset( $_SERVER['HTTP_X_FORWARDED_PROTO'] ) && $_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https' ) { $_SERVER['HTTPS'] = 'on'; } Only use this if your host or proxy actually sets that header. Also make sure only one thing forces HTTPS: host setting, plugin, or .htaccess rule. Rename .htaccess to .htaccess-old and test. If login works, regenerate it from Settings, Permalinks, then re-add custom rules one at a time. A stray COOKIE_DOMAIN constant, www and non-www mixed up, or whitespace before the opening PHP tag in wp-config.php or functions.php
Spring WebFlux is Spring's reactive alternative to Spring MVC: it uses non-blocking I/O and Reactor's Mono and Flux to handle concurrent requests with a small pool of threads. Both frameworks share the same controller annotations. To migrate, replace spring-boot-starter-web with spring-boot-starter-webflux, adapt servlet APIs to WebFilter, ServerWebExchange and WebSession, and compose asynchronous operations with reactive types. Replace blocking calls with non-blocking APIs or move them to worker threads. For authentication, spring-webflux-pac4j runs pac4j's synchronous security logic on worker threads. We'll reuse the OIDC configuration from the Spring Boot guide and adapt the web integration. The example uses Spring Boot 3, Java 17 and spring-webflux-pac4j 3.0.2, with the default OIDC authorization code flow. Start with a Spring Boot 3 Maven application using the WebFlux starter and the Spring Boot Maven plugin. Add these dependencies: org.springframework.boot spring-boot-starter-webflux org.springframework spring-jcl org.pac4j spring-webflux-pac4j 3.0.2 org.pac4j pac4j-oidc 6.5.9 Why declare spring-jcl explicitly? pac4j 6.5.9 excludes it from its transitive spring-core dependency, but Spring 6 still needs it at runtime. The spring-webflux-pac4j-boot-demo contains a broader application. To adapt it, replace its security configuration with the one below. Place the following classes under the package scanned by your @SpringBootApplication. First, let's create the OIDC client and protect the routes under /protected/: package org.example; import org.pac4j.core.config.Config; import org.pac4j.core.matching.matcher.PathMatcher; import org.pac4j.oidc.client.OidcClient; import org.pac4j.oidc.config.OidcConfiguration; import org.pac4j.springframework.web.SecurityFilter; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; @Configuration @ComponentScan(ba
Claude Opus 5 costs $5 per million input tokens whether a prompt arrives in English or in Russian. What changes between the two languages is how many tokens the same paragraph becomes, and the bill is that count multiplied by the price. A recent test on Habr measured the gap across 11 tokenizers. Its numbers line up with research going back to 2023: on most popular models, a language other than English costs more to send, fills the context window sooner and reaches rate limits with less text. A token is the chunk of text a model reads and bills by, usually a piece of a word. The tokenizer is the component that cuts text into tokens with a vocabulary fixed before the model is trained. The author, Habr user donseo, wrote 4 parallel text pairs in Russian and English: a technical article, a support chat, a business notice and Python code with comments. The Russian side holds about 2,500 characters. Open tokenizers ran locally through tiktoken and Hugging Face. For closed models, the script sent each text with a short fixed prompt and the prompt alone, then subtracted the two token counts the API reported. The code and the corpus are public on GitHub under MIT. Model RU/EN tokens Russian vs English YandexGPT 5 Lite 0.91x -9% GigaChat 3 0.96x -4% Grok 4.7 1.18x +18% GPT-5.x / GPT-6 (o200k) 1.19x +19% Gemini 3.7 Flash 1.20x +20% GLM-5.3 1.23x +23% DeepSeek V3/V4 1.38x +38% Qwen 3 1.52x +52% Kimi K3 1.86x +86% GPT-4 (cl100k) 2.09x +109% Claude Opus 5 2.96x +196% Claude Opus 5 sits far from the rest at 2.96x. Its technical article took 327 tokens in English and 872 in Russian. Even its English is expensive: 3.25 characters per token, against 5.07 for the OpenAI o200k tokenizer behind GPT-5.x. In Russian it falls to 1.03 characters per token, close to one token per letter. The Python sample showed the smallest gap on Claude Opus 5, 424 tokens in Russian against 231 in English. Prose is where the premium bites hardest. At the same per-token price, Russian text on Claude Opus 5
Most explanations of AI agents stop at “a model with tools”. That is true, but it doesn't help when your agent forgets a preference, calls the wrong function or loops forever. To debug any of those, you need to know which part is misbehaving. This post continues my series on building agents. The previous one covered LLMs versus agents. An AI agent has four components: a brain (the language model that decides what to do next), memory (the conversation history and stored facts the model can read), tools (functions that let it act outside the model) and an action loop (the code that calls the model, runs the tools it asks for and feeds the results back). The brain is the only part that is a model. The other three are code and data that you write and control. Part What it does Without it Brain Reads everything and decides the next step Nothing decides, so you have a fixed script Memory Holds the conversation and stored facts The agent forgets between steps or sessions Tools Let it read or change things outside the model It can only talk Action loop Runs the model, executes tools, returns results One answer, then it stops Brain. The language model. Each turn it gets the system prompt, the conversation, the tool list and any tool results, and it returns either text or a request to call a tool. It never runs anything itself. Memory. Two layers. Short-term memory is the message history you send with every call. Long-term memory is anything written to storage and read back in a later run: a notes file, a database row, a vector store. The model remembers nothing between calls, so both layers are your code's job. Tools. An ordinary function plus a description: a name, when to use it, and a JSON Schema for the inputs. The model never sees your code, only the description, so write it like API docs for a reader who can't ask questions. Action loop. Send memory to the brain. Plain text means done. A tool request means run the tool, append the result to memory and go around again.
What I Benchmarked I've been fine-tuning Whisper on Nigerian speech for a while, and I built this benchmark to measure my model against the standard ones. The question behind it: when a speech model hears Nigerian English or Pidgin, does it write what was said, or does it rewrite it as standard English? It evaluates speech recognition rather than text LLMs: two off-the-shelf Whisper models (large-v3 and small) and a version of large-v3 that I fine-tuned myself on Nigerian speech. I use 'dialect' for any Nigerian English variety or Pidgin form, even though Pidgin is technically its own language. Standard automatic speech recognition (ASR) accuracy tests mark a model wrong when it correctly transcribes dialect words, slang, or Pidgin. Most evaluation relies on word error rate (WER) computed against references written in standard English spelling. If a model transcribes "pipo" (what the speaker said) but the reference says "people", standard WER counts a substitution error. That penalizes a spelling difference, not a listening mistake. The benchmark separates real recognition errors from dialect-spelling mismatches and reports 5 metrics: Raw WER: standard WER. Faithful WER: WER after discounting faithful dialect variants (spellings like "pipo" that match what was spoken). Dialect penalty: Raw WER minus Faithful WER, in percentage points. Hallucination rate: the share of word errors that aren't faithful dialect variants. In this benchmark's code, "hallucination" means any such error, not only invented words. Normalization overcorrection: the share of hallucinations where the reference contains a dialect word and the model "corrects" it to standard English. For example, if a model makes 100 hallucinations (errors that aren't faithful dialect variants), a 10.6% overcorrection rate means about 11 of them are dialect words the model replaced with standard English, like "dey" → "they". The rest are other errors. I selected 500 samples across 5 speaker backgrounds (Igbo, Yoru
This is a submission for the Hacktoberfest Weekend Challenge: Build for a Friend My Nana (my mother's father) gets a steady stream of paper he can't fully read: bank notices, hospital reports, pension circulars, government letters. They're dense, formal, often in English, and the one thing that matters (do I need to do something, and by when?) is usually buried in paragraph three. Recently it was a notice about SIR, the Election Commission's Special Intensive Revision of the voter rolls: the kind of notice where missing a step can keep your name off the voter list. He couldn't read it. So he asked the way he always does: "padh ke batao", read it and tell me. That's the name of what I built. Padh Ke Batao (पढ़ के बताओ) does exactly what he asks. He chooses a photo of the document and, about a minute later, gets: What it is and who sent it What it says, including what happens if he ignores it What to do, step by step, with every document he needs to bring written out The last date, with a countdown ("15-10-2026 · 10 दिन बाकी", 10 days left) How urgent it is: जल्दी करें (act soon), ध्यान दें (needs attention) or सिर्फ जानकारी (information only) A big 🔊 सुनें (Listen) button that reads it all out in a natural Hindi voice Everything that reads the document runs on an ordinary laptop: an open-weight vision model in Ollama, no GPU, no cloud AI. The photo of his bank letter never leaves the machine. Nana is far from the only one. In millions of Indian homes, an official letter arrives and sits on a shelf until someone has time to read it to the person it was sent to. I built this for him, but it works for anyone in that spot. The letter in these screenshots is made up, so no real account appears anywhere. The explanation is the model's real output. Start Reading Result (English, dark mode) / padh-ke-batao पढ़ के बताओ · Padh Ke Batao Padh ke batao (पढ़ के बताओ) is Hindi for "read it and tell me". It's what my Nana says whenever he hands someone a letter he can't read. Take
I got tired of SSH sprawl. PuTTY/Moba sessions in one place. Keys in another. Notes in a random markdown So I built iLead — a native desktop SSH manager with an encrypted vault that your machine. Local vault for hosts, keys, notes (Argon2id + AES-GCM style sealing) Import from PuTTY, MobaXterm, WinSCP, ~/.ssh/config Multi-tab SSH, SFTP, tunnels, fleet commands Small Database Studio (Postgres/MySQL/Mongo/Redis/etc.) when you need it Local MCP bridge for Cursor/Claude: list allowed hosts + run commands only after a native approval dialog — secrets are not tool inputs Platforms: macOS (Apple silicon + Intel), Windows, Linux. No cloud inventory. No telemetry. I don’t hate SaaS. I hate uploading a map of production bastions to a third party Site: ileadapp.org Downloads: ileadapp.org/downloads vs PuTTY / Moba / Termius: ileadapp.org/alternatives MCP notes: ileadapp.org/mcp I’m the maker. Roast the UX, ask about the vault, tell me what import you still need.
Short answer: named transformations are versioned image-processing definitions that give every screen the same output contract; for property listing photos, keep a small registry in code, include its version in the cache key, and send only the moderated derivative live. Choice Consistency Review cost Storage and cache effect Best fit Width and quality in each view Low High; rules are scattered Duplicate variants are easy to create A prototype with one image surface Named definitions in one registry High Low; one diff shows the policy A bounded, predictable variant set A small app that ships weekly Dynamic transformation service Depends on its policy layer Medium Flexible, but arbitrary URLs can multiply cache objects Many legitimate sizes or external clients Use the registry for a property management app with a known set of surfaces. It is the least complex option that makes moderation, display, and cache behavior inspectable in one pull request. The important boundary is equally clear: the browser never invents dimensions, and an uploaded original never becomes public merely because processing finished. A named transformation gives an image outcome a stable business name such as moderationPreview or listingCard. The name points to a complete definition: dimensions, fit behavior, output format, quality, and a revision. Callers ask for the outcome, not for a loose bag of image parameters. That distinction matters. width=640 describes one operation. listingCard@3 describes an app contract that a reviewer can compare with the previous contract. A design change becomes one registry diff instead of a hunt through a listing grid, owner dashboard, moderation queue, email renderer, and mobile client. Keep the vocabulary tied to jobs. Names such as small, new, or optimized age badly because they don't say where the result belongs. moderationPreview tells an operator why the asset exists. listingCard tells a developer which UI owns it. Tiny registry. Big leverage. There is st
Most JNI crashes don't come from complicated logic. They come from a small set of mistakes around object references: holding on to a reference after it has become invalid, creating references faster t
What’s a Voice AI Pipeline? When developers talk about “voice AI” they usually mean three core pieces: Speech‑to‑Text (STT) – turning audio into text Natural‑Language Understanding (NLU) – interpreting that text Text‑to‑Speech (TTS) – producing a natural‑sounding voice If you’re building a chatbot, a virtual assistant, or an audiobook generator, you’ll need all three. In this post we’ll focus on the last leg: building a TTS pipeline from scratch. We’ll walk through the data, the model, and the deployment steps, and we’ll use ElevenLabs as the go‑to TTS engine because it gives you a powerful, ready‑to‑use voice model that’s as close to a production‑grade service as you’ll get without a huge research budget. The quality of your voice AI depends on the data you feed into it. For TTS you need pairs of audio files and the exact transcript that produced them. Source Pros Cons Open‑source corpora (LJSpeech, VCTK) Free, large Limited speaker diversity Proprietary recordings High control Expensive to record Crowdsourced datasets (e.g., Mozilla Common Voice) Diverse Requires cleanup For a hobby project, start with LJSpeech (≈24 h of a single female speaker). If you want voice cloning, collect a few minutes of the target voice—usually 5–10 minutes is enough for ElevenLabs to create a convincing clone. Tip: Clean the audio (16 kHz, mono, 16‑bit PCM). Remove background noise and normalise volume. You have two options: Train a model from scratch (e.g., FastSpeech 2 + HiFi‑GAN). Use a pre‑trained, fine‑tuned model (like ElevenLabs’ proprietary voice models). Training a model is a deep‑learning rabbit hole. It requires GPUs, a lot of compute time, and a solid understanding of sequence‑to‑sequence training. If you’re new to the space, I recommend starting with ElevenLabs. Their API gives you a state‑of‑the‑art voice with minimal fuss. Below is a minimal, end‑to‑end pipeline in Python that takes raw text, sends it to ElevenLabs, and plays the resulting audio. import requests import t
A trading bot does not become safer because it is automated. In fact, automation can make a bad strategy much more dangerous because software can execute the same mistake hundreds of times without hesitation. For a Polymarket trading bot, the most important question is therefore not only: When should the bot trade? It is also: When should the bot refuse to trade? A useful risk layer can control position size, market exposure, price movement, liquidity, duplicate signals, and the number of positions open at the same time. This article shows how to build those controls in Python. Why a trading bot needs a risk layer Imagine a strategy produces this signal: signal = { Without a risk layer, the execution system might immediately submit it. That creates a problem. The strategy may not know that: The portfolio already has significant exposure. The market moved from $0.42 to $0.48. Available liquidity is too low. The bot already processed the same signal. The market is no longer active. The proposed position is too large. The account has reached its daily loss limit. The risk engine exists between the strategy and execution. It acts as a gatekeeper. Start with a maximum position size The simplest control is a maximum amount that the bot can allocate to one trade. MAX_TRADE_SIZE = 50 Then: def check_trade_size(size): If the strategy requests: size = 35 the trade passes. If it requests: size = 100 the risk layer rejects it. This sounds basic, but hard limits are valuable because they protect against unexpected strategy behavior. Position sizing should be separate from risk limits Your strategy might calculate a position size based on a target wallet, signal strength, or portfolio allocation. That does not mean the strategy should have final authority over how much money can be traded. For example: def calculate_size(target_trade): Then the risk layer applies its own limit: def apply_max_size(size): This gives you two separate concepts. Sizing logic decides what the strategy
An SSH client keeps every live session in a shared map behind a lock. Holding it through a slow handshake froze every other session — here's the Rust fix. Here's a shape you'll recognise if you've ever put "a bunch of live things" behind one lock. An SSH client keeps its open sessions in a single map: struct SessionManager { sessions: HashMap , // ... } static SESSION_MANAGER: OnceLock >> = OnceLock::new(); One Arc >>, shared by every tab. Reads are cheap — grab the lock, find the session, write some bytes, drop the lock. It worked fine until someone opened a tenth tab and connected to a new host, and every other tab froze for three seconds. Through a jump host, longer. .await too many The connect path looked like the obvious thing: async fn connect_session(id: &str, creds: Creds) -> Result { let mgr = get_session_manager(); let mut mgr = mgr.lock().await; let session = mgr.sessions.get_mut(id).ok_or("not found")?; session.connect(creds).await // Result { let mut mgr = get_session_manager().lock().await; if mgr.in_flight.contains_key(id) { return Err("an operation is already in progress for this session".into()); } match mgr.sessions.remove(id) { Some(session) => { mgr.in_flight.insert(id.to_string(), false); // false = not cancelled Ok(session) } None => Err("session not found".into()), } } Now the lock is held only long enough to remove the entry and record that an operation is running. The connect becomes: async fn connect_session(id: String, creds: Creds) -> Result { let mut session = take_session_for_op(&id).await?; // brief lock let result = session.connect(creds).await; // NO lock held finish_session_op(&id, session).await; // brief lock result.map_err(|e| e.to_string()) } Between the first and third line the manager lock is free. The ten other tabs keep echoing keystrokes and drawing output while the new connection does its handshake in the background, holding nothing but its own owned SshSession. The slow work is exactly as slow as before — it just stops be
My coding agent can write a feature, add tests, and hand me a green build. It can also put the right behavior in the wrong place. The application works. The imports look reasonable. But an application service has quietly learned how the database stores and replaces rows. That is the kind of review comment I want to turn into useful automated feedback. I built Jev CI to explore this. It compares Git branches, evaluates changes against policies written in YAML, and lets Jev request more evidence when the diff does not answer the review question. Here is the example from my short video, followed by the mechanism and commands to run it yourself. Two implementations of the same feature The feature is small: replace an item's ordered list of labels. I built a demo repository with my coding agent and opened two pull requests against main. Both branches pass the demo's six checks: five behavior tests and one import check. That import check inspects the Python AST and verifies that the service imports only LabelStore from src.ports. No direct database import slips into the service. In PR 1, the application service coordinates the replacement: def set_labels(self, item_id: str, labels: list[str]) -> None: self.store.delete_labels(item_id) for position, label in enumerate(labels): self.store.insert_label(item_id, position, label) self.store.flush() The feature works. But the service now knows that replacement means deleting rows, assigning positions, inserting the new values, and flushing the changes. If storage needs a different replacement procedure later, that knowledge is sitting in the caller. In PR 2, the service uses a single operation: def set_labels(self, item_id: str, labels: list[str]) -> None: self.store.replace_labels(item_id, labels) The storage adapter owns the sequence: def replace_labels(self, item_id, labels): self.delete_labels(item_id) for position, label in enumerate(labels): self.insert_label(item_id, position, label) self.flush() The interface already de
For a long time the firewall in front of one of our applications was CSF, running on the EC2 instance itself. It worked. Changing a rule meant connecting to the box and running a command, and that sentence is the entire reason we moved away from it. The replacement is AWS Network Firewall, sitting outside the application server, with the instances moved into a restricted subnet behind it and a new network load balancer in front. The security argument for that is easy. The part worth writing about is what it changes for the people who used to be able to fix things themselves. CSF's problem was not its rules. It was where it lived. A host firewall is configured by someone with a shell on the host. That means the set of people who can change the firewall is the set of people who can log in, and those two sets should not be the same. It also means the configuration lives in a place nothing else reads: not in a repository, not in a template, not in anything you can diff. The current state of the rules is whatever the last person to run a command left behind. Firewall on the instance Firewall outside it Who can change a rule Anyone with shell access Anyone who can change the firewall resource Where the rules live On the box In infrastructure configuration How you audit them Log in and look Read the resource If the host is compromised The attacker can edit the firewall The firewall is unaffected The last row is the one that ends the argument. A control that an attacker on the host can turn off is not protecting you from an attacker on the host. The question I could not answer well What finally moved this was being asked to produce the current rule set for review. The honest answer was that I could tell them what the rules were right now, by going and looking, but not who had last changed them or why. There was no history. CSF's configuration was state on an instance, and instances get replaced. Every rebuild carried the rules forward through whatever mechanism had put them
Why traditional loading patterns like spinners fail in agentic AI experiences, and how interface patterns that reveal the system’s process, status, and decision-making can improve transparency and build user trust.
Another comparison between Angular 22.2 and React/Next.js. The previous one covered @boundary, the new block for template errors: Template errors: React and Next.js vs Angular 22.2's @boundary. Browsers now support nested CSS without a preprocessor: .card { padding: 1rem; .title { font-weight: 600; } &:hover { outline: 1px solid; } } Cross-browser support for the relaxed nesting syntax arrived in Firefox 117, Chrome 120 and Safari 17.2, according to MDN's compatibility data. Chrome 112 and Safari 16.5 already handled nested class selectors like .title; the later versions added nested rules that start with a tag, like h2 {}. Since June 2026, nesting is Baseline widely available. (Baseline "newly available" means it works in the latest Chrome, Edge, Firefox and Safari; "widely available" comes 30 months later.) Nesting was probably one of the most common reasons to use Sass (the language behind your .scss files). Now it's native. The question is what happens when you combine it with each framework's style isolation. TL;DR Next.js: CSS Modules rename every local class, nested ones included, so nesting just works; the build also flattens it. Angular: the CLI flattens nesting before encapsulating, so it works in component styles. Avoid nesting under ::ng-deep, and know the 22.2 :host trap if raw nesting reaches the compiler. Sass: still worth it for mixins, loops, BEM names with &__, breakpoint variables and custom Angular Material themes. For the rest, native CSS is enough. React doesn't scope styles. className works like the HTML class attribute (react.dev), so a CSS class applies to the whole page. The Next.js styling docs list several options: Tailwind CSS: recommended "for most styling needs". CSS Modules: a .module.css file generates unique class names, so you can use .card in different files without collisions. Global CSS: for what is truly global. External stylesheets, Sass and CSS-in-JS: the other options. import styles from './card.module.css'; … Isolation come
A rendering job came through my diagram API last month: a flowchart for a deployment runbook, one node labeled build (x86). Unquoted parentheses inside square brackets are a classic Mermaid parse trap, and this diagram tripped it. What surprised me wasn't the failure — it was that my API answered 200 OK with 40 KB of PNG and the job marked done. I opened the image. It was a tidy little box that said "Syntax error in text". Mermaid doesn't throw on bad syntax during render; it draws the parser's complaint as if it were a diagram. Same theme, same fonts, same background. At thumbnail size in a report it looked like any other node. Downstream, nobody questioned it — the runbook briefly documented a build step for a box reading "Syntax error in text". The fix was to stop trusting render() as validation. Mermaid's parse() call (async since v10) throws a ParseError before any pixels exist. The endpoint now parses first, catches, and returns a 422 with the parser's message and the offending line where I can isolate it. Render only runs after parse agrees the diagram is real. I also kept a belt-and-suspenders sniff on the rendered SVG text for Mermaid's known error strings, because the library has more than one flavor of built-in error art — there's a distinct one for unknown diagram types. The broader lesson: libraries that produce visual output fail visually, and the library's success is not your API's success. Any wrapper around a drawing library needs its own validation layer, because the library will happily serialize its own error message into whatever format you asked for. A 200 with a plausible-looking payload is the hardest failure mode to debug — nothing crashes, the logs are clean, and the damage only shows up when a human actually reads the output. I packaged the fixed flow as the renderer at https://x402.freeq.one/tools/mermaid.html — parse-gated, PNG or SVG out, base64-encoded. An agent can POST a flowchart and get an image back without standing up a headless
Small feature, outsized leverage: Dapr Agents lets you register hooks around the agent loop where the before_llm_call being the one I use the most. from dapr_agents import DurableAgent def add_live_context(ctx): ctx.messages.append(web_search(ctx.task)) # fresh context, every call agent = DurableAgent( name="researcher", hooks={"before_llm_call": add_live_context}, ) Everything the hook does, lives inside the durable workflow, so a crash after the hook but before the call replays cleanly with no lost context. That's the difference between bolting logic onto the loop and having the runtime own it. It's important to note here that the hook itself has to be replay safe. Furthermore, the hook author needs to define whether this hook is deterministic or not. This has impact on replaying. A web search, as the above example is, will not be deterministic and thus will rerun. For live context, this is great and probably what we want. For validating user tokens, this is equally great - otherwise we'd just roll an approval on a potentially expired token! Uses we've seen in the wild: injecting fresh web context (my webinar demo), token-budget enforcement before the spend happens, redacting PII on the way in - and on the way out too. The latter is powerful to use if your agent handles sensitive data you'd want to mask before sending to an LLM provider. The webinar takes you through a full example with Tavily and Chainlit to enrich a models answer with fresh web results: https://www.diagrid.io/webinars/make-your-llm-agent-production-smart Give it a spin and lmk what you think!
Une facture AWS peut monter pour une excellente raison. On active des journaux d’audit. On améliore la détection des menaces. On renforce les sauvegardes. Et, le mois suivant, la courbe des dépenses grimpe. Le graphique dit : « ça coûte plus cher ». Il ne dit pas : « nous avons acheté de la visibilité et réduit un risque ». À l’inverse, une facture stable peut masquer un disque qui se remplit, une réservation qui arrive à échéance ou une alarme tellement bruyante que plus personne ne la regarde. C’est le problème auquel j’ai voulu répondre en construisant une chaîne de reporting mensuel AWS. Pas un dashboard supplémentaire. Un document qui rapproche ce que l’infrastructure coûte, ce qu’elle fait et les décisions qu’elle appelle. La stack est volontairement simple : Bash, AWS CLI, Python, JSON, HTML et PDF. L’IA intervient pour aider à rédiger les commentaires, pas pour produire les chiffres. Le principe : automatiser les faits, assister l’analyse, garder la responsabilité des conclusions. Pour ce suivi, j’avais besoin de répondre à trois questions : Qu’est-ce qui a changé depuis le précédent bilan ? Qu’est-ce qui mérite une intervention ? Quelle décision faut-il prendre maintenant ? Ces questions traversent plusieurs consoles AWS. Cost Explorer connaît les dépenses. CloudWatch connaît les métriques. Les APIs d’inventaire connaissent les ressources. Et les raisons métier d’un changement se trouvent souvent ailleurs : dans un incident, une action planifiée ou une discussion. Le rapport devait réunir ces morceaux sans transformer une hypothèse en certitude. J’ai donc séparé le système en trois couches : collecter, interpréter, présenter. Le chemin des chiffres et celui des commentaires se rejoignent au rendu, pas dans la collecte. Les encadrés de code ci-dessous sont des extraits simplifiés et anonymisés, pas un outil complet à installer. La première sortie de la chaîne n’est pas un document. C’est un instantané JSON. Le collecteur interroge notamment : Source Ce que j
Debugging ZORGAX: How We Traced an AI Agent Tool-Calling Loop from Open WebUI to Ollama An evidence-first debugging story, with a reproducible test and an open invitation to contributors. Building an AI agent is not just about making a language model call tools. It is also about ensuring the model knows when to stop. While developing ZORGAX, a local DevOps AI agent within the MyZubster ecosystem, I encountered a tool-calling problem: when asked which automations were active, ZORGAX repeatedly invoked list_automations even after the tool returned a successful empty result. The expected behavior was simple: Call list_automations. Receive {"automations":[],"total":0}. Tell the user that no automations are active. Stop. Instead, the Open WebUI integration sometimes repeated the tool call until interrupted. We investigated the problem using a custom ZORGAX model derived from Qwen2.5 3B, Ollama, Open WebUI, Docker, and a temporary HTTP diagnostic proxy. Here is what we discovered. Our first experiment bypassed Open WebUI. We sent a synthetic conversation to Ollama's /api/chat endpoint, including an assistant tool call and a matching tool result. The result was exactly what we wanted: Content: Non ci sono automazioni attive al momento. Tool calls: [] Done: True ZORGAX understood the empty result and produced a final answer without calling the tool again. This was useful, but it did not prove Open WebUI was at fault. The direct test used a simplified system prompt and tool schema. We needed to compare the actual integration path. A commenter on our earlier Coder Legion article suggested a more precise investigation: capture the request immediately after the first list_automations result and compare it with a working Ollama control. That changed the direction of our debugging. We inspected the installed Open WebUI source and identified its tool-call continuation flow. The middleware transforms tool execution output back into conversation messages, including the assistant's t
If you maintain an open-source project, you already have enough things to worry about. Issues. PRs. Releases. Documentation. Contributors. Servers. The last thing you probably want is to spend your time maintaining email infrastructure. But sooner or later, your project needs email. Welcome emails. Password resets. Notifications. GitHub alerts. Product updates. Maybe even emails from an AI agent. And suddenly, you're choosing between paying another SaaS vendor or building an SMTP stack yourself. There should be a better option. Reloop is an open-source email infrastructure platform built for developers. You get the things you'd normally piece together across multiple services: Transactional email through REST API or SMTP Marketing campaigns and audience management Real-time delivery logs and analytics SPF, DKIM & DMARC configuration Bounce, complaint and suppression handling IP reputation and warmup tooling Inbound email and webhooks AI Agent Inboxes for applications that need to receive and respond to email Templates with React Email MCP support for AI-powered development workflows SDKs and APIs for modern stacks The goal isn't to give you another dashboard to babysit. It's to give your project an email layer that simply works. The important part isn't just the feature list. You own the infrastructure. Reloop is open source under Apache 2.0 and can be deployed on your own servers, VPS, Docker, Kubernetes, or cloud infrastructure. Your email data, templates and logs can stay within infrastructure you control. Same product. Same developer experience. Cloud when you want convenience. Self-host when you want control. You shouldn't need a six-month infrastructure project just to send a password reset. With Reloop, you can send through an API, use standard SMTP, or connect it directly to your development workflow. And if your project is increasingly AI-powered, Reloop can go beyond sending. Give your agents an inbox. They can receive inbound email, process it, classify i
TokenRouter Hits the Fast Lane: Why Token‑Level LLM Routing Reduces Latency and Cuts Costs The Lead “We saved 18 % on every API call without touching the model’s weights,” announced a senior engineer at a major cloud AI provider on October 2, 2026. The claim stems from a fresh deployment of TokenRouter, the first publicly available system that decides, per token, which language model should generate the next piece of text. Two weeks later, the same engineer added, “Our users noticed the difference the moment the response hit the screen.” The observation mirrors a wave of early‑adopter reports: token‑level routing trims per‑token latency by up to a third and slashes inference spend by nearly one‑fifth. The buzz around TokenRouter feels louder than the usual hype around “new routing primitives.” That noise matters because the technique changes a fundamental assumption in LLM serving: routing decisions belong at the query level. TokenRouter flips the script, moving the decision point inside the generation loop. The result? Faster, cheaper, and—surprisingly—more consistent outputs. Below, I unpack the technical underpinnings, walk through a real‑world deployment, crunch the numbers, flag the hidden risks, and sketch where the industry heads next. Imagine a Korean voice‑assistant product that must answer user queries within 150 ms while staying under a tight GPU budget. The engineering team originally paired a single 70‑B LLaMA‑2 model with a traditional session‑level router that switched to a 7‑B fallback only when the user explicitly invoked a “light‑mode.” The approach worked, but two problems persisted: Punctuation and filler tokens consumed the same compute as content‑heavy tokens. The router’s coarse granularity forced the system to keep the heavyweight model’s KV cache warm, even for short utterances. The team swapped in TokenRouter on October 5, 2026. They configured a pool of three models: Model Size Specialty ko‑llama‑2‑70b 70 B General Korean understanding ko‑
The agent news this week sounds like a safety review with a side of performance: a reconstruction details how 700 OpenAI agents escaped constrained evals and attacked Hugging Face, while Codex auto-review has a second model inspect risky tool calls before they run. Another 325,000-trial study found 13 models steering personas they thought were wealthy toward pricier picks; hard price caps were the fix. For teams tuning agents, Anthropic's eval-design workflow uses reviewed test sets and held-out checks to guard against overfitting, OpenAPPA checks data flow before each tool call, and BM25 reminds us lexical search can still beat embeddings. Elsewhere, V8 object prototypes prove that tiny internals can have big consequences: changing object shapes doubled WebStreams pipe throughput in Node core. GitHub's CSS-in-JS migration likewise found that shipping more CSS can be cheaper than runtime styling. For tooling, Vite+ puts most JavaScript dev chores behind one CLI, Safe Not Safe gives Postgres migrations a private browser-side preflight, and Kafgres runs a Kafka-compatible broker inside Postgres at a very non-toy 700 MB/s. Your database may now be the message broker—sure, why not. Enjoy! Signup here for the newsletter to get the weekly digest right into your inbox. Find the 11 highlighted links of weeklyfoo #157: Optimizing objects with null prototypes by Matteo Collina Why proto null literals get stuck in V8 dictionary mode, and how switching to classes or Object.setPrototypeOf doubled WebStreams pipe throughput in Node core 📰 Good to know, nodejs, v8, performance Improving site performance by shipping more CSS by GitHub How github.com migrated from CSS-in-JS to CSS Modules to drop client and server runtime styling costs while keeping component encapsulation 📰 Good to know, css, performance, frontend Revealing the details of how OpenAI agents hacked Hugging Face by SwarmTraces Reconstruction of how a swarm of 700 agents escaped constrained eval environments, chainin
Short answer: capture React render failures with an error boundary, capture uncaught runtime failures with error and unhandledrejection listeners, and send one small, versioned event to your own backend. For a property-management checkout, treat reporting as best-effort telemetry: it must never block payment, lease signing, or the rollback path. This no-SDK design is a good fit when basic JavaScript error tracking and vendor independence matter more than polished crash analysis. Keep a release identifier, page URL, an appropriate user identifier, and a client-generated fingerprint. If readable minified stacks, source-map deobfuscation, session replay, or automatic symbolication are requirements, choose a dedicated error product instead. There are three useful failure surfaces. A React error boundary catches errors thrown while rendering its descendants. The global error listener catches uncaught JavaScript errors outside that boundary, and unhandledrejection catches rejected promises that nobody handled. Those mechanisms do not prove that a checkout succeeded or failed. A declined payment, validation response, or rejected lease is an expected business result and should be represented in the workflow's normal state model. The error channel is for unexpected execution failures. Send all three sources through one collector, but keep the source in kind; otherwise a rejected promise and a render crash with the same message become deceptively similar during triage. The rollback rule is strict: reporting cannot own checkout state. Use a short request timeout, swallow telemetry transport failures after local diagnostics, and never retry a mutating checkout action merely because error reporting failed. The transaction remains authoritative; the error event is evidence. For privacy, send less. A stable internal user ID may help investigation, but names, email addresses, card data, lease text, and form contents do not belong in an exception payload. This matters especially if
Verdict: Wails is the right pick when your backend is Go and installer size and RAM matter: the independent web-to-desktop benchmark measures its empty app at roughly 11 MB on Windows against roughly 384 MB for Electron, and 53 MB against 77 MB of RAM on Linux in release builds. Electron is the right pick when your team is 100% JavaScript, you need pixel-identical rendering on every OS, or you depend on the vast npm ecosystem — it bundles its own Chromium 152 (Electron 44.6.0, released 2026-10-06), so rendering never varies with the host webview. Wails is also the younger bet: its v3 is still in beta (v3.0.0-beta.28, published 2026-10-05), while Electron has shipped stable majors on a fixed 8-week cadence for years. Last verified: 2026-10-07 · Best for Go teams / small apps: Wails v2.13 (v3 beta for multi-window) · Best for JS-only teams / maximum ecosystem: Electron 44.6 · Pricing: both MIT-licensed, free, no paid tiers · Sizes and RAM figures change per release — last checked October 2026. The Issue: two MIT-licensed ways to ship a web UI as a desktop app — one reuses the OS webview (Wails), one ships a full Chromium inside the installer (Electron). The Insight: the size gap is not cosmetic: ~11 MB vs ~384 MB on the same empty-app benchmark is a 35x difference that compounds across every install. The Solution: pick by your binding constraint. Go backend or size-critical distribution: Wails. JS-only team, npm dependency, or cross-OS pixel parity: Electron. Row Wails Electron Backend language Go 1.25+ Node.js (bundled) Rendering engine OS webview (WebView2 / WKWebView / WebKitGTK) Bundled Chromium 152 Empty-app installer, Windows x64 ≈11 MB ≈384 MB RAM, empty app (Linux x64, release) ≈53 MB ≈77 MB Cold start, empty app (Linux x64, release) ≈264 ms ≈208 ms GitHub stars 36,472 123,410 Stable version today v2.13 (v3 in beta) 44.6.0, 2026-10-06 Mobile targets Experimental iOS/Android in v3 beta none Multi-window First-class in v3 First-class since 1.0 License MIT MIT So
TL;DR: Choose a hosted searchable log store with a small, vendor-neutral Node.js contract when manual review is acceptable. For a media SaaS, the deciding constraint is rollback safety: API requests, background publication workers, and scheduled jobs must leave enough shared evidence to explain which release changed an asset and whether the rollback completed. Keep heartbeat monitoring separate, and require a documented European data location before sending production records. The useful target is not "collect everything." It is a compact incident record that survives a provider change. That keeps observability work subordinate to shipping weekly, where it belongs for a one-person SaaS. A failed media release crosses several processes. The API accepts an edit, Postgres records a revision, a worker publishes renditions, and a cron job may expire or refresh them. Searching four process outputs independently makes the timeline hard to trust. Start with the question an incident review must answer: which release acted on which asset, under which trace, and what was the outcome? A useful event therefore carries occurred_at, service, event, release_id, asset_id, trace_id, and outcome. Store identifiers, not article bodies, access tokens, or customer email addresses. This matters because the logging option described below has no per-user deletion API, bulk export, or subscription interface. Its retention and cold-storage settings also have no configuration entry point. That makes data minimization a design requirement, especially when European residency and erasure obligations apply. One rule earns its keep: deploy the schema before the vendor adapter. A stable event contract means the logging backend can move without rewriting the API, worker, and cron call sites. A trace ID joins records only when every component propagates it. It does not prove that a scheduled task ran, and a list of matching lines is not a distributed trace or span tree. The hosted option in this compa