Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,17 @@

## 引言

DeepSeek Harness 自动调用工具并连续作答,虽然有插话发送但是 DeepSeek 输出太快了,拼尽全力也没有其百分之一的 tok/s,根本无法成功插话。而直接打断 DeepSeek 的输出会导致其变得胆小,甚至不再调用工具,感觉就差哭出来了。
DeepSeek Harness 会自动调用工具并连续作答,虽然可以使用插话发送在中途提示,但是 DeepSeek 输出太快了,拼尽全力也没有其百分之一的 tok/s,根本无法成功插话。而直接打断 DeepSeek 的输出会导致其变成胆小菇,甚至不愿继续执行命令,工作积极性大幅下降。

此插件使用了拔网线的力量,直接阻止 DeepSeek 发出下一次请求,直到你按下 Enter 或点按钮放行。暂停期间 composer 输入框照常可打字并插话发送后自动继续,或者直接回车让模型无感继续。
为了能够成功在 DeepSeek 下一轮调用前插话并保护其弱小的心灵,此插件使用了拔网线的力量,假装卡了阻止 DeepSeek 发出下一次请求,直到你按下 Enter 或点按钮放行。暂停期间输入框照常可打字并插话发送后自动继续,或者直接回车让模型继续,这样在模型侧不会察觉到暂停的存在。

恰巧做完这个插件后,`deepseek-v4.1-flash-expires-on-0910` 速度已经到 300~400 tok/s,这下拼尽全力也追不上其百分之一的 tok/s,只能使用盘外招了。

注:现 deepseek-v4-flash 的速度约为 100 tok/s,而其一个中文字符约为 0.6 token,其百分之一的速度为 100 字/分钟,你的打字速度如何?

## 关键词

暂停 · 插话 · 无感

## 功能

Expand Down Expand Up @@ -75,6 +83,7 @@ dsh 把一次模型请求当作一个 step,agent 连续调用工具时会经
- 续跑判定用同一 turn 内 step 大于 1 近似,首条纯文字请求永不暂停。
- 浏览器端经 `conversation.input.right` 槽位在 composer 工具行渲染控件。
- 因 dsh 的 composer Enter 由 InputBar 私有 keymap 处理、第三方无 hook 点,暂停态用 DOM capture 拦截裸 Enter 改走放行,不改 DSH 源码。
- 主机侧不经 `ctx.connection.rpc.handle`:该 API 自 0.1.2 起即不可用,改为向 webServer 自注册 `/dsh-pause` 前缀路由,复用 connection 的信任判定与浏览器鉴权,信封格式与官方一致。

## 开发

Expand Down
Binary file modified docs/暂停.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
},
"devDependencies": {
"@deepseek-ai/cordis": ">=4.0.0",
"@deepseek-ai/dsh-client-connection": "0.1.2-rc.1",
"@deepseek-ai/dsh-client-connection": "0.1.5-rc.2",
"@deepseek-ai/dsh-client-runtime": "0.1.1-rc.2",
"@deepseek-ai/dsh-client-ui-conversation": "0.1.2-rc.1",
"@deepseek-ai/dsh-client-ui-slots": "0.1.2-rc.1",
Expand Down
57 changes: 33 additions & 24 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions src/client/PauseBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
* @module dsh-pause/client
*/
import { memo, useEffect, useRef, useState } from 'react'
import type { ReactElement } from 'react'
import type { SnapshotSelectorHook } from '@deepseek-ai/dsh-client-ui-slots'
import type { InputActions, InputState } from '@deepseek-ai/dsh-client-ui-conversation/client'

Expand Down Expand Up @@ -81,6 +82,18 @@ async function releaseAndClear(
}
}

/**
* 暂停图标:两条竖线,单色 currentColor 跟随主题。
*/
function PauseIcon(): ReactElement {
return (
<svg viewBox="0 0 16 16" width={12} height={12} fill="currentColor" aria-hidden="true" style={{ flex: 'none' }}>
<rect x={3.6} y={2.4} width={3.4} height={11.2} rx={1.2} />
<rect x={9} y={2.4} width={3.4} height={11.2} rx={1.2} />
</svg>
)
}

/**
* 暂停控件。暂停态挂 document capture 拦截裸 Enter,落点在本 composer 卡内时改为放行。
*/
Expand Down Expand Up @@ -173,8 +186,12 @@ export const PauseControl = memo(function PauseControl({
padding: '1px 8px',
fontSize: '12px',
lineHeight: '18px',
display: 'inline-flex',
alignItems: 'center',
gap: '4px',
}}
>
<PauseIcon />
{enabled ? '暂停开' : '暂停'}
</button>
{paused && (
Expand Down
Loading
Loading