跳到主内容

dsh-jobs-local/packages/jobs/jobs-local官方

175.3kStar19.0kFork0Issue752Watching

提供进程内存中的后台作业注册表实现,作为 ctx.jobs 插件加载,支持每所有者最多10个并发作业,适用于需要在单进程内管理后台任务并与 dsh-tool-jobs 配合使用的 agent 开发

机审证据3/5方法论数据来源安装命令持续维护DSH 版本风险扫描
机审证据安装命令仓库已核验dsh-plugin Topic许可证READMEAI 百科

ⓘ 此插件是大仓库 deepseek-ai/deepseek-harness 的子包,星数与活跃度统计的是整个仓库。

语言
TypeScript
License
MIT
分支
master
ai-agentscordisdshdsh-plugin

安装

命令web profile
$ dsh plugin --profile web add npm:@deepseek-ai/dsh-jobs-local

在终端中运行以上命令,通过 dsh CLI 安装此插件。可在右上角切换 Profile。 第一次用 dsh?看这篇新手教程

对话式安装

帮我安装 DeepSeek Harness 插件 deepseek-ai/deepseek-harness/packages/jobs/jobs-local:先查看仓库 https://github.com/deepseek-ai/deepseek-harness 确认安全性,然后执行安装命令并验证插件加载成功。

把这段指令粘贴给 DSH Web GUI 里的助手,由它代你完成安装与验证。

English | 中文

Process-local implementation of the @deepseek-ai/dsh-jobs registry contract: LocalJobRegistry keeps every record in memory, issues per-kind <kind>-N ids, and hands out fresh snapshots, never live state. Load it as a plugin and it registers as ctx.jobs.

Admission

maxConcurrentJobsPerOwner is a positive safe integer and defaults to 10. Before invoking a producer, start() counts the exact owner's running and stopping records; all unowned jobs share one separate service bucket. Terminal history does not occupy capacity, and only producer done settlement releases a stopping job's place.

At capacity, start() fails before producer execution and id allocation with an error that names the limit and tells the model to use job_kill, wait for the job to finish stopping, and retry. The registry does not queue, preempt, or maintain a second mutable counter.

Lifecycle

Jobs belong to their owner and backend, not the producer tool fiber, so producer and controller reloads do not stop them. The first job for an owner attaches one awaited effect to the exact Agent scope. Owner disposal cancels that object's jobs, awaits producer quiescence, and removes their snapshots; reused agent or session ids cannot redirect an old cleanup.

Service disposal closes listeners, cancels all live jobs, awaits their records, and detaches effects from surviving owner scopes. If teardown cancellation throws, the service force-fails the record and warns that work may be orphaned instead of deadlocking. A cancellation that returns but never settles done remains indistinguishable from a slow stop and can stall teardown.

Settlement is first-wins: the earliest terminal outcome — producer settlement, a rejected done contained as failed, or a teardown force-failure — records once, releases waiters, and notifies listeners once with per-listener containment. Pending waits mark the job reported before listeners run so completion reporters do not duplicate notices, and a teardown cancel marks it for the same reason: nothing will read a notice addressed to an owner being destroyed. Completion is the last thing a settlement announces, after the record is committed and the visible-set change is published, because a reporter may open a model turn synchronously and every other observer must already have seen the settled record.

Controllers and listeners are layered by the scope that registered them, in the tools-registry shape: a registration files into its registering context's scope, and a read unions the global layer with the owner's scope chain. One process-wide registry therefore answers per-owner questions per owner — start() refuses background jobs unavailable: no job controller serves this agent (load @deepseek-ai/dsh-tool-jobs in its composition) for an owner whose own composition attaches none, however many other compositions attach theirs, and a settlement reaches only the listeners its owner's composition registered.

Model Experience

Indirectly, through producer plugins and dsh-tool-jobs, which render job ids, output, status, cancellation, and completion notices.

KV Cache effect

No direct invalidation; the named consumer owns any request-prefix changes.

Known Limitations and Deferred Work

  • Jobs are process-local — records die with the harness process; durable or cross-restart execution needs a separate backend implementing the seam.
  • A silently ineffective cancel can stall teardown and hold capacity — if cancel returns without settling done, the registry cannot distinguish it from a slow stop; the job keeps one bucket slot for the rest of the service lifetime, and only an explicit throw can be force-failed safely.

查看使用指南 →

该插件的安装步骤、关键要点、FAQ 与兼容性说明(基于已收录字段派生)。

收录徽章

Listed on deepseek-plugin.org
[![Listed on deepseek-plugin.org](https://img.shields.io/badge/listed_on-deepseek--plugin.org-007EC6)](https://deepseek-plugin.org/plugins/deepseek-ai/deepseek-harness/packages/jobs/jobs-local)

把这段 markdown 粘贴到你的 GitHub README,链接回本插件详情页。徽章只声明已被本站收录,不代表安全认证。

返回插件目录