Lei Xia

Sr. Software Engineer | Solution Architect

Writing code, Enjoying life, Building future

RSS · Sponsor

avatar

Harness Engineering: The Core Engineering Discipline of the AI Agent Era

March 27, 2026 · 2253 words · 11 min

2025 was the year AI agents exploded. 2026’s defining theme is the Agent Harness — the runtime control framework that wraps around agents. OpenAI and Anthropic have both published dedicated articles on harness engineering, and systematic academic papers have emerged. This post breaks down this emerging discipline from an engineering perspective: what it is, why it matters, and how to do it.

Fixing OpenCode Prompt Cache Misses When Using GPT via Third-Party Proxy

March 26, 2026 · 539 words · 3 min

While using OpenCode with GPT 5.3 Codex for daily development, I noticed abnormally high token consumption — around 69K input tokens per request with virtually zero cache hits. The same model and proxy worked fine with Codex CLI, where caching functioned as expected. This post documents the full debugging and resolution process.

From Monolith to Microservices: The Redistribution of Complexity

March 12, 2026 · 1830 words · 9 min

Microservices are often introduced with a deceptively simple narrative: monoliths become too complex, microservices make systems easier to manage, therefore system evolution naturally moves from monolith to microservices. The problem with this narrative is not that it is entirely wrong. The problem is that it hides the more important truth: microservices usually do not remove complexity. They redistribute it.

In a monolith, complexity is concentrated inside the codebase. It shows up as coupling between modules, risky deployments, a rigid technology stack, and increasing coordination costs inside one delivery unit. Microservices attempt to break that delivery unit apart so teams can evolve parts of the system independently. But once the split happens, complexity does not disappear. It moves from in-process calls, local transactions, and shared code into service boundaries, network uncertainty, data consistency, runtime governance, and organizational coordination.

Learn Terraform and AWS at Zero Cost with LocalStack: A Complete Practical Guide

November 5, 2025 · 1739 words · 9 min

When learning AWS and Terraform, the biggest pain points are often the high costs of cloud services and the financial risks of misconfigurations. This guide will show you how to use LocalStack to simulate AWS services locally, enabling you to learn and experiment with Terraform Infrastructure as Code (IaC) at zero cost and zero risk.

In this tutorial, we’ll build a complete AWS network architecture including VPC, public/private subnets, Internet Gateway, security groups, and EC2 instances. All resources run in your local LocalStack environment without incurring any AWS charges or security risks from configuration errors.

C++ Coroutines Advanced: Converting std::future to asio::awaitable

July 15, 2025 · 696 words · 4 min

In modern C++ development, coroutines have brought revolutionary changes to asynchronous programming. However, when using boost::asio or standalone asio, we often encounter scenarios where we need to convert traditional std::future<T> to asio::awaitable<T>. This article will detail an efficient, thread-safe conversion method.

Lunet: Design and Implementation of a High-Performance Coroutine Network Library

July 12, 2025 · 1511 words · 8 min

Lunet is a high-performance runtime written in C that integrates LuaJIT and libuv, focusing on coroutine-driven asynchronous programming. It simplifies the handling of asynchronous I/O and blocking tasks, enabling developers to easily write high-concurrency network applications using Lua scripts. It’s ideal for scenarios like game servers and network services.

IRSA vs. EC2 IAM:Usage Scenarios and Permission Management Practices

March 25, 2025 · 724 words · 4 min

In AWS environments, assigning permissions to workloads is critical for security and functionality. For applications running on EC2 or EKS, two common approaches are EC2 IAM Instance Roles and IRSA (IAM Roles for Service Accounts). This article explains what they are, their differences, usage scenarios with code examples, and common issues with solutions, helping the team choose the right authentication method and avoid permission confusion.

Principles Of Microservice Architecture

February 13, 2025 · 3289 words · 16 min

The microservices architecture is a method of building complex applications as a collection of small services, where each service runs in its own independent process and is typically built around specific business capabilities. These services communicate through well-defined APIs, often HTTP RESTful APIs or lightweight messaging systems. When designing a microservices architecture, it is crucial to follow a series of core principles to ensure the maintainability, scalability, and flexibility of the system.

The Evolution Of Service Architecture

February 12, 2025 · 1820 words · 9 min

In the long history of software engineering, service architecture has evolved from monolithic applications to Service-Oriented Architecture (SOA), and then to microservices architecture.

OpenTelemetry Getting Started Guide

December 2, 2024 · 636 words · 3 min

Three Pillars of Observability In modern distributed systems, observability is crucial for ensuring system health and performance.