Skip to content

Every agent's model. One place. Codex on DeepSeek, Claude Code on Kimi, from the menu bar.

LESSONS: a new reader of a live object reads each field the way its writer writes it (983fff23d)

yetonec4972b36e135
diff --git a/LESSONS.md b/LESSONS.md
index c14f1e2ba..da4825976 100644
--- a/LESSONS.md
+++ b/LESSONS.md
@@ -248,6 +248,20 @@ nor the vendor's limits.**
ban risk, so a prompt change gets the same care as a header change.
- Seen 1× (2026-10-12).
+**A new reader of a live object reads each field the way its writer
+writes it.**
+- 7f827b3b0 (10-27) added /v1/magpie/claude-runs, which lists every
+ run and calls pid() on each. pid() read cmd.Process without a lock
+ while a run's launch was still in cmd.Start writing it. It was red
+ under -race on ubuntu CI at 6104e88aa only (run 40698575099), since
+ most runs were cancelled by the next push. 983fff23d reads the run's
+ tree under mu first; it was red with a 50ms sleep injected at launch,
+ and not in 30 runs without it.
+- Before adding a list or status route, find who writes each field it
+ reads and under which lock. Run its test under -race with a delay
+ injected into the writer.
+- Seen 1× (2026-10-28).
+
**A bit or enum value has one owner.**
- d4c2512d2 (#1874) gave a usage row's Flags bit 256 to rowOwnCost while
a rebase of #1463 gave it to rowReasoningHidden, so every reported cost