Skip to content

Activation: deploy PTY environment persistence for manual restart #30

Description

@myobie

Activation-only status

Current st2 main a8c57122b878c48e2f4cad79925534cdbb863ac0 persists the complete managed environment through repeatable PTY --env arguments. The real manual_pty_restart_preserves_every_st2_managed_environment_and_config_value test passes on the current compatible PTY.

The remaining work is activation only: ship a PTY artifact that supports persisted environment replay to every intended target, deploy the compatible st2/PTy pair, and repeat the manual-restart proof there. No further st2 source change is requested unless activation exposes a new regression.


Original report

Problem

An initial st2 launch supplies its managed environment to the child process, but a manual PTY restart can still lose ST_AGENT, ST_ROOT, CATALOG, and the rest of that overlay.

st2 persists the overlay by passing repeated pty run --env KEY=VALUE arguments. The deployed PTY 0.12.0 does not implement --env: it is absent from pty run --help, and its compatibility parser accepts --env as the legacy display name. The initial child still sees the variables because st2 also sets them on the pty run process, but PTY metadata has no environment to replay during pty restart.

This reopens #30 because its acceptance explicitly included PTY restart proof. Initial launch is fixed; restart with an incompatible backend is not.

Evidence

An isolated probe with PTY 0.12.0:

$ PTY_ROOT=<temp> pty run -d --id env-probe --tag keep=true --env PROBE=value -- sh -c '...'
Hint: use --name instead: pty run --name --env -- ...
Session "env-probe" created.

$ PTY_ROOT=<temp> pty list --json
[{"name":"env-probe", ... "displayName":"--env"}]

Three independent isolated handoff evals then restarted one coding-agent PTY after its pre-commit checkpoint. In all three, the first post-restart resource read observed an unknown acting identity. The agents recovered only after explicitly supplying ST_AGENT; the dirty worktree itself survived.

This is deterministic with st2 0.1.0+33d159b and PTY 0.12.0.

Expected

  • st2 detects whether its selected PTY backend supports environment persistence before launching a managed task and fails closed with an actionable compatibility error when it does not.
  • The supported/minimum PTY capability is explicit rather than inferred from a successful pty --help.
  • The native lifecycle gate runs against the minimum supported packaged PTY and proves that a real manual restart restores every managed value.
  • A successful initial launch cannot be mistaken for proof that restart replay is available.

Related: #64, #77.

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

    area:ptyPTY sessions and terminal integration · Set: manualtype:bugSomething broken or a regression · Set: manual

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions