Introduction¶
In multi-session, multi-agent scenarios, it is essential to confirm that all sessions are in a safe state before closing or restarting DSH. Existing approaches often rely on manually checking each session one by one, which is error-prone and lacks a unified basis for decision-making. dsh-reboot-lights provides a three-state traffic light in the bottom-right corner of the GUI home page, aggregating the arbitration results from each session to help developers quickly determine whether a safe restart is possible.
What Is This¶
dsh-reboot-lights is a DSH plugin delivered by maintainer ORIOW. It displays a floating traffic light in the bottom-right corner of the GUI home page, providing a conclusion on whether a safe restart is possible based on each session’s reboot_light report.
- Red: Restart not permitted
- Yellow: Waiting required, or manual operations needed after exit
- Green: Restart directly
The plugin only collects and displays results; it performs no automatic restart or exit actions.
Core Features¶
- Bottom-right three-state floating traffic light (
shell.overlay): Aggregates thereboot_lightarbitration results from all participating sessions. - “Re-detect” button: Triggers
detect(), which only wakes sessions that have been active within the last 15 minutes, and automatically skips auto-sessions (e.g., memory hub /dam-workbench-prefix) to save tokens. - Panel display: Each session is displayed as “workspace name · session name” rather than sessionId.
- Yellow-light manual procedure documentation: Manual steps for yellow-light sessions are uniformly written to
~/user_reboot_SOP.md, with independent sections per session, anchor-based full-segment replacement, and a serial write queue to prevent mutual corruption.
Architecture¶
- Host half (
lib/index.js): - Registers the
reboot_lighttool, allowing each session’s agent to report{light, reason, manualSteps?}. detect()usesctx.agents.list()+ctx.sessionController.listState.list()(async, filtered by 15-minute activity) to identify target sessions, thenagent.followup(createUserMessage(promptText))inserts the detection prompt.writeSop()usesnode:fs/promisesto write directly to~/user_reboot_SOP.md(bypassing the cordis sandbox’sFS_SANDBOX_DENIED), with anchor-based full-segment replacement + serial write queue.- 3 webServer routes:
GET /state,POST /detect,POST /open-sop. - Client half (
lib/client.js):window.__ModuleLoader__.loadenvelope, mountsshell.overlay, polls/statefor aggregated display, panel includes a “Re-detect” button. - Message construction convergence (
lib/user-message.js):createUserMessage(text)is the sole construction entry point, filling inid/role/content/sourceto prevent the host read-sideassertMessageEventShapefrom flagging session corruption.
Installation & Activation¶
In the local plugin development directory, run the mount script to attach the plugin to the DSH profile (including symlink and cordis.patch.yml insert):
node scripts/mount-reboot-lights.mjs --apply
Typical Usage¶
- Open the DSH GUI home page; the traffic light panel will appear in the bottom-right corner.
- The plugin automatically aggregates
reboot_lightresults from each session: - If any red-light session exists, the red light stays on.
- If all sessions are green, the green light turns on.
- If a yellow-light session appears, the panel lists the session information, and the corresponding manual procedure section is written to
~/user_reboot_SOP.md. - Clicking the “Re-detect” button triggers
detect(), checking only non-auto sessions that have been active within the last 15 minutes.
Applicable Scenarios & Notes¶
- Suitable for DSH developers and ops scenarios that require unified management of multi-session restart decisions.
- The plugin runs with the current dsh process privileges. It is recommended to review the source code and license before installation.
Brief Closing¶
dsh-reboot-lights transforms the multi-session restart decision workflow from manual spot-checking into a visualized and traceable process through its traffic light and SOP documentation. For more details, see the directory page and the GitHub repository.