Tag
Posts tagged Architecture.
6 posts filed under Architecture. Sorted newest first.
- 01Lessons learnedCloud Armor propagationI reverted a security rule because a probe against the live load balancer said it failed open. Cloud Armor takes about 100 seconds to propagate a new rule to the edge; my probe fired at 10 seconds and measured a rule that did not exist yet. Verifying the right layer isn't enough, you have to wait until it has decided.
- 02Deep diveOne click, 221 re-renders: React Context can't subscribe to a fieldI memoized the context value and wrapped the hot components in React.memo, standard advice, and one click still re-rendered a list 221 times. Context notifies every consumer when the value object's identity changes, regardless of which field a consumer reads, and no memo can stop that. The fix: a selector-based Zustand store.
- 03Lessons learnedToken quotasA 27-second stall traced back to a token quota, not a request quota: Shannon's agent loop was re-sending its entire context on every turn. The fix is prompt caching with breakpoints placed where each layer of context stops changing, plus a canary token that almost broke it again.
- 04Deep diveTranslating an SDK loop into one browser streamA Shannon agent run looks like one continuous stream in the browser. Underneath it's a loop of separate Anthropic API calls with tool execution wedged between them. The fix is a server-side translation layer that hides every seam behind a small, fixed vocabulary of UI events.
- 05Deep diveTwo event pipelines, one UI timelineEvery AI agent UI is secretly two UIs: one renders events live over SSE, the other rebuilds the same timeline from the database on reload. They have to match exactly, and five separate bugs, from parsing to null handling to ordering, proved they easily don't.
- 06Deep diveHibernating an agent loopWhat happens when a cloud AI agent needs to ask the user a question mid-task? You can't just block a coroutine. The fix: treat the agent loop as a function whose entire state is a message list, serialize it to Postgres, exit the process, and reconstruct the loop from scratch when the human answers.