Commit Graph
2888 Commits
Author SHA1 Message Date
imccyu bbe00b0db2 feat(locale): allow external language registration 2026-08-25 20:40:26 +08:00
creatixchu e497ea69b1 Merge remote-tracking branch 'origin/master' into worktree/2848-image-token-pressure 2026-08-25 19:56:17 +08:00
ZiyaandZiyaZhang b565df3442 feat(web): show exact per-turn token usage (#3005)
* feat(web): show exact per-turn token usage

* test(runtime): refresh exact token usage snapshots

* refactor(token-meter): own per-turn usage folding

* perf(ui-chat): bound paging anchor layout reads

* test(web): align usage golden with system prompt row

* fix(test): resolve token-meter client from source

* test(token-meter): cover retry without usage

---------

Co-authored-by: ZiyaZhang <199893125+ZiyaZhang@users.noreply.github.com>
2026-08-25 19:05:52 +08:00
lsdsjy 5c98d5ece8 fix(fs): tolerate null editor placeholders 2026-08-25 18:28:09 +08:00
Dudu-0223 560729be76 ci(windows): serialize native test files 2026-08-25 18:12:03 +08:00
creatixchu 771311eb6f Merge remote-tracking branch 'origin/master' into worktree/2848-image-token-pressure 2026-08-25 17:03:42 +08:00
Chinesezjc ac2f00070e ci(windows): make windows-coverage temporarily non-blocking
Other PRs are blocked by Windows ACP half-close tests timing out. Keep the
coverage job running for signal, but remove it from all-checks-passed.needs
until the Windows skip fix is validated.
2026-08-25 17:02:16 +08:00
creatixchu eea65e5275 Merge remote-tracking branch 'origin/master' into worktree/2848-image-token-pressure 2026-08-25 15:52:17 +08:00
imccyu a1781cc4a8 Merge pull request #3054 from deepseek-harness/worktree-revert2698
revert(session): remove streaming format migration pipeline
2026-08-25 15:47:19 +08:00
07akioni e5dbb368cd Merge pull request #2631 from deepseek-harness/worktree/fix-web-chat-system-prompt
fix(web): show system prompts in chat
2026-08-25 15:41:43 +08:00
imccyu 211e6939e3 Revert "Merge pull request #2698 from deepseek-harness/xtr/session-format-migration"
This reverts commit 4b592eb90df20dc53dd12215921d5a9137214777, reversing
changes made to d15d3275d905e4d21229cd70a074388a428189d1.
2026-08-25 15:30:10 +08:00
creatixchu bb03d8e305 Merge remote-tracking branch 'origin/master' into worktree/2848-image-token-pressure 2026-08-25 15:24:43 +08:00
Chinesezjc 5e3c04276e Merge pull request #3042 from deepseek-harness/test/windows-coverage-4-partitions
test(windows): lower coverage partitions 8->4 to reduce worker startup pressure
2026-08-25 15:22:39 +08:00
07akioni 61b65d3147 fix(web): show system prompts in chat
Render reconstructable system prompts at each request-series boundary, preserve series declarations through pre-step wrappers, and keep the presentation and replay snapshots aligned across clients.
2026-08-25 14:44:08 +08:00
creatixchu 0d9bdccb7b Merge remote-tracking branch 'origin/master' into worktree/2848-image-token-pressure 2026-08-25 14:03:24 +08:00
creatixchu bcdbd85d15 Merge remote-tracking branch 'origin/master' into worktree/2848-image-token-pressure 2026-08-25 13:43:45 +08:00
_Kerman 2664200844 Merge remote-tracking branch 'github/master' into xtr/session-format-migration 2026-08-25 13:04:23 +08:00
Chinesezjc 58cc29b4f1 test(windows): split native job into build/coverage/native-tests/observational
Keep the 4-partition coverage profile, split the monolithic windows-native
job into smaller required jobs (build, coverage, native-tests) plus a
non-blocking observational job. Update ci-workflow.spec for the new topology.
2026-08-25 12:45:47 +08:00
_Kerman d385dfb3e3 Merge remote-tracking branch 'github/master' into xtr/session-format-migration
# Conflicts:
#	docs/config-catalog.i18n.yaml
#	docs/config-catalog.md
#	docs/config-catalog.zh.md
#	packages/session/session-persistence-jsonl/src/index.ts
#	packages/session/session-persistence/src/coordinator.ts
#	packages/session/session-persistence/src/index.ts
2026-08-25 12:41:23 +08:00
Tianyi Cui aa801a418a test(python): share advanced runtime profile patch 2026-08-25 12:21:51 +08:00
creatixchu 1c065f3cd4 Merge remote-tracking branch 'origin/master' into worktree/2848-image-token-pressure
# Conflicts:
#	apps/cli/tests/profiles/acp/image-compaction.cordis.snapshot.yml
#	apps/cli/tests/profiles/acp/image-compaction.cordis.yml
#	apps/cli/tests/profiles/acp/tests/snapshots/image-compaction/input.json
#	apps/cli/tests/profiles/acp/tests/snapshots/image-compaction/session.jsonl
#	apps/cli/tests/profiles/acp/tests/snapshots/image-compaction/stdout.expected.jsonl
#	docs/config-catalog.i18n.yaml
#	docs/config-catalog.md
#	docs/config-catalog.zh.md
#	examples/acp-agent/tests/acp.snapshot.ts
#	packages/llm/token-meter/README.i18n.yaml
#	packages/llm/token-meter/README.md
#	packages/llm/token-meter/README.zh.md
#	packages/llm/token-meter/src/index.ts
#	packages/llm/token-meter/src/surface-fold.ts
2026-08-25 11:15:35 +08:00
imccyu 1229292497 docs(session): refresh architecture and generated contracts 2026-08-25 06:10:25 +08:00
Tianyi Cui 97f9e2e402 fix(ci): serialize native Windows coverage after build 2026-08-24 22:36:02 +08:00
Tianyi Cui 3b090c3c1b fix(test): declare Loader fixture dependencies 2026-08-24 22:02:44 +08:00
Tianyi Cui 4125514a08 refactor(repo): retire top-level examples 2026-08-24 22:02:44 +08:00
Tianyi Cui 6ea8a52e22 fix(test): harden snapshot corpus invariants 2026-08-24 21:37:57 +08:00
Tianyi Cui caf386f59c fix(test): use expected-output naming 2026-08-24 21:37:14 +08:00
Tianyi Cui 1cfe0f9942 refactor(test): reserve snapshots for session recordings 2026-08-24 21:37:14 +08:00
Tianyi Cui d4e81b6af7 test(snapshot): verify final workspace state 2026-08-24 21:37:14 +08:00
Tianyi Cui 6ca682733f refactor(test): drive sessions through owning profiles 2026-08-24 21:37:13 +08:00
Tianyi Cui 5c67cf898c test(snapshot): centralize ACP session corpus 2026-08-24 21:36:31 +08:00
Tianyi Cui 30762b63c9 refactor(test): make session snapshots transport neutral 2026-08-24 21:36:31 +08:00
imccyu 9c3a0893f6 perf(client-modules): defer per-plugin revision hashing
Preserve sourcemaps through the production Client build and verify batched loading across Host, HMR, and Web Worker paths.
2026-08-24 20:49:13 +08:00
lsdsjy 5bbaf168d9 perf(client-modules): batch startup plugin scripts 2026-08-24 20:48:12 +08:00
imccyu 82aa8906e5 Merge pull request #2905 from deepseek-harness/turtle/local-build-banner-version
Show build version in local Web banner
2026-08-24 20:46:43 +08:00
creatixchu 9f2ba9f5aa Merge origin/master (regenerate config catalog) 2026-08-24 19:51:16 +08:00
creatixchu 42164508c8 feat(llm): 在 compaction 中按路由为图片请求压力计价
Closes #2848.

- dsh-llm 新增 LlmAdapter.imageRequestPricing 同步钩子与 LlmImageRequestPricing/LlmImageRequestPrice 词汇,ctx.llm 按路由解析
- llm-deepseek 用官方公布的 v4 视觉计算器逐句移植(14px patch、3:1 降采样、384 上限、最坏对齐 pad)实现该钩子,复现请求投影的最旧优先 offload 与像素预算缩放;纯几何 requestImageDimensions 上移到 dsh-attachment
- token-meter 表层 fold 存储与路由无关的节点事实,measure() 按生效 envelope 的路由为图片出现处定价;锚点存快照并按同一路由重定价;TokenSurfaceNode 同时携带路由价 tokens 与固定启发式 heuristicTokens
- compaction 触发、保留与选段读取同一套路由价,记录的 shadowedTokenCount 保持启发式以维持 O(1) 投影 fold 一致
- llm-replay 支持按模型的 imageRequestTokens 声明;新增 keyless 的 image-compaction ACP 快照场景端到端验证装配应用
2026-08-24 19:15:30 +08:00
Tianyi Cui 8101a0d097 fix(python): make Windows release paths native
Run the GitHub Windows runtime leg under the runner’s native PowerShell instead of inheriting the POSIX Bash body. POSIX and Windows now own explicit output resolution, virtual-environment setup, environment scrubbing, and keyless/live black-box commands, while portable build commands continue to use each runner’s default shell.

Put the pinned uv installation on the GitLab Windows job PATH before either the smoke or release builder invokes it. Reject a runtime executable whose basename does not match the selected platform manifest, and reject Intel macOS at platform selection instead of reporting a misleading missing artifact.

Add a complete PowerShell path to the published Python tutorial and record the three-phase shutdown-time bound in the Windows runtime decision. Workflow, Python, and bilingual documentation tests pin the resulting behavior.
2026-08-24 19:09:40 +08:00
Tianyi Cui 026a37fc07 ci(python): gate the Windows x64 installed wheel
Add node24-win-x64 to the required pull-request and public-release matrices on a native windows-2025 runner, and publish the same win_amd64 artifact from the GitLab tag pipeline. GitHub uses Git Bash for the shared release script while selecting the Windows venv's Scripts/python.exe explicitly; the Linux and macOS legs retain their existing commands and native checks.

Run the complete installed-wheel keyless suite and the trusted two-turn DeepSeek smoke on Windows exactly as on the existing targets. Make the minimal blackbox choose persistent PowerShell on Windows, keep advanced and restart snapshots platform-stable by disabling both one-shot shell variants, locate the generated dsh.exe console command, and validate text lines without assuming POSIX newlines.

Workflow tests pin the four-target matrix, Windows runner and wheel tag, cross-platform venv selection, GitLab publication dependency, and full blackbox invocation. The existing POSIX minimal snapshot changes only its platform-neutral prompt wording; Windows owns a separate model-visible snapshot.
2026-08-24 19:09:40 +08:00
Tianyi Cui ca0b21661e feat(python-runtime): package the Windows x64 dsh executable
Add node24-win-x64 as the only supported Windows runtime target and publish it as a py3-none-win_amd64 wheel containing the conventional dsh and ripgrep .exe payload names. Keep Windows ARM64 rejected explicitly so Python cannot claim a carrier that CI and release automation do not build.

Teach the pkg builder to require a native x64 Windows host, validate both node-pty ConPTY addons, copy @vscode's win32 ripgrep executable, and recognize pkg's .exe output. Extend runtime resolution, wheel staging, payload validation, and the preset closure check so the Windows-specific PowerShell plugins and sidecars fail loud when omitted.

The sidecar resolver now maps a packaged main.exe to main-rg.exe; focused TypeScript and Python tests cover that name, the win_amd64 manifest, x64-only host selection, complete wheel payload, ConPTY inventory, and platform-conditioned plugin closure.
2026-08-24 19:09:40 +08:00
Dudu-0223 f76a225a7d Merge pull request #2663 from deepseek-harness/feat/subagent-provider
让 subagent 按需发现并选择子 Agent 模型
2026-08-24 18:23:42 +08:00
Tianyi Cui e2920f0109 fix(sdk-minimal): make the SDK model argument authoritative
Stop narrowing the standalone DeepSeek adapter to a DSH_MODEL-derived one-entry catalog. The direct adapter already accepts model ids outside its advisory catalog, so retain only the DSH_CONTEXT_WINDOW fallback and let the JSON-RPC initialize model be the single runtime selection.

Remove model mirroring from minimal.py and the packaged smoke. The keyless process now initializes deepseek-v4-pro without DSH_MODEL, while the packaged scenario continues to use its unlisted smoke-model; together they prove both cataloged and arbitrary SDK model arguments reach the adapter directly.

Update the bundle, tutorial, SDK/example references, and owning Agent Notes to keep DSH_MODEL only as minimal.py's optional default input, never as a second value callers must synchronize.
2026-08-24 17:28:29 +08:00
Tianyi Cui 7a11f5fde3 docs(python): define the standalone minimal profile
Record sdk-minimal as the narrow repository-owned exception to base-first profile composition: callers still launch only dsh and cannot provide an arbitrary Cordis tree, while the shipped bundle may own a complete explicit roster. Cross-link the launcher, profile-bundle, Python-runtime, minimal-agent, snapshot, and telemetry decisions; the supersession audit keeps each older note active because its remaining rationale is independent.

Update the CLI, architecture, Python tutorial/reference, example, runtime-wheel reference, and bundle documentation. The docs distinguish the full sdk profile from sdk-minimal, explain explicit-home/plugin/patch customization, state the minimal permission and persistence choices, and retain the separately packaged web profile and frontend assets for direct dsh use.

Correct dsh-base descriptions to cover base-backed profiles, make SDK startup configuration visible in the generated config catalog, add sdk-minimal to the module graph, and regenerate the base-composition graph. English and Chinese pairs are re-recorded at the exact reviewed contents.
2026-08-24 17:28:29 +08:00
Tianyi Cui 79a8f667f7 refactor(python): launch the minimal example through sdk-minimal
Make minimal.py select the shipped sdk-minimal profile directly and pass its selected model into the profile-owned adapter catalog. The Python SDK still starts only the bundled dsh CLI with an explicit Harness home; it no longer supplies an invocation overlay for this mode.

Drive both the source keyless process test and installed-wheel smoke through the same named profile. The keyless test pins the generated profile manifest and exact two-tool model request, while the packaged smoke keeps the persistent-shell, editor, session-log, and model-visible snapshot evidence.

Delete minimal.patch.yml and the unused complete-config/replay fixtures. Their composition now has one owner in @deepseek-ai/dsh-sdk-minimal, so the example and tests cannot drift into separate launch trees.
2026-08-24 17:28:28 +08:00
Tianyi Cui c2ad69344f fix(python-sdk): make the minimal profile an explicit allowlist
Give the SDK JSON-RPC server a per-root tool filter and let deployments mark the configured persona as the complete system prompt. The checked-in minimal overlay now names only bash and str_replace_editor, so later global tools and unrelated guidance from dsh-base cannot appear implicitly.

Keep the shared SDK host services and packaged Web capability intact. Only workspace instructions, compaction, and the conflicting one-shot Bash row remain disabled. Unit coverage pins the configuration paths, and a real dsh profile smoke proves the assembled prompt and exact two-tool request.
2026-08-24 17:28:28 +08:00
Tianyi Cui 9edf1b9f10 fix(python-sdk): harden profile runtime startup
Resolve packaged profile proxies with Node ESM import conditions from each package installation, and fail loud when an explicit runtime export or legacy main entry is missing. Serialize the shared profile fallback under the existing cross-process writer lock so concurrent dsh processes cannot observe partial proxies; either carrier now replaces the other carrier’s managed entry without manual cleanup.

Give Python initialize its own 10-second default bound and name the selected profile in timeout diagnostics, while leaving ordinary agent turns unbounded by default. Package the dynamically resolved web frontend and skill-badge assets so the runtime wheel’s normal dsh profiles do not depend on pkg static-discovery accidents.

Rewrite the root launch rule and every active stale SDK-runtime note to the shipped dsh profile architecture in both languages. Focused tests prove import-only and transitive package exports, lock contention, cross-carrier transitions, missing-entry failures, asset inventory, and bounded initialization.
2026-08-24 17:28:27 +08:00
Tianyi Cui 01da043737 test(python): prove installed dsh profile customization
Migrate the packaged-runtime smoke inventory from complete Cordis trees to the sdk profile plus ordered patches. Preserve the focused minimal and advanced behaviors, update the generated durable snapshots for explicit permission events and the smaller RunResult, and keep worker, MCP, ripgrep, PTY/editor, direct JSON-RPC, and real-provider coverage.

Add an installed-only external bundle scenario that invokes the wheel's dsh plugin command with a local file package, verifies profile manifest reconciliation, imports @deepseek-ai/cordis as a peer, asserts the packaged proxy returns the exact host Context instance, and proves its system-prompt contribution reaches the model. Migrate the repository source e2e and runnable minimal example to the same profile grammar.
2026-08-24 17:28:26 +08:00
Tianyi Cui be7b064504 feat(python-runtime): package the dsh CLI and profile assets
Make the zero-code dsh-python-runtime-closure depend on the real @deepseek-ai/dsh application and every required profile peer, then package apps/cli's built bin instead of the deleted Python carrier. Rename executables to deepseek-harness-sdk-runtime-<platform>-<arch>, update wheel/platform/build workflow discovery, and install a Python dsh console command that requires explicit DSH_HOME before exec.

Include profile, bundle, preset, native addon, and shared-library assets needed by the full CLI. Remove the checked-in default cordis.yml and preserve the existing wheel distribution names, Python module names, sidecar validation, and wire identity. Runtime resolution and release tests pin the new artifacts and dev Node carrier.
2026-08-24 17:28:26 +08:00
Tianyi Cui 1d4dcf3b57 refactor(python): remove the private direct-config carrier
Delete @deepseek-ai/dsh-sdk-python-runtime and its packaged-bin entry now that Python uses the repository's dsh application launcher. Remove the package's project reference, Knip entry, workspace-policy exception, executable allowlist entry, and README-model classification together so no tooling preserves the old exception.

This commit is deliberately mechanical: it removes the obsolete package and gate accommodations without introducing the replacement launch behavior. The following commits add the packaged dsh runtime and Python profile API, keeping the architecture change separate from deletion noise.
2026-08-24 17:28:26 +08:00
Turtle 749c4ef93e fix: sample dev web metadata at startup 2026-08-24 15:04:01 +08:00