feat(agent-access): list non-secret ssh-agent sessions #93

Merged
pdurlej merged 2 commits from codex/issues/79-list-sessions into main 2026-05-06 00:18:14 +02:00
Collaborator

Canary status: approve_merge — 6/6 reviewers OK on eca015a97a944781a2ad526487502cb5275165d2 in final allowed iteration.

Canary Context Pack

Product story

After Codex can start and stop a bounded OpenClaw SSH capability, the operator needs a safe way to see what non-secret session state exists. This reduces blind cleanup work without exposing the OpenClaw private key or deleting anything.

What changed

  • Added --list to scripts/agent-access/codex-openclaw-ssh-agent.
  • Lists non-secret fields: session id, status, capability, expiry, key fingerprint.
  • Supports active, stopped, expired, and unknown session states.
  • Treats mismatched, malformed, undecodable, invalid-field, invalid-fingerprint, or invalid-directory metadata as unknown and does not trust its capability/fingerprint fields.
  • Documents --list in the Codex OpenClaw SSH runbook.
  • Adds focused tests for populated and empty session inventory without private-key env.

Why it changed

This is the next non-destructive child slice of #79 after #84/#90 merged the startup/signal cleanup work. It closes the visibility part of lifecycle hardening while keeping pruning/destructive cleanup out of scope.

Files touched

  • scripts/agent-access/codex-openclaw-ssh-agent
  • control-plane/platformctl/tests/test_agent_access_ssh_agent.py
  • docs/agent-access/codex-openclaw-ssh.md

Relevant context

  • Parent #79: session lifecycle hardening.
  • Child #92: list non-secret ssh-agent sessions.
  • PR #84/#90: startup/signal cleanup already merged.
  • Security-sensitive lane from #82 applies: smallest PR, explicit evidence, canary before merge.

Runtime evidence

  • PYTHONPATH=control-plane pytest -q control-plane/platformctl/tests/test_agent_access_ssh_agent.py -> 13 passed
  • PYTHONPATH=control-plane pytest -q control-plane/platformctl/tests -> 169 passed
  • git diff --check origin/main...HEAD -> pass
  • Diff secret-pattern scan -> pass

Known constraints

--list reports validated persisted metadata only. It does not read the private-key env, does not read agent.env, does not contact live agents, and does not prove that an active socket still responds, refuses unsafe existing sessions-dir permissions instead of changing them, and keeps destructive or live-probe behavior for a later slice if needed.

Explicit out-of-scope

  • No --prune.
  • No session directory deletion.
  • No TTL policy change.
  • No Infisical, Forgejo PAT, CI, or OpenClaw runtime change.

Requested decision

Approve merge if canary confirms --list gives useful non-secret inventory without introducing trust, leak, or cleanup risk.

Merge blockers

  • Any private-key material in stdout/stderr/session files.
  • --list requiring secret env or OpenSSH tools.
  • Trusting malformed/mismatched metadata as valid.
  • Any deletion or mutation of session directories.

Spec sources read

  • Issue #79 — parent lifecycle hardening scope.
  • Issue #92 — child scope and acceptance criteria.
  • scripts/agent-access/codex-openclaw-ssh-agent — implementation target.
  • control-plane/platformctl/tests/test_agent_access_ssh_agent.py — existing wrapper test harness.
  • docs/agent-access/codex-openclaw-ssh.md — operator runbook update.
  • PR #80 body/diff — source for earlier rejected broad approach; only non-destructive list subset carried forward.

Closes #92
Refs #79

Canary status: approve_merge — 6/6 reviewers OK on `eca015a97a944781a2ad526487502cb5275165d2` in final allowed iteration. ## Canary Context Pack ### Product story After Codex can start and stop a bounded OpenClaw SSH capability, the operator needs a safe way to see what non-secret session state exists. This reduces blind cleanup work without exposing the OpenClaw private key or deleting anything. ### What changed - Added `--list` to `scripts/agent-access/codex-openclaw-ssh-agent`. - Lists non-secret fields: session id, status, capability, expiry, key fingerprint. - Supports `active`, `stopped`, `expired`, and `unknown` session states. - Treats mismatched, malformed, undecodable, invalid-field, invalid-fingerprint, or invalid-directory metadata as `unknown` and does not trust its capability/fingerprint fields. - Documents `--list` in the Codex OpenClaw SSH runbook. - Adds focused tests for populated and empty session inventory without private-key env. ### Why it changed This is the next non-destructive child slice of #79 after #84/#90 merged the startup/signal cleanup work. It closes the visibility part of lifecycle hardening while keeping pruning/destructive cleanup out of scope. ### Files touched - `scripts/agent-access/codex-openclaw-ssh-agent` - `control-plane/platformctl/tests/test_agent_access_ssh_agent.py` - `docs/agent-access/codex-openclaw-ssh.md` ### Relevant context - Parent #79: session lifecycle hardening. - Child #92: list non-secret ssh-agent sessions. - PR #84/#90: startup/signal cleanup already merged. - Security-sensitive lane from #82 applies: smallest PR, explicit evidence, canary before merge. ### Runtime evidence - `PYTHONPATH=control-plane pytest -q control-plane/platformctl/tests/test_agent_access_ssh_agent.py` -> `13 passed` - `PYTHONPATH=control-plane pytest -q control-plane/platformctl/tests` -> `169 passed` - `git diff --check origin/main...HEAD` -> pass - Diff secret-pattern scan -> pass ### Known constraints `--list` reports validated persisted metadata only. It does not read the private-key env, does not read `agent.env`, does not contact live agents, and does not prove that an `active` socket still responds, refuses unsafe existing sessions-dir permissions instead of changing them, and keeps destructive or live-probe behavior for a later slice if needed. ### Explicit out-of-scope - No `--prune`. - No session directory deletion. - No TTL policy change. - No Infisical, Forgejo PAT, CI, or OpenClaw runtime change. ### Requested decision Approve merge if canary confirms `--list` gives useful non-secret inventory without introducing trust, leak, or cleanup risk. ### Merge blockers - Any private-key material in stdout/stderr/session files. - `--list` requiring secret env or OpenSSH tools. - Trusting malformed/mismatched metadata as valid. - Any deletion or mutation of session directories. ## Spec sources read - Issue #79 — parent lifecycle hardening scope. - Issue #92 — child scope and acceptance criteria. - `scripts/agent-access/codex-openclaw-ssh-agent` — implementation target. - `control-plane/platformctl/tests/test_agent_access_ssh_agent.py` — existing wrapper test harness. - `docs/agent-access/codex-openclaw-ssh.md` — operator runbook update. - PR #80 body/diff — source for earlier rejected broad approach; only non-destructive list subset carried forward. Closes #92 Refs #79
feat(agent-access): list non-secret ssh-agent sessions
All checks were successful
canary-required / collect-diff (pull_request) Successful in 3s
infra-docs-drift / docs-drift (pull_request) Successful in 4s
pyfallow / Pyfallow gate (control-plane) (pull_request) Successful in 15s
python-ci / Python 3.11 (pull_request) Successful in 28s
python-ci / Python 3.12 (pull_request) Successful in 29s
python-ci / Python 3.13 (pull_request) Successful in 28s
workflow-lint / lint (pull_request) Successful in 4s
canary-required / canary (pull_request) Successful in 13s
c99e15ec0c
codex force-pushed codex/issues/79-list-sessions from c99e15ec0c
All checks were successful
canary-required / collect-diff (pull_request) Successful in 3s
infra-docs-drift / docs-drift (pull_request) Successful in 4s
pyfallow / Pyfallow gate (control-plane) (pull_request) Successful in 15s
python-ci / Python 3.11 (pull_request) Successful in 28s
python-ci / Python 3.12 (pull_request) Successful in 29s
python-ci / Python 3.13 (pull_request) Successful in 28s
workflow-lint / lint (pull_request) Successful in 4s
canary-required / canary (pull_request) Successful in 13s
to c381035e98
All checks were successful
canary-required / collect-diff (pull_request) Successful in 3s
infra-docs-drift / docs-drift (pull_request) Successful in 3s
pyfallow / Pyfallow gate (control-plane) (pull_request) Successful in 15s
python-ci / Python 3.11 (pull_request) Successful in 27s
python-ci / Python 3.12 (pull_request) Successful in 28s
python-ci / Python 3.13 (pull_request) Successful in 29s
workflow-lint / lint (pull_request) Successful in 4s
canary-required / canary (pull_request) Successful in 12s
2026-05-06 00:03:28 +02:00
Compare
codex force-pushed codex/issues/79-list-sessions from c381035e98
All checks were successful
canary-required / collect-diff (pull_request) Successful in 3s
infra-docs-drift / docs-drift (pull_request) Successful in 3s
pyfallow / Pyfallow gate (control-plane) (pull_request) Successful in 15s
python-ci / Python 3.11 (pull_request) Successful in 27s
python-ci / Python 3.12 (pull_request) Successful in 28s
python-ci / Python 3.13 (pull_request) Successful in 29s
workflow-lint / lint (pull_request) Successful in 4s
canary-required / canary (pull_request) Successful in 12s
to eca015a97a
All checks were successful
canary-required / collect-diff (pull_request) Successful in 4s
infra-docs-drift / docs-drift (pull_request) Successful in 4s
pyfallow / Pyfallow gate (control-plane) (pull_request) Successful in 15s
python-ci / Python 3.11 (pull_request) Successful in 28s
python-ci / Python 3.12 (pull_request) Successful in 29s
python-ci / Python 3.13 (pull_request) Successful in 30s
workflow-lint / lint (pull_request) Successful in 4s
canary-required / canary (pull_request) Successful in 12s
2026-05-06 00:09:08 +02:00
Compare
Author
Collaborator

Canary iteration 3: approve_merge on eca015a97a944781a2ad526487502cb5275165d2. 6/6 reviewers OK.

Local evidence before final canary: focused test 13 passed, full platformctl/tests 169 passed, git diff --check pass, current diff secret-pattern scan pass.

Weak signals accepted for this slice: active means metadata-unexpired, not live-verified; PR body documents that constraint. Broken sessions symlink/invalid-dir handling is non-destructive and can be revisited with the future prune/live-probe slice.

Canary iteration 3: `approve_merge` on `eca015a97a944781a2ad526487502cb5275165d2`. 6/6 reviewers OK. Local evidence before final canary: focused test `13 passed`, full `platformctl/tests` `169 passed`, `git diff --check` pass, current diff secret-pattern scan pass. Weak signals accepted for this slice: `active` means metadata-unexpired, not live-verified; PR body documents that constraint. Broken sessions symlink/invalid-dir handling is non-destructive and can be revisited with the future prune/live-probe slice.
Merge branch 'main' into codex/issues/79-list-sessions
All checks were successful
canary-required / collect-diff (pull_request) Successful in 3s
pyfallow / Pyfallow gate (control-plane) (pull_request) Successful in 15s
python-ci / Python 3.11 (pull_request) Successful in 28s
python-ci / Python 3.12 (pull_request) Successful in 29s
python-ci / Python 3.13 (pull_request) Successful in 29s
canary-required / canary (pull_request) Successful in 12s
c7fdc8358b
Sign in to join this conversation.
No reviewers
No labels
W6d-automerge-calibration
agent/claude-code
agent/codex
agent/hermes
agent/iskra
agent/ollama
agent/patchwarden
automerge-candidate
class/security-sensitive
cutover-gate
dependency/blocked
dependency/blocks-others
dependency/cross-repo
dependency/needs-confirmation
domain:agents
domain:ci
domain:docs
domain:forgejo
domain:infra
domain:memory
domain:runtime
domain:signal
domain:ux
flow/architecture
flow/blocked
flow/deployed
flow/done
flow/implementation
flow/intake
flow/maintained
flow/observed
flow/ready
flow/refining
flow/retired
flow/review
iterating
judge/codex-candidate
judge/hermes-candidate
judge/low-confidence
judge/needs-refinement
judge/operator-needed
judge/p0
judge/p1
judge/p2
judge/p3
judge/park
judge/patchwarden-candidate
judge/stale-priority
kind/adr
kind/bug
kind/chore
kind/feature
kind/infra
kind/ops
kind/refactor
kind/research
large-impact
merge/auto
merge/manual
merge/manual-dependency-conflict
merge/manual-failing-tests
merge/manual-merge-conflict
merge/manual-missing-review
merge/manual-operator-preference
merge/manual-red-zone
merge/manual-security-sensitive
merge/manual-unclear-scope
merge/manual-unknown
meta
mode:operator-only
mode:patchwarden-iskra-approved
mode:safe-auto
needs-operator-decision
needs-triage
not-ready
observed/erroring
observed/needs-followup
observed/pending
observed/retire-candidate
observed/unused
observed/used
operator-emotional
owner-attention
phase/02
phase/03
priority:p0
priority:p1
priority:p2
priority:p3
proposed
ready-for-agent
ready-for-operator
recovery
review:claude-reviewed
review:codex-reviewed
review:dziadek-reviewed
review:needs-human
risk/exposure
risk/process
risk/product
risk/runtime
safety:external-write
safety:no-prod-mutation
safety:prod-impact
safety:secret-touch
size/large
size/medium
size/small
size/tiny
size/unknown
source/adr
source/agent-generated
source/manual
source/operator-chat
source/voice-note
status:blocked
status:codex-ready
status:merged:pending-evidence
status:needs-evidence
status:operator-needed
status:parked
tier/full
tier/lite
tier/stacked
tier:0-platform-substrate
tier:1-iskra-value-layer
tier:2-tools-products-modules
type:bug
type:chore
type:docs
type:feat
type:policy
type:research
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
pdurlej/platform!93
No description provided.