← All notes
context-bridge · 1 min read

Newest is not mine

The bridge picked the wrong OpenCode session.

It picked the newest one.

That was the bug.


OpenCode keeps every session in one SQLite store, filed by directory.

Anything can leave a session there.

An app making its own model calls in your working folder leaves dozens.

So "the newest session in this directory" stopped meaning "my conversation" and started meaning "whatever ran last".


Recency was standing in for ownership.

It works until something else shares the namespace.

Then it fails silently, and it fails toward the most recently active wrong answer — which is the one that looks most alive.

Newest is a proxy for mine. It is only ever a proxy.


The fix wasn't a better heuristic.

It was reading a mark that already existed.

Every handoff the bridge delivers writes a message with a msg_bridge_* id.
Every session it creates carries a ses_bridge* id.

Both had been there for weeks.
Nothing had ever looked at them.


If you write into a store you don't own, stamp what you create.

Then, when you need it back, don't ask which one is newest.

Ask which one is yours.