Commit Graph
141 Commits
Author SHA1 Message Date
Dudu-0223 98dce25aad fix(ptc): guard output suppression during teardown 2026-11-17 13:46:07 +08:00
Dudu-0223 08e5a9b059 Merge remote-tracking branch 'origin/master' into fix/cua-output-failures
# Conflicts:
#	apps/cli/tests/profiles/cua-mcp/expected/tools.json
#	packages/core/tool-executor-ptc/README.i18n.yaml
#	packages/ptc-runtime/ptc-runtime-node/README.i18n.yaml
#	packages/ptc-runtime/ptc-runtime-node/README.md
#	packages/ptc-runtime/ptc-runtime-node/README.zh.md
#	packages/ptc-runtime/ptc-runtime-node/src/bootstrap.ts
#	packages/ptc-runtime/ptc-runtime-node/src/process.ts
#	packages/ptc-runtime/ptc-runtime-node/src/protocol.ts
#	packages/ptc-runtime/ptc-runtime-node/tests/bootstrap.spec.ts
#	snapshots/sdk/cua-run-code/tool-schemas.expected.json
#	snapshots/session/cua-run-code-ptc/system-prompt.expected.md
#	snapshots/session/cua-run-code-scoped/tool-schemas.expected.json
#	snapshots/session/cua-run-code/tool-schemas.expected.json
#	snapshots/session/ptc-persistent-scoped/tool-schemas.expected.json
#	snapshots/session/ptc-persistent/tool-schemas.expected.json
#	snapshots/session/ptc-reset/tool-schemas.expected.json
#	snapshots/session/ptc-scoped-repl/tool-schemas.expected.json
#	snapshots/session/ptc-timeout-fallback/tool-schemas.expected.json
2026-11-16 12:43:20 +08:00
turtle1999 18f492edbc chore: merge master into ptc inspection branch 2026-11-13 18:58:46 +08:00
turtle1999 f3ed11c1a3 fix(ptc): preserve inspection across array changes and images 2026-11-13 18:41:03 +08:00
turtle1999 500dcf94be feat(ptc): inspect tool results with their rendered text 2026-11-13 17:21:11 +08:00
imccyu f14fb7c76f test(ptc): sync run_code string guidance in tests, snapshots, and docs
Update the full-text instruction assertions, the run_code tool-schema and system-prompt sidecars of the session, SDK, and Web snapshots, the cua-mcp expected tools, the generated tool catalog with its Chinese pair, and the ptc-runtime-node README pair.
2026-11-13 16:12:16 +08:00
Dudu-0223 dfc7dbf648 fix(ptc): truncate output without interrupting execution 2026-11-13 15:39:03 +08:00
_Kerman 1848364e29 Merge pull request #8380 from deepseek-harness/xtr/remove-python-ptc
refactor(ptc)!: remove all Python PTC support
2026-11-12 18:26:48 +08:00
imccyu 3e1e50f774 feat(ptc): define scoped REPL top-level scopes and import base in guidance (#8275)
* feat(ptc): define scoped REPL top-level scopes and import base in guidance

The scoped REPL guidance now states the rules a program follows instead of
listing edge cases: each run_code call runs one program in its own top-level
scope, whose top-level declarations and received names are copied, not
referenced, into later programs; a program either uses a copied name or
declares it again; block-level var is discouraged because it changes which
value later programs copy; a failed program keeps earlier values. It names
the missing require and module and separates the import base, fixed at the
environment's first program, from process.cwd(), which follows each program.
Formats without top-level return say to await work before the program ends.

* test(ptc): pin the scoped REPL scope and import guidance

Update the verbatim scoped REPL guidance assertion and refresh, without a key,
the recorded run_code descriptions of the PTC and CUA scenarios whose guidance
changed: the scoped REPL rules and the "before the program ends" wording
shared by retained formats.

* test(cua-mcp): refresh the cua_run_code description for the scoped REPL guidance

The cua-mcp profile expectation landed on master after this branch's base; it lists cua_run_code with the scoped REPL execution instructions.

* fix(ptc): keep the shared scoped guidance free of a consumer tool name

The runtime execution instructions are shared by run_code and cua_run_code, so
the new sentence no longer names run_code. The Agent Note also gives the
missing top-level return as the reason for the retained-state wording, which
covers the persistent script format as well as the REPLs.

* test(ptc): pin the unchanged scoped guidance across consumers

The verbatim assertion, the three scoped tool schemas, and the cua-mcp profile
fixture follow the shared sentence, which no longer names run_code.
2026-11-12 10:02:49 +00:00
_Kerman 968ea6ebc0 fix(ptc): reject reserved scoped REPL binding names 2026-11-12 17:48:59 +08:00
_Kerman 656533bde1 refactor(ptc)!: remove all Python PTC support 2026-11-12 17:09:15 +08:00
sjw1231 e5611f8281 Merge remote-tracking branch 'origin/master' into claude/tool-errors-mcp-f5e887
# Conflicts:
#	docs/config-catalog.md
#	docs/config-catalog.zh.md
#	docs/module-graph.md
#	docs/module-graph.zh.md
#	packages/boot/plugin-market/tests/tools.spec.ts
#	packages/mcp/mcp-client/tests/mcp-client.spec.ts
#	pnpm-lock.yaml
2026-11-11 15:51:19 +08:00
imccyu 455f7a38a6 Merge pull request #8214 from deepseek-harness/split-exports-brand-strings
refactor(brand): migrate internal identity construction
2026-11-11 15:15:26 +08:00
sjw1231 32bbcb9997 Merge remote-tracking branch 'origin/master' into claude/tool-errors-mcp-f5e887
# Conflicts:
#	docs/module-graph.md
#	docs/module-graph.zh.md
#	packages/core/tool-executor-ptc/README.i18n.yaml
#	packages/core/tool-executor-ptc/src/errors.ts
#	packages/core/tool-executor-ptc/src/ptc.ts
#	packages/ptc-runtime/ptc-runtime-node/src/bindings.ts
#	packages/ptc-runtime/ptc-runtime-node/src/execution.ts
#	packages/ptc-runtime/ptc-runtime-node/src/index.ts
#	packages/ptc-runtime/ptc-runtime/package.json
#	packages/ptc-runtime/ptc-runtime/tsconfig.json
#	packages/util/atomic-write/package.json
#	pnpm-lock.yaml
2026-11-11 11:48:52 +08:00
imccyu 37e0924f68 Merge pull request #8257 from deepseek-harness/ptc-scoped-repl-switch
feat(ptc): run the scoped REPL by default for persistent-in-memory execution
2026-11-10 22:34:59 +08:00
imccyu c6ef2d17da fix(ptc): keep the runtime's own experimental warnings out of program output
The child filters Node's ExperimentalWarning for vm.USE_MAIN_CONTEXT_DEFAULT_LOADER
and stripTypeScriptTypes, which the runtime itself triggers; an environment
initializer that imports a module under the scoped REPL otherwise prints it into
the first call's output. Warnings that programs emit still print. The host strips
types without printing the stripTypeScriptTypes warning.
2026-11-10 18:52:20 +08:00
imccyu 561f7f1538 test(ptc): match scoped REPL filenames with platform paths
Scoped REPL programs are named resolve(<creation cwd>, '.ptc-repl-<n>.js'), so on Windows their stacks show backslash paths. Compare locations against the resolved filename instead of a hardcoded '/' separator, keeping the submission ordinal, line, and column checks.
2026-11-10 18:52:20 +08:00
imccyu 1cf3217403 fix(ptc): align scoped REPL guidance and tests with inspect output
run_code now discards completion values for TypeScript runtimes, so the
scoped REPL guidance shares the inspect output sentence with the other
modes. Tests read the output field, cover environment initialization with
copied bindings, and the ptc-scoped-repl snapshot is re-recorded with
inspect output.
2026-11-10 18:52:19 +08:00
imccyu 5a398a9990 feat(ptc): name scoped REPL programs as hidden files in the first directory
Each call's Script filename becomes <first working directory>/.ptc-repl-<n>.js.
No file exists at that path; the directory stays because Node's default loader
resolves relative import() specifiers from the filename.
2026-11-10 18:52:19 +08:00
imccyu ba4d01126c feat(ptc): start scoped REPL var redeclarations from the earlier value
A call that declares an earlier name again only with var now gets a var
copy of the earlier value, so a var declaration that does not run, after
a throw or in an untaken branch, keeps that value as a global var does in
Node's REPL. var count = count + 1 consequently adds to the earlier value.
A function of the same name in one call takes precedence over the var.
Update the model guidance, Agent Note, READMEs, and the ptc-scoped-repl
snapshot schema.
2026-11-10 18:52:19 +08:00
imccyu 793ce790a6 feat(ptc): add scoped REPL execution with copied top-level bindings
With replScoped: true, persistent-in-memory runs each call as a separate
VM Script in one retained context. Each call starts with copies of the
top-level bindings left by earlier calls, so a later call may declare any
earlier name again with any keyword while earlier functions and
still-running code keep their values. Results, top-level await, errors
and asynchronous failures follow the existing REPL evaluator; modules
load only through dynamic import(), resolved from the environment's first
working directory.

The control protocol moves to version 3; the upgrade guide covers
preinstalled bootstraps and the new PtcProgramFormat member. The Agent
Note records the decision and its comparison with node:repl and
vm-script, and the ptc-scoped-repl snapshot pins the model guidance.
2026-11-10 18:52:19 +08:00
_Kerman 7526051e60 test(ptc): sync artifact expectations with emitted newlines 2026-11-10 16:31:41 +08:00
_Kerman 5fd443618f fix(ptc): preserve raw text and cross-realm image inspection 2026-11-10 16:07:14 +08:00
_Kerman 0a398c2968 refactor(ptc): require image dependencies for inspect 2026-11-10 14:40:31 +08:00
_Kerman 86984d8358 Merge branch 'feat/cua-run-code-standard' into xtr/ptc-inspect-output 2026-11-10 14:24:26 +08:00
_Kerman 0191dbb0cf refactor(ptc): collect nested images through custom inspection 2026-11-10 13:38:43 +08:00
_Kerman 5d0106771e fix(ptc): render inspected values with Node object formatting 2026-11-10 11:58:10 +08:00
_Kerman 9e61299fdb fix(ptc): isolate image property descriptors from prototypes 2026-11-10 11:42:07 +08:00
turtle1999 d602624eb3 refactor(cua): isolate raw registration and simplify initialization 2026-11-10 11:11:58 +08:00
_Kerman 2bedbf2f2b fix(ptc): align JSON inspection tests and failure handling 2026-11-10 10:45:41 +08:00
turtle1999 26427a26e1 refactor(ptc): initialize each environment through a registered hook 2026-11-09 22:19:35 +08:00
_Kerman 4e976ee9a9 fix(ptc-runtime): retain inspected output across proxy and limit cases 2026-11-09 21:42:29 +08:00
turtle1999 f0e9dc1c92 fix(cua): support clean source runs and preserve per-mode guidance 2026-11-09 18:17:56 +08:00
_Kerman e1f0a36193 fix(ptc): preserve native console methods 2026-11-09 18:17:19 +08:00
_Kerman a2ea3970fd refactor(ptc): return ordered text and image output 2026-11-09 17:44:12 +08:00
_Kerman 1fed265b3b fix(ptc): bound binary inspection and preserve failure output 2026-11-09 17:19:48 +08:00
_Kerman b98e3d070b feat(ptc): expose attachment IDs on program images 2026-11-09 15:58:33 +08:00
turtle1999 b9966a12a6 feat(cua): expose persistent code tool outside PTC mode 2026-11-09 15:53:22 +08:00
_Kerman 4e72e43037 chore(ptc): align fixtures and docs with simplified image handling 2026-11-09 15:42:49 +08:00
sjw1231 6b3023d888 feat(ptc): give run_code and PTC runtime failures error codes
run_code argument checks now throw ToolArgsError (INVALID_ARGS),
including timeoutMs or sandbox_permissions passed to a runtime whose
schema does not expose them; a missing runtime, workingDirectory, or
sandboxPolicy throws ToolContextUnavailableError. CodeRunFailedError
gains CODE_RUN_UNAVAILABLE after executor disposal, keeping
CODE_RUN_FAILED as the default. A runtime
rejection without its own code becomes CODE_RUN_FAILED with the
rejection as cause; caller cancellation keeps the signal's reason.

The PTC runtime Service Definition adds PtcRuntimeError for contract
misuse: PTC_RUNTIME_INVALID_ARGUMENT, PTC_RUNTIME_UNAVAILABLE, and
PTC_RUNTIME_CONFLICT. The Node runtime throws it for invalid specs and
bindings, use after disposal, incomplete retained cleanup, concurrent
runs for one owner, and a retained environment under another sandbox
policy. dsh-ptc-runtime now declares @deepseek-ai/dsh-error.

Refs #7869
2026-11-09 15:14:31 +08:00
_Kerman 724e56b286 feat(ptc): unify explicit text and image inspection 2026-11-09 15:06:09 +08:00
_Kerman 790991a6c0 docs(ptc): align inspection guidance and references 2026-11-09 12:56:55 +08:00
_Kerman e688c61aab fix(ptc): target program realms for console globals 2026-11-09 12:48:09 +08:00
_Kerman c1783e9dff feat(ptc): select program output with Harness.inspect 2026-11-09 12:00:07 +08:00
Anlai Lu 41ef0fcaa9 refactor(ptc): 复用 embedded 载体的既有 process.js 启动 2026-11-06 13:51:24 +08:00
Anlai Lu 4ac6a28e68 feat(ptc): 支持 embedded 模式启用 persistent PTC 2026-11-06 12:55:15 +08:00
Yixiang Tu 69e6199cb7 test(sandbox): canonicalize roots allocated under home 2026-11-04 16:06:17 +08:00
Yixiang Tu e032300b4e fix(sandbox): use current grants after failed PTC startup 2026-11-04 15:11:17 +08:00
Yixiang Tu f5dea38671 feat(sandbox): add session-scoped writable directory effects 2026-11-04 15:11:17 +08:00
_Kerman ab2bee0051 Merge remote-tracking branch 'origin/master' into xtr/ptc-timeout-step-1 2026-11-03 20:12:59 +08:00