Glean 拾遗
← All issues
#011 Latest 8/3–8/9 Published Aug 9

Agent Engineering: From Tokens to Software Factories

This week's picks trace a single arc: agent engineering is moving from demos to production-grade systems. We start with the fundamentals—tokens, context windows, and message protocols—because every agent's behavior is shaped by these constraints. We then explore the architecture fork where workflows and agents diverge, and the control decisions that follow. From there, we move into hard-won lessons from GitHub, Claude Code, and Copilot workflows, and finally to the platform layer: Cloudflare's sandboxes, tracing, and cost models. The through-line is control and observability: as AI writes more code, the critical question shifts from 'can it' to 'how do we know'—and how we keep the system accountable, efficient, and under oversight.

20 picks 5 sections ~4 hr
Section 01

Tokens, Context, and the Message Protocol: The Grammar of Agents

3 / 20
www.aihero.dev · 4 min
01

What Are Tokens? A Practical Guide to LLM Tokenization一文看懂 LLM Token:从拆分、编码到计费

A beginner-friendly explainer on LLM tokens: how tokenizers split text into tokens, map them to numbers, and decode outputs back to text. Using a tiny corpus ('the cat sat on the mat'), the author walks through vocabulary construction from characters to character groups, and cites concrete examples: vocabulary size from 1k to 200k reduces 'understanding' from 5 tokens to 2, while the made-up word 'Frabjous' burns 7 tokens for 15 characters. It also clarifies billing: input tokens include conversation history, system prompt, and tool definitions; output tokens are billed separately, so shorter generations save money. Useful for app developers who want to understand and optimize LLM token costs.

www.aihero.dev · 3 min
02

Context Windows Are Not About Size: Tokens, Limits, and Lost in the Middle别只看窗口大小:token 上限与 lost in the middle 才是关键

The context window is the combined total of input tokens (system prompt, user prompt) and output tokens (the assistant's reply). Every model has a hard-coded token limit, so long conversations eventually produce API errors—sometimes mid-generation. Models can't work around their own limits, and a larger window actually worsens the well-known "lost in the middle" effect: the beginning and end of the conversation get more attention while the middle fades, making the model less able to retrieve its own context. Even with a huge window, you'll get better results from using fewer tokens. This is a concise explainer for engineers getting started with LLMs or designing agent context.

www.aihero.dev · 3 min
03

Messages, System Prompts and Reasoning TokensLLM 消息协议入门:系统提示、推理令牌与工具调用

This article from AI Hero offers a beginner-friendly breakdown of the message protocol used when talking to LLMs: user messages, assistant messages, system prompts, reasoning tokens, file attachments, and tool calls. It argues that a system prompt placed at the start of history usually wins when it conflicts with a user instruction, though jailbreaks show the rule is not absolute. Reasoning tokens are treated as part of the assistant message rather than a separate layer, and messages can have multiple parts so files can be sent or returned. A short todo.md example illustrates how a tool call with an id is answered by a tool result carrying the same id, turning tools into a conversation between the LLM and your application. That loop is what powers apps like Claude Code and Cursor. Useful for engineers who want a clear mental model before building LLM-based products.

Section 02

The Architecture Fork: Where Workflows End and Agents Begin

4 / 20
www.aihero.dev · 3 min
04

What Is an Agent? Agents vs WorkflowsAgent 还是 Workflow:停止权在代码还是模型?

This short post clarifies Anthropic's now-canonical distinction between agents and workflows. Both orchestrate multiple LLM calls, but workflows hard-code the sequence and termination condition in developer-written code, while agents hand tools to the LLM and let it decide which to call and when to stop. The post notes that a single LLM call is neither, and argues that workflows often outperform agents on clearly specified, repetitive tasks. Includes simple diagrams contrasting the two. A useful conceptual primer for engineers new to agent architecture.

www.aihero.dev · 4 min
05

What Are Tools? A Precise Walkthrough of LLM Tool CallingLLM 工具调用底层循环:工具定义、tool call 与结果回传

This article walks through LLM tool calling using a simple write-file example. Tools are not magic: each tool is defined by a name, a description, and JSON Schema parameters, then injected into the system prompt. When the model decides to act, it returns only a tool-call message with an id and parameters; nothing actually happens until the developer intercepts that message, executes a matching function, and sends the result back under the same id. Errors are sent back too, so the LLM can adapt its next step. The post is aimed at engineers starting to build agents who want a precise mental model of the loop.

www.kimi.com · 15 min
06

Agentic AI Architectures: Patterns vs. Trade-offsAgent 架构选型指南:七种模式的取舍与判据

A practical introduction to agentic AI architecture selection, breaking down components and comparing seven patterns—single-agent, sequential/parallel, router, hierarchical, network/swarm, and generator-critic—with diagram examples and a trade-off table. The article offers two operational tests: introduce a handoff only when it changes required expertise or permissions, and use parallel branches only when they are truly independent. Production concerns include explicit stop conditions, shared-state conflict rules, and tool-failure semantics such as timeouts that must not look like empty results. Also covers common mistakes like adding multiple agents before proving one is insufficient. Suitable as a first-pass checklist for engineers designing agent workflows. The closing sections promote Kimi Agent and its Swarm feature, so the vendor bias is present but the core guide stays relatively neutral.

www.pingwest.com · 8 min
07

When Coding Is Not the Bottleneck: Three Levels of Software Autonomy当编码不再是瓶颈:软件自主开发的三级框架与责任转移

This article adapts a position paper by UC Berkeley RDI researchers, proposing a three-level framework for autonomous software development: code autonomy, pipeline autonomy, and demand autonomy, plus three orthogonal dimensions—specification granularity, temporal autonomy, and oversight mode. It contrasts a concrete win (16 parallel Claude agents building a working C compiler for under $20k) with the observation that frontier agents still degrade sharply on benchmarks that test continued evolution rather than isolated tasks. The authors argue that the immediate industry risk is skipping levels: teams claim level-1 review but merge AI code unchecked, or adopt pipeline autonomy without the needed verification and governance. As coding stops being the bottleneck, requirement specifications, agent audits, and accountability mechanisms displace raw coding skill. Useful for engineers and engineering leaders thinking about agent-driven development and governance.

Section 03

AI Coding in Production: Workflows, Skills, and Postmortems

6 / 20
github.blog · 16 min
08

The harness is all you need (mostly)GitHub Copilot 高效工作流:少装工具,多用 harness

GitHub developer advocate Burke Holland argues that with AI coding, your biggest productivity lever is mastering the harness—the shared agent interaction/execution framework behind GitHub Copilot CLI, the Copilot app, and IDEs—not chasing new models, MCPs, or clever prompts. The post walks through a repeatable 8-step workflow: start with the Copilot CLI/App and enable YOLO mode (allow-all) inside a Codespaces sandbox; prototype aggressively with one prompt that generated 20 date-picker mockups in a single HTML file or Mermaid diagrams for API options; refine requirements in /plan mode (optionally with the 'grill-me' skill); implement in Autopilot, which automatically dispatches subagents like Explore on small models and General Purpose on larger ones; then iterate via human reviews and finish with a Rubber Duck review from a different model family (e.g., GPT-5.6 Terra asks Sonnet), optionally looping with /autopilot until diminishing returns. The article also advises keeping one model and reasoning level fixed to benefit from prompt caching, running YOLO mode only in sandboxes, and never settling for 'good enough' output.

github.blog · 5 min
09

Stacked pull requests are now in public previewGitHub 堆叠 PR 公开预览:拆小改动、独立评审、一键合入

GitHub introduces stacked pull requests in public preview, letting teams break large changes into an ordered series of small, focused PRs that can be reviewed and checked independently, then merged together in one click. The feature is available via the gh-stack CLI extension (gh extension install github/gh-stack), github.com, mobile, and GitHub Copilot through the gh-stack skill. Existing branch protections and required checks still apply; merge queue support is rolling out over the coming weeks. Early adopters include Vercel, TED, and WHOOP.

www.anthropic.com · 11 min
10

Claude Code regression post-mortem: root causes and fixesClaude Code 质量风波复盘:三个独立事故、两次回退、一个缓存 bug

Anthropic published a post-mortem for recent reports that Claude Code felt less intelligent. They confirm the API was unaffected and trace the problem to three separate changes. First, the default reasoning effort in Claude Code was lowered from high to medium on March 4 to reduce latency; users pushed back and it was reverted on April 7, with Opus 4.7 now defaulting to xhigh. Second, a caching optimization using the clear_thinking_20251015 header was meant to clear stale reasoning only once after an hour of idle, but a bug made it clear reasoning on every subsequent turn, causing forgetfulness, repetition, and odd tool calls. This also produced continuous cache misses, draining usage limits faster. It was fixed on April 10. Third, a system prompt instruction limited text between tool calls to 25 words and final responses to 100 words; ablations showed a 3% drop on evals for both Opus 4.6 and 4.7, and it was reverted on April 20. Anthropic is resetting usage limits, adding per-model evals for prompt changes, improving internal dogfooding with the public build, and enhancing Code Review tooling. A useful case study in agent-product debugging and the cost of silent tradeoffs.

www.aihero.dev · 14 min
11

Skills v1.2: /wait-what, Codex metadata, and a Claude Code plugin技能包 v1.2:新增 /wait-what 纠偏指令,并兼容 Codex 元数据

v1.2 of Matt Pocock's AI coding skills ships as a Claude Code plugin and gains a documentation site at aihero.dev/skills. Each SKILL.md now has an agents/openai.yaml sidecar carrying Codex UI metadata; policy.allow_implicit_invocation: false mirrors disable-model-invocation so user-invoked skills stay out of the agent context until explicitly typed. New additions include /wait-what, a one-word corrective that re-pitches without dropping content, /wizard, which produces deterministic bash scripts for human-only steps, and /to-questionnaire, which turns an unanswerable decision into an async Markdown questionnaire. The /wayfinder router gains explicit phase boundaries, /handoff is narrowed to travel-only cases, and /compact becomes the default context action. /write-for-agents is renamed /docs-for-agents while six skills are absorbed or removed. Worth reading for engineers maintaining skills in Claude Code or Codex who care about cross-harness metadata and context engineering.

github.blog · 18 min
12

Improving token efficiency in GitHub Agentic WorkflowsGitHub 实录:给 Agentic CI 减负,用 CLI 替代 MCP 调用把 token 花销降 62%

GitHub's team instrumented its own fleet of Agentic Workflows through an API proxy, emitting a normalized token-usage.jsonl per run and building two daily agentic workflows—a usage Auditor and an Optimizer—that read those logs, flag anomalies, and file concrete optimization issues. The biggest wins came from pruning unused MCP tool registrations (each request can carry 10–15KB of schema overhead), replacing GitHub MCP calls with deterministic GitHub CLI invocations, and moving fixed data-gathering into pre-agentic setup steps. To compare across models they define Effective Tokens: ET = m×(1.0×I + 0.1×C + 4.0×O) with model multipliers. Of 12 production workflows, nine received optimizer changes; measured reductions were 62% for Auto-Triage Issues (109 runs), 43% for Security Guard, and 59% for Smoke Claude. One workflow regressed 5% due to workload shift, and one misconfigured bash allowlist caused a 64-turn fallback loop. The post argues for episode- and portfolio-level efficiency analysis.

github.blog · 14 min
13

Automating cross-repo docs with GitHub Agentic Workflows跨仓库文档自动化:Aspire 团队把文档 PR 中位耗时压到 44.8 小时

The 10-person Aspire team automated cross-repo documentation with GitHub Agentic Workflows. Workflows are authored as one Markdown file: the agent evaluates whether a merged PR needs docs, drafts content in a checked-out aspire.dev workspace, and emits JSON intent; a separate safe-outputs handler materializes writes with a GitHub App scoped to exactly two repositories. Over Aspire 13.3/13.4, 396 merged product PRs produced 82 docs PRs, all merged with a 44.8h median and SME review from the original feature's engineer. The key enabler: milestone titles resolve the target docs branch before the agent wakes. Draft-only PRs, protected files, and allow-listed base branches keep the action surface crisp. The post is honest about v1's 13% false-positive gate and prompt-budget limits on large diffs. Practical for teams shipping docs from a separate repo.

Section 04

Platformizing Agents: Sandboxes, Observability, and Cost Engineering

5 / 20
claude.com · 5 min
14

Introducing routines: scheduled cloud automations in Claude CodeClaude Code 新增 routines:云端定时/API/Webhook 触发自动化

Anthropic is adding routines to Claude Code in research preview. A routine packages a prompt, a repo, and connectors into an automation that runs on Anthropic's cloud, so nothing depends on your laptop staying open. There are three triggers: a schedule (hourly, nightly, weekly), an HTTP endpoint with its own auth token that returns a session URL, and GitHub repository webhooks that open a session per matching PR and keep feeding in follow-ups like comments and CI failures. The post sketches usage patterns—nightly backlog triage, docs drift scans, post-deploy smoke checks, Datadog alert triage—and documents daily caps: 5 routines for Pro, 15 for Max, 25 for Team/Enterprise, with extra usage billed beyond. Existing /schedule CLI tasks migrate automatically. Note this is a vendor launch post: it defines the feature surface but offers no benchmarks or independent evaluation.

blog.cloudflare.com · 9 min
15

Introducing Cloudflare Agents: Agent Tracing and ObservabilityCloudflare Agents 上线:先解决 Agent 可观测性

Cloudflare introduces Cloudflare Agents, a unified console to deploy and manage hosted agents, launching with agent tracing. The feature adds agent-aware spans for model calls, tool executions, approval events, token usage, and supported subagent calls, overlaying existing Workers infrastructure traces (fetch, KV, D1). It is initially compatible with Think, Flue, and AI SDK, with plans to accept OpenTelemetry semantic conventions directly in Workers. Developers can replay recorded sessions to inspect full conversation context, or view execution waterfalls that show subagent delegation and the Cloudflare resources used. Traces can be exported to any OTLP destination, enabling evaluation and analytics. Pricing is based on existing Workers observability events, free during beta and then included in Workers Free/Paid plans. The feature targets teams running agents on Cloudflare who need behavior-level insight beyond traditional telemetry.

github.com · 5 min
16

Virtual filesystem and pluggable runtimes for AI agents给 AI 智能体一台虚拟电脑:Durable Object 上的可插拔文件系统

Cloudflare Computer is a virtual filesystem built inside a Durable Object. The authoritative state lives in SQLite, and a single pluggable execution entry point, workspace.runtime.exec, dispatches work to one of three backends. The container backend projects SQLite state into a sandbox as a real FUSE mount, allowing full Linux userland binaries and network access. The isolate shell backend runs bash in a Dynamic Worker and reaches the authoritative Workspace over Workers RPC, avoiding a second store. The isolate JavaScript backend evaluates ECMAScript modules in a Dynamic Worker with structured I/O, durable relative imports, and Workspace-backed node:fs/promises. A Workspace can also be used standalone as a filesystem without a backend. The project is explicitly preview-only, not for production, but includes docs, runnable examples, and fs-bench benchmarks. Useful for engineers exploring agent infrastructure, sandboxed runtimes, and cloud-native file systems.

x.com · 10 min
17

Cloudflare Computer: How to Cut AI Agent Sandboxing Costs by 80%按需拉起 Linux:Cloudflare Computer 把 Agent 沙箱月成本从 $36.83 降到 $7.53

The default way to sandbox AI agents is to keep a full Linux container alive for every agent. Cloudflare Computer proposes a split: the Workspace Durable Object (with a SQLite VFS) owns authoritative project state; ordinary reads, searches and edits run in a Worker isolate via workspace.fs and just-bash; real Linux operations like npm install and build start a container on demand, and a post-command pull synchronizes changes back. Using a small Vite site as the test case, the author shows code for switching backend between worker-shell and container, and warns that exitCode 0 alone is not durability — sync.status must be 'complete'. A cost model projects that dropping container duty cycle from 100% to 10% reduces monthly cost from ~$36.83 to ~$7.53 (79.6%), while node_modules is deliberately kept disposable. A strong read for engineers building coding agents, sandboxes, or durable workspaces.

blog.cloudflare.com · 14 min
18

Cloudflare ADLC: Workflow-based CI/CD for agent software factoriesCloudflare 提出 ADLC:把 CI/CD 变成 Workflow,让 Agent 接管软件工厂

Cloudflare argues the bottleneck in software development has moved from implementation to every other SDLC stage, now that AI makes code generation cheap. Their answer: let agents drive more of the lifecycle, not just codegen. The post introduces @cloudflare/ci, local OTel traces for Wrangler, Agent Traces, and a set of primitives meant to turn the SDLC into an 'Agent Development Lifecycle' for software factories. It includes Workflow code that parallelizes lint/test/typecheck/build and then deploys, plus guidance that CI/CD is just one kind of Workflow—workflows can spawn containers, agents, and browsers and persist state for days. The article also lists seven platform requirements for agent-driven delivery: programmatic, horizontally scalable, reproducible, push-based, atomic, permissioned, and self-improving. Useful for engineers building agent infrastructure on Cloudflare or exploring autonomous delivery pipelines.

Section 05

The Industry Inflection: Enterprise Adoption and What's Next

2 / 20
openai.com · 40 min
19

The State of Enterprise AI: OpenAI's 2025 ReportOpenAI企业AI报告:256%增长背后的采用现状与组织差距

OpenAI's 2025 enterprise AI report, based on aggregated data from 1M+ business customers and a survey of 9,000 workers across nearly 100 enterprises, finds adoption shifting from pilots to full deployment. ChatGPT Enterprise messages grew 8x YoY and per-org API reasoning token consumption rose 320x. 75% of workers report saving 40–60 minutes per active day, with data/engineering roles higher. A frontier vs. median divide emerges: frontier workers send 6x more messages overall, 17x more in coding. Organizational readiness—connectors, workflow standardization, executive sponsorship—is now the main bottleneck: ~1 in 4 enterprises haven't enabled data connectors. Customer stories (Intercom, Lowe's, BBVA, Moderna) are included. Useful for engineering leaders tracking enterprise AI adoption, though the data is vendor-sourced.

www.infoq.cn · 14 min
20

Jeff Dean's Last Interview: AI Speed, the 0% Rule, and His Google ExitJeff Dean 离职前最后一谈:低估 AI 速度,给创业者的 0% 生存法则

In his last interview before leaving Google, Jeff Dean admits his year-old prediction undershot reality: models are improving faster than expected at complex tasks, and agentic systems can now run continuously for weeks. He likens specialized inference hardware to the 2001 'put the search index in RAM' moment, citing 50x latency and 30-80x energy-efficiency gains. A single compute op costs ~1 picojoule; moving data costs 1000x more, which forces batching. The conversation covers context engineering as the new frontier, the napkin math behind TPU, and a founder heuristic: test your domain with the strongest general model — 0% or 1% success is a good sign, 20% is a red flag. Once agents write all the code, he argues, taste — knowing what to have agents solve — becomes the scarce skill. Relevant for AI infrastructure engineers, agent builders, and AI founders.