revert(cli): revert headless agent session control (#5784)

Merged
KI
4mo ago
+298-3709

Summary

Reverts #5784 (squash commit 8386961b5) to isolate a deterministic regression: existing terminals stop accepting input, and automation-launched terminals break the same way, reliably on every run. Prod (desktop-v1.16.0, daemon 0.2.5) is unaffected; the regression exists only in post-1.16.0 builds carrying daemon 0.2.6.

#5784 is the prime suspect because it is the only recent merge on every input path shared by both broken surfaces:

  • rewrote host-service DaemonClient (carries all writes: desktop keystrokes and automation prompt delivery)
  • bumped the daemon protocol to v3 (snapshots), with v2 negotiation
  • replaced interactive prompt writes with the prompt-file/POSIX launcher + launch acknowledgement for argv/stdin agents

Changes

  • Clean git revert of 8386961b5 — daemon back to protocol v2-only, CLI agents sessions list/read/send/wait removed, launch path restored
  • pty-daemon bumped 0.2.5 → 0.2.7 (not back to 0.2.5): isVersionUpdatePending only updates daemons running < EXPECTED_DAEMON_VERSION, so restoring 0.2.5 would leave already-upgraded 0.2.6 daemons running the suspect binary forever. 0.2.7 makes them hand off onto the reverted build. #5795 (fd disposal) merged before #5784 and is intentionally not reverted.

Validation

  • bun run typecheck — 35/35 tasks pass (confirms nothing merged after #5784 references the reverted code)
  • bun run lint — clean
  • bun install --frozen-lockfile — lockfile consistent

If the automation repro passes on this branch, #5784 is confirmed as the cause and can be re-landed piecewise (DaemonClient rewrite, protocol v3, prompt launcher) to find the specific culprit.


Summary by cubic

Reverts headless agent session control and protocol v3 snapshots to fix a regression where terminals stopped accepting input in post-1.16 builds. Restores the prior agent launch path and v2-only daemon protocol; bumps @superset/pty-daemon to 0.2.7 so hosts on 0.2.6 converge to the reverted build.

  • Bug Fixes
    • Restore v2-only daemon protocol; remove snapshot messages and terminal snapshot rendering.
    • Revert prompt-file/argv agent launcher and drop CLI session commands (superset agents sessions list/read/send/wait), tests, and CDP runbook; docs updated.
    • @superset/pty-daemon bumped to 0.2.7 to replace existing 0.2.6 daemons with the reverted binary.
    • @superset/cli-framework arg parser no longer treats - as a stdin sentinel for string options.

Summary by CodeRabbit

  • Changes

    • Removed CLI commands for listing, reading, sending prompts to, and waiting on running agent sessions.
    • Workspace creation no longer reports failures when requested agents do not start.
    • CLI option parsing now requires values that do not begin with a hyphen.
  • Documentation

    • Updated workspace and agent command examples and session-opening guidance.
    • Removed obsolete CLI end-to-end testing runbooks and instructions.
  • Maintenance

    • Simplified terminal communication and session handling.