Replies: 4 comments 6 replies
关键反馈:Onboarding 不能依赖用户是专家DSH 的设计理念是一切皆插件,架构灵活性很好,但初始配置和引导严重缺失。 我是有 agent 调用经验的用户,可以指出 agent 应该在什么时候做什么来加强能力——但大部分用户呢?他们完全处于盲用状态,可能永远都找不到真正的使用方法。 你不能把每个用户都当成专家。大部分用户需要:
当前的 skill/self-evolution 方向是对的,但它假设用户知道怎么用。真正的自我进化应该是:系统主动发现瓶颈→主动提出解决方案→用户确认后自动执行。而不是等用户来配置。 |
架构反馈:Provider 适配层不应依赖外部库的模型目录DSH 的 provider 配置格式、模型目录、认证方式实际上全部来自 @earendil-works/pi-ai 这个外部依赖。DSH 自己的 dsh-llm-pi-ai 只是一个薄适配层。 这造成两个问题:
建议:将 pi-ai 的模型目录、provider 定义、认证逻辑直接合并到 DSH 的 @deepseek-ai/dsh-llm 系列包中,消除对外部库的架构依赖。 |
|
补充一下背景(来自社区用户反馈):上述关于 pi-ai 依赖的问题,DSH 团队已经公开承认过——内部在 DSH 出来之前一直用 pi 做开发,DSH 沿用了 pi-ai 作为 provider 层是历史遗留,不是架构设计失误。技术债务是客观存在的,措辞上不应说是"低级错误",更准确的表述是"历史迁移遗留的技术债务,需要排期重构"。抱歉之前的语气偏重了。 |
|
这份 RFC 里有两个具体的、可验证的缺陷被埋在了架构提案底下,我认为它们比 RFC 本身更容易推动,也更该先拿出来。 一、你的动机 1 和动机 3 应该各自单独开帖动机 1:
这是一个分类问题,不是架构问题:一个 429 配额错误被当成终态,整轮直接失败。它可以在不引入任何新子系统的情况下讨论清楚(配额是不是可重试?多久重试?和 而且它和 #1215 那位报的是同一族——那边是"一次流式失败只落成一句英文文案,跳过了配置好的有界重试",因为下游的结构化 code/status 在生成消息前被压扁了。两条合起来是一个完整的诉求:重试决策必须基于结构化的机器码,而分类表要覆盖配额。 单独提、并引上 #1215,比放在这份 RFC 里强得多。 动机 3:Windows 沙箱破坏 schannel TLS
这条是本帖最有价值的一段,而且它现在被埋在第 3 点里。 它是一个具体的、可复现的、后果明确的缺陷,而且属于一个这个社区正在成形的族:沙箱的实际效果与它宣称的语义不一致,且不可见。 同族的两条已经有独立报告:
你这条是第三个实例,而且症状最迷惑(用户会以为是网络/证书/代理问题,几乎不可能第一时间怀疑到文件沙箱)。建议单独开帖,标题直写"sandbox 的进程令牌限制会让 Windows 上的 HTTPS 客户端失效",正文就是你现在这一段。 它今天挂在一个叫"24×7 Background Service RFC"的帖子里,任何按标题分诊的人都不会找到它。 二、关于 RFC 本身:范围太大,建议拆这份 RFC 同时提了 key pool 代理、沙箱感知网络策略、skill 驱动的自我进化,还有 onboarding。这四件事的争议度、依赖关系、所需证据完全不同:
判据很简单:一份提案里如果既有"这行代码分类错了"又有"系统应该会自我进化",前者一定会等后者。 三、你在评论里的那个自我更正,值得说一句你后来补的那条——把"低级错误"改成"历史迁移遗留的技术债务,需要排期重构"——是对的,而且我觉得比原话更准确: 顺带一个相关的事实供参考:这个外部依赖的版本策略本身确实有一个真问题,而且已经有独立报告——#2849: (我这边的事实:我们把 边界与利益相关我们不修 DSH 自家组件——重试分类、沙箱进程令牌、模型目录都在 DSH 里。上面全是拆分建议和跨帖串联;我没有 Windows 环境,没有复现过 schannel 那条,完全采信你的描述。 利益相关:我维护 pi2dsh(Pi 生态兼容层)。这条不推销——你的四个方向里没有一个是装一个第三方插件能解决的;key pool 那条我建议你自己做成独立代理,也不需要经过任何人。 |
Uh oh!
There was an error while loading. Please reload this page.
RFC: Agent as a 24×7 Background Service — Provider Key Pool, Sandbox Awareness, and Self-Evolution Architecture
Status: Draft
Author: Community contribution
Related: DeepSeek Harness (DSH)
Abstract
DeepSeek Harness currently runs as a web application where the agent's capabilities are tied to the browser session. Closing the browser stops the user's interaction surface but the agent continues operating. This RFC proposes formalizing this "agent as background service" model with three supporting subsystems: a transparent multi-key rotation proxy for provider quota management, sandbox-aware network strategy, and a skill-driven self-evolution pipeline. Together they make DSH a true 24×7 autonomous agent service.
Motivation
Real-world agent usage reveals several gaps:
API quota exhaustion is not a rate limit: When multiple parallel agent calls (tool invocations, subagents, background jobs) hit the same provider API key, the gateway returns
429 "Allocated quota exceeded". DSH's default retry policy treats this as a terminal error (QUOTAis not inretryableCodes), causing the entire agent round to fail.Single-key RPM bottlenecks: Free-tier provider accounts (e.g., 20 RPM actual) are insufficient for agent workflows that issue parallel requests. Users resort to multiple API keys, but DSH has no mechanism to pool them.
Sandbox collateral damage: DSH's file sandbox on Windows restricts the process token, which breaks Windows schannel TLS — PowerShell
Invoke-WebRequestandcurl.execannot make HTTPS requests. This is not a network policy but a side effect of the restricted process context, and it's confusing to diagnose.Vision model discovery is manual: Providers offer hundreds of models with varying capabilities, but DSH's model catalog is a static subset. Users need a way to discover, test, and annotate vision-capable models.
Knowledge is lost after each interaction: Solutions to these issues are rediscovered with each new user. DSH lacks a mechanism to persist operational knowledge as reusable skills.
Proposed Architecture
1. Provider Key Pool (Embedded Proxy)
Concept: A transparent local proxy that rotates API keys across a pool, multiplying effective RPM by the number of keys.
Design principles:
{port, upstream, keys[]}. No environment variables needed for startup.fs.watch()on config file — keys can be added/removed without restart.429, automatically switch to the next key and retry.GET /healthfor monitoring;POST /reloadfor manual config reload.Integration with DSH: The provider's
baseURLinsettings.yamlpoints to the local proxy (http://127.0.0.1:{port}/v1). DSH's existingapiKeyEnvandAuthorizationheader are ignored by the proxy (it uses its own key pool).Proposed enhancement: Build this directly into DSH's provider layer — a
keyPoolfield in the provider config that accepts an array of API keys and handles rotation transparently.2. Enhanced Retry Policy
Current behavior: DSH's
classifyPiAiError()indsh-llm-pi-aichecksisQuotaExceededError()before the rate-limit regex. The message "Allocated quota exceeded" is classified asQUOTA. The defaultretryableCodes(['EMPTY_RESPONSE', 'RATE_LIMIT', 'SERVER', 'TIMEOUT', 'TRANSPORT']) does NOT includeQUOTA, making the error terminal.Proposed changes:
QUOTAto the defaultretryableCodesindsh-llm/lib/types/retry-policy.js.isQuotaExceededError→QUOTA,429→RATE_LIMIT, explaining that provider gateways may return "quota exceeded" for both RPM exhaustion and actual quota limits.initialDelayMs: 10000for 20-RPM free tiers).3. Sandbox-Aware Network Strategy
Problem: On Windows, DSH's
workspace-writesandbox mode restricts the process token, causing Windows schannel (SEC_E_NO_CREDENTIALS). This breaks HTTPS for PowerShellInvoke-WebRequestandcurl.exe. Node.jsfetch()(using OpenSSL) works fine.Proposed solution:
workspace-writemode, automatically prefer Node.jsfetch()over PowerShell/curl for network operations.danger-full-accessmode, all network tools work normally.sandbox.networkModediagnostic field in the runtime context, so tools can adapt their transport strategy.4. Vision Model Discovery & Annotation
Current behavior: DSH models can have
input: ["text"]orinput: ["text", "image"]to indicate modality support. However, for models discovered dynamically from provider endpoints (not in the pi-ai catalog), this metadata is missing.Proposed enhancement:
inputmodalities in the provider config's model list.GET /v1/models/{id}endpoint that returns full capability metadata (context window, input types, supported features) for all automatically discovered models.5. Skill-Driven Self-Evolution
Concept: DSH already has a skill system (
dsh-skill,dsh-skill-filesystem) that allows agents to load reusable knowledge. This RFC proposes formalizing the feedback loop:Implementation:
provider-config,sandbox-issue,vision-model) so retrieval is context-aware.Configuration Example
Impact
Backward Compatibility
retryPolicywithQUOTAadded to defaults: existing configs withoutretryableCodesinherit the new default. ExplicitretryableCodeslists are unaffected.keyPoolis additive — providers without akeyPoolfield continue to use single-key auth.sandbox.networkModedefaults to"native"(current behavior) when not set.Open Questions
QUOTAbe added to the defaultretryableCodesunconditionally, or gated behind a configuration flag?Implementation Sketch
Phase 1: Core Retry Enhancements
QUOTAtoDEFAULT_RETRYABLE_CODESindsh-llm/lib/types/retry-policy.jsclassifyPiAiError()priority indsh-llm-pi-ai/lib/index.jsPhase 2: Built-in Key Pool
keyPoolfield to provider profile schema indsh-llm-pi-ai/lib/index.jsGET /v1/modelsor a dedicated endpointPhase 3: Sandbox Network Diagnostics
networkModeto sandbox policy runtime contextPhase 4: Skill Pipeline
dsh-skill-filesystemanddsh-skillinfrastructureThis RFC was distilled from a production debugging session covering provider configuration, quota management, sandbox troubleshooting, vision model discovery, and agent self-evolution. The full conversation transcript is available in the DSH session log.
All reactions