Skip to content

Expose lifecycle-aware agent tree with live terminal state - #7970

Closed
lawrencecchen wants to merge 583 commits into
mainfrom
issue-7867-agent-session-lifecycle
Closed

lawrencecchen wants to merge 583 commits into
mainfrom
issue-7867-agent-session-lifecycle

Conversation

@lawrencecchen

@lawrencecchen lawrencecchen commented Jul 13, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #7867
Supersedes #7869 and #8309

Summary

  • Add a provider-neutral agent session registry with durable runs, process generations, restore authority, parent/child and fork edges, workloads, bounded history, and runtime ownership.
  • Add cmux agents list and cmux agents tree; retain cmux sessions as a compatibility alias.
  • Reconcile hook lifecycle with cached terminal process/state observations without terminal capture or UI-thread filesystem work.
  • Make restore, fork, hibernation, and completion fail closed on stale, ambiguous, corrupt, unavailable, or non-replayable session evidence.
  • Support hook-backed providers and terminal-only detection while preserving provider-specific lifecycle authority.
  • Bound registry import, legacy discovery, graph projection, transcript lookup, executable validation, and CLI rendering work.

Testing

  • cmux-unit build-for-testing passes on the current head.
  • Tagged macOS fleet build a7970 passes on the current head: https://github.com/manaflow-ai/cmux/actions/runs/29674242597
  • Regression coverage includes registry migration/corruption, authority recovery, PID reuse, runtime scoping, lifecycle races, CLI list/tree projection, bounded scans, hibernation teardown, provider replay contracts, and executable/shebang availability.
  • Project normalization, test wiring, workspace package grouping, localization JSON parsing, English/Japanese localization coverage, and diff whitespace checks pass.

Demo video

Not included. The CLI path is deterministic and is covered by tagged preflight plus behavior-level tests.

Review trigger

Review the current head after required checks finish.

Checklist

  • Behavior-level regressions precede their fixes where applicable.
  • User-facing strings include English and Japanese localizations.
  • App target and test bundle compile.
  • Current main is merged cleanly.
  • Required checks pass on the pushed head.
  • Dogfood approval received.

Summary by CodeRabbit

  • New Features

    • Added cmux agents list and cmux agents tree for inspecting agent sessions, relationships, activity, workloads, and lifecycle state.
    • Added JSON output, filtering, history views, depth limits, and bounded result handling.
    • Added runtime-aware session scoping to distinguish current and historical sessions.
    • Added workload tracking for background tasks, monitors, scheduled work, tools, and subagents.
    • Added improved hibernation, restoration, fork, completion, and interruption handling.
    • Added Copilot hook support and expanded agent integrations.
  • Bug Fixes

    • Improved notification ownership, stale-session protection, process tracking, and lifecycle race handling.
    • Improved resilience when session data is malformed, duplicated, or incomplete.

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

Labels

stale-revisit Closed after 30+ days without activity; preserved for possible revisit or reopening.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Nightly session restore fails for Codex: pane returns as bare shell, resume binding never persisted (0.64.17-nightly)

2 participants