edit | blame | history | raw

MB-X session restore scripts

Generated by mbx session restore-script generate.

Scope

These scripts are registry-aware wrappers around MB-X CLI. They intentionally do not hardcode provider_session_id/thread_id. Runtime session ids are read from the current MB-X workspace/project configuration when the script runs.

App-server URL: ws://127.0.0.1:4570

Targets:

  • management.admin -> open-management-admin.bat / restore-management-admin.bat
  • management.observer -> open-management-observer.bat / restore-management-observer.bat

Managed Session Reuse

Multiple role ids can intentionally point to the same managed Codex window. Running any role wrapper in the same group opens or restores that same registered thread.

  • management.admin: management.admin
  • management.observer: management.observer

Usage

  1. Run 00-start-codex-app-server-4570.bat if the Codex app-server is not running.
  2. The scripts preflight both python and Codex CLI (codex.cmd / codex.exe / codex) in the same cmd/BAT PATH used to launch the wrapper. If Codex is missing, fix PATH or set the workspace provider command to an absolute executable path before retrying.
  3. Run open-<role>.bat first for non-destructive open/reuse. It can recover stale/missing PID cases by resuming the existing thread, but it will not terminate an alive recorded PID.
  4. If status says PID is alive but the visible window is still missing, run restore-<role>.bat; it asks for REOPEN before calling mbx session reopen --terminate-existing.
  5. After open/restore, verify the visible Codex window contains the old chat history. session history --contains is useful evidence, but it is not a substitute for visible-window proof.
  6. Regenerate these scripts after role/session binding, project root, app-server URL, or MB-X source path changes:
python -m mbx.cli session restore-script generate --include-management

Risk boundary

restore-*.bat may terminate the recorded old remote TUI process. For management.admin and management.observer, real destructive close/reopen validation is a management high-risk action and must be recorded by the management/project workflow.

Formal manual recovery guide: doc/operation/MB-X会话窗口手动恢复指南.md

Workspace root used by generated wrappers: D:\manage_system