Problem
getSession(ref) calls listSessions(), even when ref is an immutable session ID. listSessions() scans the full registry, probes every socket, removes stale socket/PID files, and deletes old or invalid metadata.
This makes a metadata lookup:
- O(number of sessions), including sequential socket probes;
- effectful, because a read can perform cleanup;
- unsuitable for frequent consumers such as statuslines and dashboards.
A local registry with about 1,000 metadata records took several minutes for one pty list --json call when socket probes hit their timeout path. Reading the exact metadata file directly was effectively immediate.
Desired contract
Expose distinct operations:
get(id) pure exact metadata read; no scan, probe, or cleanup
snapshot() pure registry snapshot; no probe or cleanup
probe(id) explicit liveness/socket reachability check
gc() explicit reconciliation and cleanup
Display-name resolution can remain a separate lookup that reports ambiguity. Exact immutable-ID lookup should not fall back to a full scan.
Metadata snapshots remain the state source. Events can invalidate caches, but a missed or compacted event must be recoverable through a pure snapshot read.
Posted on behalf of @schickling
| field |
value |
agent_identity |
dev3.direct.omp.zf8bz8y7 |
session |
dev3.zf8bz8y7 |
agent_persona |
generalist |
agent_supervisor |
unavailable |
agent_tool |
OMP |
agent_tool_version |
18.1.2 |
agent_runtime |
OMP 18.1.2 |
tooling_profile |
dotfiles@7534055 |
Problem
getSession(ref)callslistSessions(), even whenrefis an immutable session ID.listSessions()scans the full registry, probes every socket, removes stale socket/PID files, and deletes old or invalid metadata.This makes a metadata lookup:
A local registry with about 1,000 metadata records took several minutes for one
pty list --jsoncall when socket probes hit their timeout path. Reading the exact metadata file directly was effectively immediate.Desired contract
Expose distinct operations:
Display-name resolution can remain a separate lookup that reports ambiguity. Exact immutable-ID lookup should not fall back to a full scan.
Metadata snapshots remain the state source. Events can invalidate caches, but a missed or compacted event must be recoverable through a pure snapshot read.
Posted on behalf of @schickling
agent_identitysessionagent_personaagent_supervisoragent_toolagent_tool_versionagent_runtimetooling_profile