dsh-composer-prediction: Predictive Ghost Text for Next Message in DSH Input Box

Preface

When engaging in multi-turn conversations with agents in DeepSeek Harness (DSH), after the assistant finishes replying, you often have to think about “how to phrase the next question.” Some products use light-colored text in the empty input box to preemptively guess what you might send, allowing you to accept with Tab and dismiss with Esc. DSH itself does not come with this feature; the community plugin dsh-composer-prediction (maintainer Amir-Bazylkhanov) connects composer predictions similar to ChatGPT Composer to the Harness: every time an assistant turn ends, it uses a relatively cheap chat model to infer your next message and renders it as ghost text in the empty input box.

What is this

dsh-composer-prediction is a client-side plugin for DSH (the npm package name matches the repository name). After the assistant’s turn changes from running: true to false, it requests a prediction after a configured delay; it only displays suggestions when the input box is empty and you are not typing. It is categorized as a “Client” plugin in the SkillHub directory. The repository is MIT licensed on GitHub, and the version in the current documentation is 0.7.7, requiring a DSH engine version >=0.2.0-rc.2 <0.3.0-0.

Core Functions

The following summarizes the behavior table from the README for easy reference and usage.

Display and Shortcuts

  • Predictions are layered over the empty composer as ghost text; the overlay measures the real [data-composer-input] and clones font metrics, ensuring line breaks and height match the native input box.
  • Tab: Writes the entire suggestion into the draft but does not automatically send it.
  • Esc: Dismisses the current suggestion and prevents repeat requests for that turn.
  • Directly starting to type or attaching files: Suggestions are hidden; if the draft is cleared, they can reappear in the same turn.
  • No “Loading” placeholder: Ghost text appears when ready; failures or empty results display the reason in the input area (e.g., no prediction: no-model-route) until you type, press Esc, switch sessions, or disable the feature.

When to Request, When Not to

Scenario Result
Assistant turn ends Requests prediction after delayMs silence
Input box is not empty or user is typing No request, no display
IME composing (data-composer-composing) No request this turn and hides; retries after composing ends
Opening a session with an existing assistant reply Predicts once for the latest turn, dedup by session + turn
Switching away and back to a session Caches up to 40 sessions, restores cache immediately, no duplicate requests
Switching sessions and needing new prediction Waits for chat store switch (node list change, max 400 ms) to avoid carrying over previous session transcript
Toggling feature off then on Clears the offer and “asked” flag for the session, predicts immediately
Accept, Dismiss, new turn, feature off Discards offer, cancels in-flight requests
Late or old turn responses Discarded, cannot overwrite or revive newer offers

Model and Reasoning Cost

By default, it uses the Harness’s built-in ctx.llm, sharing the same routing and credentials as the current session (e.g., subscription routes like deepseek-account, Kimi, etc., work without separate API Keys). When provider / model are left empty, it uses the deployment default (ctx.agentDefaultModel, e.g., deepseek-flash). Reasoning effort is fixed to the model’s advertised cheapest tier (model.reasoning.efforts[0]) to avoid spending thinking budget on “guessing the next sentence”; the output default limit maxTokens is 64. It only falls back to direct HTTP via baseUrl + apiKey if there is no ctx.llm in the composition (standard DSH installations generally do not use this path).

Settings Entry

The plugin contributes to Settings → Predictions via settings.section (the built-in Plugins page is read-only; switches and details are here). The master switch syncs with enabled in composer-predict.json.

Installation and Activation

Install from npm

dsh plugin --profile <your-profile> add dsh-composer-prediction

The package declares dsh.bundle; dsh will link the package into the profile and append it to dsh.profile.bundles. Restart the application after installation (refreshing the page alone only reloads the browser side).

You can check if the layers compose successfully without launching the full app:

dsh --profile <your-profile> --dump-config

You should see the # == dsh-composer-prediction layer and the composer-predict line.

Uninstall:

dsh plugin --profile <your-profile> remove dsh-composer-prediction

Install from Local Directory

dsh plugin --profile <your-profile> add ./dsh-composer-prediction --config.auto-install-peers=false

Discover Market Index

In Plugins → Discover, enable Custom plugin markets and add the index source:

https://raw.githubusercontent.com/Amir-Bazylkhanov/dsh-composer-prediction/main/market/index.json

After publishing, you can use npm run market in the repository to regenerate market/index.json.

Configuration

Configuration is written to $DSH_HOME/composer-predict.json, merged and atomically written by the plugin host-side; it can also be edited on the Settings page.

Key Default Meaning
enabled true Master switch
provider "" Use deployment default route if empty
model "" Use deployment default model if empty
maxTokens 64 Prediction output token limit
temperature 0.8 Sampling temperature (direct HTTP only)
delayMs 0 Wait time after turn ends before predicting
maxSuggestionChars 200 Hard limit on characters for displayed suggestions
contextMessages 10 Number of trailing messages passed to the predictor
maxContextChars 6000 Transcript character budget
baseUrl https://api.deepseek.com Fallback when no harness LLM is available
apiKey "" For fallback; can come from DEEPSEEK_API_KEY or $DSH_HOME/.credentials.yaml

On prediction failure, [composer-predict] … will be output to the Settings card and browser console, rather than silently swallowing the reason.

Typical Usage

  1. Install and restart DSH, confirm it is enabled in Settings → Predictions.
  2. Complete a round of conversation with the assistant, keeping the input box empty; wait a moment (or wait the specified milliseconds if delayMs is set) for the light-colored next-sentence suggestion to appear.
  3. If the suggestion is suitable, press Tab to write it into the draft and continue editing or send; if not, press Esc or start typing to overwrite it.
  4. To get shorter or later-appearing suggestions, adjust maxSuggestionChars, delayMs; to use less context, reduce contextMessages / maxContextChars.

For development or debugging, the client exposes window.__composerPredict, allowing you to manually test the overlay in the console (README example):

__composerPredict.suggest('Add a regression test for the empty-input case.')
__composerPredict.state()

Use Cases and Notes

Suitable for: Users who engage in long-term multi-turn conversations in the DSH Web client and want to reduce pauses caused by “how to write the next sentence”; scenarios where Harness LLM routing is already configured and predictions are desired to share credentials with the main session.

Notes:

  • The plugin runs with current DSH process privileges. Before installing, please read the source code and the MIT License to confirm acceptance of its behavior (it sends the recent tail end of the conversation to the model for prediction).
  • Each prediction is still an LLM call; although reasoning tier and maxTokens are lowered by default, frequent conversations will generate additional requests; you can disable it via enabled or Settings.
  • The community directory SkillHub plugin page has no official affiliation with DeepSeek / High-Flyer; the ecosystem principle is “everything is a plugin,” and this package is an independently maintained client enhancement.

Conclusion

dsh-composer-prediction connects the chain of “assistant turn ends → guess next user message → ghost text + Tab/Esc” to DSH, with configuration and state centralized in Predictions settings and composer-predict.json. To view details, submit issues, or compare behavior tables, see the GitHub repository: https://github.com/Amir-Bazylkhanov/dsh-composer-prediction; for directory introduction, see https://www.skillhub.cn/plugins/Amir-Bazylkhanov/dsh-composer-prediction.

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

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

Xiaoye