Skip to content

About

Postmortems and working notes from running AI-heavy products with a small team: Postgres pooling, Next.js, Vercel, auth, model spend and coding-agent operations.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Engineering field notes

Postmortems and working notes from building and running AI-heavy products with a small team: shared Postgres on small instances, Next.js on Vercel, single sign-on across many internal apps, model spend, and fleets of coding agents that commit more often than people do.

Each note records something that actually went wrong or was actually slow, what the first diagnosis was, why it was wrong, and what fixed it. Company, client and people details are removed. The mechanisms, error messages, SQL and commands are real.

Written by Direk Sethi.

Postmortems

What broke The lesson in one line
01 Per-role pooler pools oversubscribed the database A limit that is "per something" needs the multiplication written down.
02 A session-level SET leaked through the transaction pooler On a transaction pooler there is no such thing as "my session".
03 A test teardown stalled production authentication A separate schema isolates names, not locks, disk or I/O.
04 Background work starved the shared database of I/O The query that fails is usually the victim. Rank by blocks read first.
05 Prepaid AI credit reached zero A prepaid balance is a single point of failure with a countdown.
06 Sessions dropped every fifteen minutes A bug with a period equal to a configured lifetime is that lifetime.
07 A dev server took the whole machine, and the agents died first The first process the OOM killer takes is the one with the worst score, not the most memory.
08 Refreshed tokens kept a dead session A sign-in lives as long as the shortest thing it is bound to.

Notes

Next.js

Vercel

Security and auth

AI engineering operations

Templates

Recurring themes

  • The failing component is usually the victim. Six of the eight postmortems started with a correct observation and a wrong suspect.
  • Defaults nobody chose. Pool sizes, cache lifetimes, prefetch rules and build triggers were all defaults, so none of them appeared in a review.
  • Shared things fail together. One database instance, one credit balance and one refresh token each turned a local problem into a platform problem.
  • Agents change the numbers. Limits and workflows designed around human commit rates and human session counts need to be re-derived.

Related tools

Several of these notes led to small tools that are open source:

  • mcp-token-relay: one OAuth sign-in shared by many agent CLIs.
  • evalbench: a benchmark harness for comparing LLM pipelines with confidence intervals.
  • skills: agent skills for Claude Code and Codex.

License

Text is licensed under CC BY 4.0, code snippets under MIT. See LICENSE.

About

Postmortems and working notes from running AI-heavy products with a small team: Postgres pooling, Next.js, Vercel, auth, model spend and coding-agent operations.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors