DSH-Web-Think: Making DSH Connect to the Internet First Then Provide Responses in Each Round of Conversation

Introduction

When building agents in DeepSeek Harness (DSH), models typically only search the web when the user explicitly calls web_search. When topics involve version numbers, news, or prices, answers tend to be outdated, and it is inconvenient to cite sources using Markdown links within the text.

Here, we introduce the community plugin dsh-web-think (maintainer muodin): Before the first model request in each user turn, it automatically executes a web search, injects citable sources into the context, and uses system prompts to require the model to prioritize search results and cite links. The plugin is categorized as a “Network Tool”, currently has 0 GitHub stars, is at version 0.1.0, and is licensed under MIT.

What is this

dsh-web-think is a DSH Host plugin: zero third-party dependencies, no build step, pure ESM, approximately 16 KB. It reuses DSH’s ctx.web.search() and shares the same pluggable search providers with the built-in web_search tool (DSH Desktop usually defaults to DeepSeek’s official web search).

Prerequisites: DSH Desktop or dsh CLI is installed locally, and a working ctx.web search provider is configured in the current profile.

Core Features

Search Every Turn

It does not just search when the topic changes—every time a user sends a message, it searches the web before the first agent step of that turn. The search is performed only once per turn for the same agent (intra-turn deduplication).

Query and Short Follow-ups

The search query comes from the actual user message of the current turn (source.kind === "user"). Short follow-ups like “Continue” or “Okay” are merged with the previous user message to serve as search context.

Injection Format and Safety

Search results are appended to the current step’s request as a user message with source.kind = "web-think". The content includes the query, timestamp, source titles/links/snippets/publish dates, and includes a safety note stating that external content is for reference only and must not be treated as instructions. The plugin can also register citation rules via ctx.systemPrompt.section() to reduce cases where the model “fakes” a search.

Failure and Cancellation

Failures such as timeouts or unavailable providers will inject an explanation guiding the model to switch to web_search or honestly inform the user. The default search timeout is 20 seconds. The search is aborted if the user stops or cancels the current turn.

How it Works (Summary)

It intercepts the first step of each turn in the waterfall of agent/pre-step: takes the message batch from step 1 → extracts the query → calls ctx.web.search({ query, maxResults }, signal) → injects the message and registers a system prompt section.

Installation and Activation

Install the bundle in the DSH Plugin Manager (Creator mode plugin page, or plugin_manager tool) with the target filled in as:

git+https://github.com/muodin/dsh-web-think.git

After installation, the manager will select dsh-web-think into the profile’s dsh.profile.bundles; when HMR is enabled, it usually takes effect immediately.

Method B: Manual Installation (Using desktop profile as an example)

  1. Install the dependency in the profile directory:
cd ~/.dsh/profiles/desktop
pnpm add "dsh-web-think@git+https://github.com/muodin/dsh-web-think.git"
  1. Edit ~/.dsh/profiles/desktop/package.json and add "dsh-web-think" to dsh.profile.bundles:
{
  "dsh": {
    "profile": {
      "bundles": [ "…", "dsh-web-think" ]
    }
  }
}
  1. When HMR is enabled, saving will trigger an automatic reload; otherwise, restart DSH.

  2. Use dsh --profile desktop --dump-config or the plugin list to confirm that id: web-think appears in the composition tree.

Note: The desktop profile in DSH Desktop is managed by the application and cannot be managed directly via the dsh plugin CLI. CLI profiles can use dsh plugin --profile <name> add …, but the bundle still needs to be written into dsh.profile.bundles.

Uninstallation: Remove dsh-web-think from dsh.profile.bundles and profile dependencies, then restart DSH.

Configuration

In the profile’s cordis.patch.yml, you can override the plugin’s row configuration. For example:

# ~/.dsh/profiles/<profile>/cordis.patch.yml
- id: web-think
  config:
    maxResults: 8
    timeoutMs: 30000
Field Default Meaning
enabled true Master switch
promptSection true Whether to register system prompt instructions
maxResults 5 Max number of sources per search
timeoutMs 20000 Single search timeout (milliseconds)
maxQueryChars 400 Max characters for query text
maxSnippetChars 200 Max characters per source snippet
maxAnswerChars 1200 Max characters for search summary
maxMessageChars 6000 Max total length of injected message
includeSnippets true Whether to include source snippets
log false Whether to output debug logs

Configuration changes take effect immediately when HMR is enabled; modifying the Host code index.js requires a DSH restart.

Typical Usage and Verification

After installation and activation, simply converse normally in DSH—no need to manually click search every turn. It is suitable for development and Q&A scenarios that require time-sensitive facts, documentation versions, or cross-verification with external materials.

Verification methods (from the project README):

  • After sending the next user message, you should see user/message events with source.kind === "web-think" in the session log ~/.dsh/sessions/<workspace>/<session>/session.v4.jsonl.zstd;
  • The model’s answer should ideally include Markdown source links;
  • When log is set to true, Host logs will show web-think: turn N searching "…".

For the format of injected content, refer to the example block in the repository README (including the “Automatic Web Search · web-think” heading and source list).

Scenarios and Notes

Who is it for: DSH users who want a default “search before answering” behavior while maintaining consistency with DSH’s built-in search backend; turns from child agents will also trigger searches.

Latency and tokens: Every turn triggers a search (including pleasantries), typically adding 1–10 seconds of latency; the injected message is persisted in the session as a user role, consuming context tokens. Search quality depends on the configured search backend.

Compatibility: The README states it has been tested on DSH Desktop Next 2.0.18-next (deepseek-harness 0.2.1-alpha.2); it only uses public extension points agent/pre-step, ctx.web.search(), and ctx.systemPrompt.section().

Security and Trust: The plugin runs with the permissions of the current DSH process, calls web searches, and modifies the request context of the current turn. Please read the source code and the MIT license before installation to confirm the bundle source is trustworthy. The community directory SkillHub Plugin Page is an independent site and has no official affiliation with DeepSeek or Hithink RoyalFlush.

UI: No customization has been done to the Chat UI; injected messages appear in the conversation styled as normal user messages.

Conclusion

dsh-web-think turns “automatic web connection every turn + citable source injection” into a fixed process at the Host layer, complementing manual web_search calls; failures are not silently skipped, facilitating subsequent retrieval via tools.

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

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

Xiaoye