DSH HUB
首页插件商店插件包社区排行榜资源发布指南
插件源码
返回插件目录

Steven-Qiang /

Steven-Qiang/dsh-fs-search-timeout

已验证

DeepSeek Harness plugin that puts a wall-clock budget on glob and grep: a search that runs over it is cancelled, and the agent is told to narrow its path, pattern and include.

★ 0 Stars0 Forks0 IssuesN/A 社区评分0 已确认安装
查看 GitHub
README来源: main@ffec8730

dsh-fs-search-timeout

npm release license

English | 简体中文

DeepSeek Harness plugin that puts a user-set time budget on glob and grep. A search that runs over the budget is cancelled on the spot, and the model receives an error that says how to narrow the next call — instead of waiting out the built-in 30-second limit and getting a bare tool call timed out after 30000ms.

It exists for one familiar failure: the agent starts a recursive search from a multi-repository root, walks node_modules / dist / vendor, and burns a full tool budget every single time.

What the model sees

At the deadline the tool result is replaced with:

Error: grep exceeded its 8000ms budget and was cancelled before it finished.
This call — path: ~/code/monorepo; pattern: foo; include: *.ts
Retrying it unchanged will time out again. Narrow the call first:
- set `path` to ONE project or one subdirectory — not a workspace root that holds several repositories
- add `include` (for example "*.go" or "*.{ts,vue}") and tighten `pattern`
- resolve symbols and call chains from a code index instead of scanning text

error.info is { name: 'SearchTimeoutError', code: 'SEARCH_TIMEOUT' }, so another plugin can branch on the code.

Configuration

Every field may be omitted; the schema fills the defaults below.

- id: fs-search-timeout
  name: 'dsh-fs-search-timeout'
  config:
    enabled: true        # time searches at all
    timeoutMs: 8000      # shared budget in ms
    perToolTimeoutMs: {} # per-tool budget map, e.g. { glob: 3000 }; 0 or absent follows timeoutMs
    tools: [glob, grep]  # which tools are watched
    notice: ''           # reminder for the model; empty uses the built-in one

Keep the budget below @deepseek-ai/dsh-tool-fs-search's own timeoutMs (default 30000), otherwise the built-in timeout-policy fires first and its generic message wins.

From the UI

The bundle ships a configuration page. Open Plugins, select dsh-fs-search-timeout, then Configure on its fs-search-timeout row: glob and grep are checkboxes, another tool is added by name and shown as a removable tag. The budget section lists one switch per watched tool — switch a tool on to give it its own budget, leave it off to inherit the shared one. Saving writes through the Host settings service and applies to the next tool call — no reload, no restart.

Values typed into cordis.patch.yml are the base layer; a value saved from the page is stored as the profile override of that row and takes precedence.

How it works

One tools/execute wrapper swaps exec.signal for a derived signal carrying a deadline, then restores the caller's signal in a finally, so tools/post-execute listeners never see this plugin's signal.

  • Deadline reached → the derived signal aborts; glob / grep hand that signal to the subprocess seam, the ripgrep process tree is killed, the call settles, and the result above replaces the tool's own cancellation.
  • The caller cancels (turn stopped, parent call) → the derived signal aborts too, but the result is left alone rather than being reported as a search budget timeout.

Install

In DSH, open Plugins → Add plugin and enter one of:

What you have What to enter
the npm package dsh-fs-search-timeout
the GitHub repository https://github.com/Steven-Qiang/dsh-fs-search-timeout
a local checkout the absolute path of that directory

An agent holding the plugin manager tool performs the same install:

plugin_manager action: install_bundle target: dsh-fs-search-timeout

Requires DSH's glob / grep tools (@deepseek-ai/dsh-tool-fs-search) and the tools/execute event; without either one the plugin has nothing to wrap.

Reload after editing code or configuration, no restart needed:

plugin_manager action: set_plugin target: include:fs-search-timeout enabled: false
plugin_manager action: set_plugin target: include:fs-search-timeout enabled: true

Uninstall: plugin_manager action: remove_bundle target: dsh-fs-search-timeout.

Known gaps

  • Cooperative cancellation: it notifies through exec.signal, so the tool must honour it. glob / grep do; any other tool added to tools needs that checked first.
  • Watched tools only: glob and grep by default. A hand-rolled rg inside shell is out of scope — that is what a shell guard such as dsh-pwsh-guard is for.
  • The built-in 30-second limit still exists: it belongs to tool-fs-search's own timeoutMs; this plugin only fires earlier.
  • No generic configuration form: current DSH ships the settings-form machinery but no shipped client renders autoGenerate pages, so this bundle registers its own page in plugins.row.config. A deployment without the settings service (@deepseek-ai/dsh-settings) shows the page unavailable.

Development

npm test

Builds with tsdown, then runs 10 assertions: cancellation at the deadline, pass-through inside the budget, unlisted tools untouched, caller cancellation not misreported, a tool's own throw preserved, a disabled row passing calls through, config normalization (defaults, per-tool budgets, volatile refs, invalid values), a custom notice, and the result shape.

Contributing

Commits follow Conventional Commits, and the release workflow derives the package version from them, so version in package.json is not bumped by hand. Issues and pull requests are welcome.

License

MIT

—/ 5

暂无评分

已验证 DSH bundle

Commit ffec87305518

社区评论

还没有评论,来写第一条。

DSH HUB

社区维护的 DSH 插件索引。不是 GitHub 或 DeepSeek AI 的官方产品。

社区资源API关于