dsh-session-scheduler: Scheduling Other Sessions in DSH

Introduction

DeepSeek Harness (DSH) is a plugin-centric agent development framework. When running complex workflows with DSH, a common scenario is having one agent session orchestrate another—for example, opening a new session in a project directory, sending it a message, waiting for it to finish, and then proceeding to the next step based on the result. This “session orchestration” requirement has no built-in tool in vanilla DSH; you’d have to rely on scripts or manual operations.

dsh-session-scheduler is a plugin designed for exactly this purpose. It provides a set of tools that allow any session to manage the creation, messaging, stopping, archiving, restoration, and waiting of other sessions. All operations go through DSH’s own Host service—no copying, no disk writes, no external state storage.

Plugin Positioning

dsh-session-scheduler is a “workflow” category plugin, maintained by universe-st. Its core value is enabling one DSH session to act as an orchestrator, coordinating and controlling other sessions to achieve more complex automation flows.

Core Features

The plugin provides eight tools covering session creation, messaging, stopping, archiving, restoration, waiting, and reading.

Session Listing & Lookup

sessions_list lists currently visible sessions with real-time status (running / idle / waiting-approval / waiting-question / queued). Supports filtering by directory, and locating a single session by id prefix or title. The response includes total (number of matches) and shown (rows returned on this page). When runningOnly: true, it identifies sessions that are currently active among the results.

Creating Sessions

sessions_create opens a new session in any project directory, automatically creating the directory and adding it to the corresponding workspace. You can optionally send an initial message immediately. If agentPreset is not specified, the default preset from configuration is used.

Sending Messages

sessions_send sends a message to a stopped or running session. Supports two modes:
- mode: "queue": queues the message to be sent after the current turn completes (default)
- mode: "steer": immediately interrupts the current turn and inserts the message

The sessionId parameter accepts a full id, id prefix, or session title. If the match is ambiguous, it returns an error listing all candidates to prevent sending to the wrong session.

Stopping Sessions

sessions_stop halts an in-progress turn, equivalent to the Stop button in the GUI. By default it only aborts the current turn; messages in the queue will still start new turns afterward. To fully stop and clear the queue, use dropQueue: true.

Note: You cannot stop your own session—sessions_stop targeting the calling session will return an error directly.

Archiving & Restoration

sessions_archive archives a session, hiding it from the list while preserving logs. For running sessions, you must explicitly set stopIfRunning: true. Archiving also removes any pinned status.

sessions_unarchive restores an archived session. The full id is required because archived sessions do not appear in sessions_list.

Waiting for Session Completion

sessions_wait waits for a session’s current turn to finish (completion / awaiting approval / timeout) and retrieves its last response. Default wait is 180 seconds per call, up to 600 seconds maximum; for longer waits, call again. An exception is thrown if the wait times out.

Reading Session Content

sessions_read provides read-only access to session content. Defaults to reading from the tail; at: "head" reads from the beginning; query searches for a keyword and reads forward from the match; fromSeq reads forward from a specific event sequence number. Set includeTools: true to include tool calls in the output.

Note: Reading is strictly read-only—it will not trigger the session to run or modify its queue. Context that DSH injects into sessions (memory blocks, timestamps, reminders) appears as user messages in the log and will be labeled as context:<source> in the output.

Behavioral Constraints

  • No context sharing: the scheduled session cannot see the caller’s context; messages must be self-contained.
  • Self-exclusion from listings: sessions_list hides blank sessions, sub-agent sessions, and the calling session by default.
  • Archiving hides rather than deletes: archived sessions are not in the list and can only be restored by full id.
  • Reading is paginated backward: up to 40 pages (max 300 messages per page) can be read per call. For very long sessions, “reading from the head” may only reach an intermediate position; more_before: true in the response indicates this.
  • Local and profile-scoped only: tools can only orchestrate sessions visible to the current DSH process.

Configuration

The plugin exposes four configuration fields:

Field Default Description
defaultWaitMs 180000 Wait duration when timeoutMs is not passed to sessions_wait
maxWaitMs 600000 Maximum duration for a single wait
maxTailChars 12000 Maximum character length of the returned last response
agentPreset deployment default Preset used by sessions_create when agentPreset is not specified

Installation

Requires DSH version >= 0.2.2-rc.3.

Install from the repository (local directory or git source both work; available in new sessions after restart/reload):

plugin_manager install_bundle { target: "github:universe-st/dsh-session-scheduler" }
plugin_manager install_bundle { target: "<absolute path to the cloned directory>" }

Disabling this plugin removes the tools; already-delivered messages and archived states remain unchanged.

Typical Usage

sessions_create  { cwd: "/Users/me/codes/some-project", title: "Fix build", message: "…" }
sessions_send    { sessionId: "Fix build", text: "Also pass the lint", mode: "queue" }
sessions_send    { sessionId: "session-1a2b3c4d…", text: "Hold on, wrong direction", mode: "steer" }
sessions_wait    { sessionId: "Fix build", timeoutMs: 300000 }
sessions_stop    { sessionId: "Fix build", dropQueue: true }
sessions_archive { sessionId: "Fix build" }

sessions_read    { sessionId: "Fix build", at: "tail", limit: 20 }
sessions_read    { sessionId: "Fix build", at: "head", limit: 20 }
sessions_read    { sessionId: "Fix build", query: "migration script" }
sessions_read    { sessionId: "Fix build", fromSeq: 512, context: 2 }

Use Cases

Suitable for scenarios requiring “session orchestration,” such as:
- Automatically creating sessions in a project directory to execute tasks, then waiting for completion before proceeding
- Interrupting a running session to inject new instructions
- Archiving and restoring long-running tasks
- Reading specific session content in scripts for downstream processing

Note: The plugin is scoped to the local machine and current profile—it can only orchestrate sessions visible to the current DSH process. Review the source code and license before installing.

Conclusion

dsh-session-scheduler provides DSH with foundational session orchestration capabilities, allowing one session to manage the lifecycle of another. With these tools, you can build more complex automation flows within DSH. For more information, visit the plugin directory page or the GitHub repository.

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye