Skip to content

Separate pure session reads from liveness reconciliation and cleanup #174

Description

@schickling-assistant

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions