Problem
For OMP-driven seats, st2 is the authority for seat identity and session storage, but nothing st2-owned binds an OMP session (sessionId / session file) to the seat that ran it. A downstream usage exporter that reads OMP session JSONL can derive the seat from catalog topology for managed seats (JSONL lives under the seat workspace), but it cannot resolve session-id → seat without scanning files, and harness-context.v1 is replace-in-place and deleted on relaunch claim, so it cannot serve historical attribution.
Proposal (additive)
- In the OMP channel
session_start handler (hooks/omp-channel.ts), read ctx.sessionManager.getSessionId(), getSessionFile(), getSessionDir() (already in the read-only session API) and send a typed session frame alongside the initial context frame.
- Decode it in
src/pi_channel.rs; validate the file is absolute, beneath the supplied session dir / workspace, and that its name/header agrees with sessionId.
- Persist an append-only receipt under st2 control state keyed by session id:
{"schema":"st2.session-binding.v1","host":"...","identity":"...","persona":"...",
"launchKind":"managed|hosted","runtimeId":"...","generationId":"...",
"sessionId":"...","sessionDir":"...","sessionFile":"...","observedAtMs":0}
- Expose
st2 sessions --json [--id <sessionId> | --path <file>] reading those receipts. Add the record to the replicated driver-record allowlist / catalog watch ignore rules as needed.
Persona and host come from the declaration/receipt, not from the session title. Direct (non-catalog) launches stay outside this contract by design.
Consumer
The dotfiles omp-usage-exporter (VRS: context/coding-agents/19-token-efficiency/12-omp-usage/02-session-binding/ in schickling/dotfiles) resolves identity via: receipt → title fallback → unattributed.
Posted on behalf of @schickling
| field |
value |
agent_identity |
dev3.direct.omp.6yyfzdb5 |
session |
dev3.6yyfzdb5 |
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
For OMP-driven seats, st2 is the authority for seat identity and session storage, but nothing st2-owned binds an OMP session (
sessionId/ session file) to the seat that ran it. A downstream usage exporter that reads OMP session JSONL can derive the seat from catalog topology for managed seats (JSONL lives under the seat workspace), but it cannot resolve session-id → seat without scanning files, andharness-context.v1is replace-in-place and deleted on relaunch claim, so it cannot serve historical attribution.Proposal (additive)
session_starthandler (hooks/omp-channel.ts), readctx.sessionManager.getSessionId(),getSessionFile(),getSessionDir()(already in the read-only session API) and send a typedsessionframe alongside the initial context frame.src/pi_channel.rs; validate the file is absolute, beneath the supplied session dir / workspace, and that its name/header agrees withsessionId.{"schema":"st2.session-binding.v1","host":"...","identity":"...","persona":"...", "launchKind":"managed|hosted","runtimeId":"...","generationId":"...", "sessionId":"...","sessionDir":"...","sessionFile":"...","observedAtMs":0}st2 sessions --json [--id <sessionId> | --path <file>]reading those receipts. Add the record to the replicated driver-record allowlist / catalog watch ignore rules as needed.Persona and host come from the declaration/receipt, not from the session title. Direct (non-catalog) launches stay outside this contract by design.
Consumer
The dotfiles
omp-usage-exporter(VRS:context/coding-agents/19-token-efficiency/12-omp-usage/02-session-binding/in schickling/dotfiles) resolves identity via: receipt → title fallback → unattributed.Posted on behalf of @schickling
agent_identitysessionagent_personaagent_supervisoragent_toolagent_tool_versionagent_runtimetooling_profile