#1665, owner's item 2: codexReached opened Codex's logs_*.sqlite on
every ask, and every Drift asks it. The report's trace shows ~2465 reads
of logs_2.sqlite in 25s of a Windows start. The read is now kept per
Codex folder. The key is the database path, the since day, and the size
and modification time of the database and its -wal. A kept read stands
for at most 15s, so a file system with coarse times can't hide a write
that kept the size. A hit older than 24h is never kept, since it falls
out of the window being read. In an interposed sandbox start, opens of
logs_2.sqlite went from 6-8 per run to 4.
TestCodexReachedReadsLogOnlyWhenItChanged asks 50 times and expects 1
read. It then writes to the log and expects a fresh read that sees the
write. With the cache check turned off by hand, it goes red:
--- FAIL: TestCodexReachedReadsLogOnlyWhenItChanged (3.23s)
codex_reached_test.go:50: 50 asks read the log 50 times, want 1
Owner's item 3: the PATH x PATHEXT lookup cache, 8bfe33f1f (#1771), is
an ancestor of this commit and shipped in v0.1.1214. The reporter's
trace was taken on v0.1.1212.
What was run (worktree at 9fd80b212 plus this change and the commits
before it):
gofmt -l internal/: nothing
go vet ./internal/agent: exit 0
GOOS=linux go vet -tags nogui ./...: exit 0
GOOS=windows go vet -tags nogui ./...: exit 0
go test -timeout 45m -count=1 ./internal/agent: ok 2591.806s