Introduction¶
DeepSeek Harness (dsh) often requires manual queuing, manual scheduling during off-peak hours, and then hunting through multiple sessions the next day to find results. dsh-night-shift (Night Shift Whale) uses a right-sidebar plugin to chain task scheduling + automated execution + result aggregation into a single pipeline: queue non-urgent tasks during the day, have them automatically executed in new sessions during DeepSeek’s off-peak half-price hours, and review completion status, changed files, and costs in the morning report.
What It Is¶
dsh-night-shift is a workflow plugin for DeepSeek Harness, developed by maintainer qinghuidaqzp. It provides two views in the dsh right sidebar: Night Shift Queue and Morning Report. During the day, you can write instructions, select a workspace or directory path in the Night Shift Queue, and have them automatically executed in new sessions at the specified off-peak time slot. The next morning, the Morning Report shows which tasks completed, which files were modified, which commands were run, how much was spent, and which steps were skipped pending human confirmation.
Core Features¶
Night Shift Queue¶
- Add Tasks: In the “Night Shift Queue” view in the right sidebar, write your instructions and an optional short title, then select a workspace or a custom directory path.
- Queue Management: Supports editing and removing queued tasks, running a single task immediately, or starting the entire queue at once.
- Scheduling Settings:
- Toggle automatic night shift on/off; customize the Beijing Time start time (default 00:30, avoiding peak hours).
- Automatically blocks peak hours (Beijing Time 09:00–12:00 and 14:00–18:00).
- Set concurrency (1–4, default serial at 1).
- Option to “pause dispatching remaining tasks before peak hours at dawn.”
- Set per-task timeout in minutes (default 30 minutes).
Morning Report¶
The Morning Report appears when you open the right sidebar the next morning:
- Top Summary Card: Savings versus peak pricing, completion count, actual cost, steps skipped pending confirmation, total changed files, command count, and token/cache-hit statistics.
- Per-Task Result Card:
- Status (Completed / Failed / Stuck or Timed Out / Cancelled).
- Summary.
- Changed files (with
+added/-removedline counts in git repos). - Executed commands (with success/failure indicators).
- Token and cost breakdown.
- List of steps skipped due to pending human confirmation.
- One-click “Open Session” to jump to the corresponding conversation.
Safety Boundaries¶
Night Shift Whale never bypasses dsh’s sandbox or approval policies, and never overrides any approval decision to allow it through:
- By default, Night Shift Whale writes
approval/policy: never(non-interactive reject mode) for each new night-shift session: - Operations permitted within the sandbox (e.g., reading/writing files in the workspace, standard test commands) execute normally.
- Any operation triggering human approval (privileged commands, sensitive tools, third-party approval plugins returning
ask) is immediately rejected by dsh — it will not silently allow it through, nor will it hang all night on a confirmation dialog just because a browser tab is left open. - All rejected steps are logged in the Morning Report’s orange alert section, specifying the exact tool/command and reason, so you can manually verify and decide whether to rerun in the morning.
- If you change
unattendedApprovalPolicytoaskin the config, it falls back to dsh’s default ask flow (fail-closed rejection when no browser is connected; if a browser is connected but no one clicks, it waits until the per-task timeout then auto-aborts and marks the task as “Stuck / Timed Out”).
Pricing Calculation¶
The plugin has built-in DeepSeek official pricing (verified 2026-11-19, unit: CNY / million tokens, off-peak hours):
| Model | Cache-Hit Input | Cache-Miss Input | Output |
|---|---|---|---|
| deepseek-flash | 0.02 | 1 | 4 |
| deepseek-v4-pro | 0.15 | 4.5 | 13.5 |
Weekday 09:00–12:00 and 14:00–18:00 (Beijing Time) are peak hours with doubled pricing (2×); all other hours and weekends are off-peak half-price. Statutory holidays are not separately modeled. You can customize prices in the plugin config prices. The plugin reads the usage block (including cache hit/miss and output tokens) from each model call via the llm/stream hook, then calculates actual cost and savings relative to peak pricing based on peak/off-peak rates.
Installation & Activation¶
Requires dsh >= 0.2.0; tested and verified on 0.2.2-rc.1.
dsh plugin --profile web add github:qinghuidaqzp/dsh-night-shift
After installation, restart dsh and select “Night Shift Whale” in the right sidebar.
Configuration¶
After installation, add the following to your dsh config file:
- id: night-shift
config:
startTime: "00:30" # Default night shift start time (Beijing Time, must be off-peak)
concurrency: 1 # Number of tasks running simultaneously (1-4)
stopBeforePeak: true # Pause dispatching remaining tasks before peak hours
taskTimeoutMinutes: 30 # Max runtime per task in minutes
unattendedApprovalPolicy: never # never (recommended, auto-reject) or ask
peakPricing: true # Calculate cost and savings using peak/off-peak pricing
prices: [] # Leave empty to use built-in DeepSeek official prices
Configuration field reference:
| Key | Default | Description |
|---|---|---|
stateFile |
night-shift/state.json under dsh home dir |
Persistence path for queue and morning report; leave empty for in-memory only |
startTime |
00:30 |
Default start time (Beijing Time HH:MM, must not fall within peak hours) |
concurrency |
1 |
Number of concurrent night-shift tasks (1–4) |
stopBeforePeak |
true |
Stop dispatching remaining queued tasks once peak hours begin |
taskTimeoutMinutes |
30 |
Per-task timeout for auto-abort (minutes) |
unattendedApprovalPolicy |
never |
Approval policy for night-shift sessions (never or ask) |
peakPricing |
true |
Whether to enable peak/off-peak pricing calculation |
prices |
[] |
Custom model price table (off-peak, CNY / million tokens) |
Implementation¶
The plugin consists of two halves: Host and Web:
- Session Creation & Scheduling: Uses
ctx.sessionController.create()(falls back toctx.agents.create()when no web controller is available) to create an independent new session for each task, callssessionTitle.rename()to prepend a🌙prefix, delivers instructions viaagent.followup()+ctx.sessions.flush(), and usesagent.whenIdle()to await completion and advance the queue based on configured concurrency. Queue, scheduling settings, and morning report are persisted atdshHomePath('night-shift', 'state.json')and survive restarts; on restart, any still-running tasks are automatically transferred to the morning report marked as interrupted. - Read-Only Observer Hooks (night-shift sessions only):
llm/stream: Reads theusageblock from each model call (including cache hit/miss and output tokens), calculates actual cost and savings relative to peak pricing using DeepSeek peak/off-peak rates.tools/pre-execute/tools/result: Read-only observation of tool calls (pre-executealways passes through withnext()), recording executed commands and modified files.session/event: Listens totool/call,approval/asked,approval/decided,assistant/message,workspace/changes,turn/end, aggregating approval rejections, final summaries, and git change line counts into the morning report.
Use Cases & Notes¶
Ideal for engineers who want to queue non-urgent tasks (writing unit tests, organizing docs, analyzing logs, running script checks, etc.) during the day and have them automatically executed during DeepSeek’s off-peak half-price hours.
Note: dsh must remain running overnight. The timer operates within the dsh Host process; if your computer goes to sleep or you exit dsh, the night’s tasks will not execute during the downtime. Verified areas include: pure-logic unit tests (peak/off-peak pricing calculation, Beijing Time scheduling validation, tool and approval parsing, state persistence and crash recovery), real dsh 0.2.2-rc.1 integration tests (independent new session creation, file writes, command execution, approval interception logging), and Web UI end-to-end tests (adding tasks, peak-time validation, immediate start, morning report rendering, “Open Session” navigation). Not yet tested: real cross-night OS sleep/wake long-duration runs, or overnight tasks using a real paid DeepSeek API key; statutory holiday schedule adjustments are not modeled. The UI is only available in the Web/Desktop right sidebar.
Conclusion¶
dsh-night-shift chains task scheduling + automated execution + result aggregation into a single pipeline: dispatch tasks during the day, execute at half-price overnight, and review the report in the morning. If you’re using DeepSeek Harness for non-urgent work, think of it as a lightweight night-shift scheduler.
- Plugin Directory: https://www.skillhub.cn/plugins/qinghuidaqzp/dsh-night-shift
- GitHub: https://github.com/qinghuidaqzp/dsh-night-shift