Repository navigation
Conversation
Compose the public native and PTC executors, shrink the program SDK and bound model-visible program output without changing default Bot behavior. Cover hybrid schemas, scoped bindings, policy dispatch, capped durable results and relay compatibility.
Keep DSH executors and schemastery host-provided instead of bundling pinned copies. Exercise scoped plugin prompt assembly in both modes so stock PTC instructions and SDK sections cannot silently return.
Hybrid already supplies native tool declarations, so keep its program SDK to guidance, tool names and compact result shapes. Preserve the complete compact code-only declarations.
|
I'll fix CI failures and address comments from users with write access that start with 'Devin'.
|
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Union explicit executor knownNames and retain the registry fallback when native omits them. Supply program names through a scoped public prompt provider without exposing restricted or inactive schemas.
Keep the public TypeScript renderer's formatting instead of collapsing whitespace across string literals and quoted keys. Cover repeated and padded spaces in keys, enums, constants and nested schemas.
Code-mode requires DSH 0.2.2-rc.1 while the main plugin still supports older hosts. Skip the opt-in executor tests only when executor packages are absent, preserving failures from packages that are present, and document the minimum host.
The 0.2.0 testkit lacks provideWorkingDirectoryFixture. Load it only after executor capability checks so unsupported hosts can register their skips before any feature-only named exports are linked.
There was a problem hiding this comment.
Devin Review found 2 findings. Devin automatically fixed all 2 findings.
Fixed by Devin (2)
- Hybrid tool ordering blocks affected chats — Reproduced the toolOrder rejection; knownNames now unions executor names with the registry fallback.
- Altered string literals in generated SDK — Reproduced the literal collapse; removed the blanket whitespace collapse and added tests.
Fei2411
left a comment
There was a problem hiding this comment.
Review of PR 1818 (code-mode executor) at 8ecce1e7. Verdict: the design is correct and safe, and it changes nothing at runtime for Bots that do not opt in. Three things should be fixed or verified before merge (items 1–3). CI is 16/16 green. Locally npm test gives 2955 pass, 0 fail, 3 skipped (Windows-only), and build-client --check and lint pass.
Should fix / verify before merge
- New peers on the main package also reach users who don't opt in.
ds-bot/package.jsonnow peers ondsh-tool-executor-native,dsh-tool-executor-ptc,dsh-ptc-runtimeandschemastery(all"*"), for every install ofds-botand not justds-bot/code-mode. The two executor packages first exist in 0.2.2-alpha.2. On DSH 0.2.0-rc.2, which CI still supports, npm withlegacy-peer-deps=falsewould auto-install them at theirlatesttag (0.2.2-alpha.2), and that tag pins its owndsh-tools. The result is a second, mismatched DSH copy next to the host's. Suggest marking these four aspeerDependenciesMeta: { ...: { optional: true } }. - The DSH ≥ 0.2.2-rc.1 requirement is documented but not enforced. On a 0.2.0-rc.2 harness,
import('./code-mode.js')throws a bareERR_MODULE_NOT_FOUND: Cannot find package '@deepseek-ai/dsh-tool-executor-native'. The 0.2.0-rc.2 CI job passes only because all 14 code-mode tests skip, so nothing checks that path. Suggest a clear load-time error, for example a dynamic import that rethrows "code-mode requires DSH >= 0.2.2-rc.1". Also add one test on the old matrix entry that the mainplugin.jsstill loads. - AGENTS.md smoke test not run for a
src/host/change. The PR body admits this and lists headless benchmark runs instead. The gap matters because thetools.jschange is on the default path: the early return for late team-tool schemas used to fire when anyrun_codewas in the list, and now fires only when the list is exactly[run_code]. Stock PTC is unaffected, sincePtcExecutor.describereturns onlyrun_code, but please rundev/bench.sh+dev/smoke.mjson the branch. Related: the app opt-in path (code-mode.disabled: falseinapp/engine/preset-standard.patch.yml) was never tried in the app.code-modeinjectsptcRuntime, and I could not confirm that a TypeScript PTC runtime is mounted in Bot Session scopes there. If it is not, flipping the switch does nothing and nothing reports it. One enabled smoke run, or a note in the design doc, would settle this.
Security (checked against DSH 0.2.2-rc.1 sources) — no bypass found
run_codeand every nested call go through the publicPtcExecutor'sToolExecutionPipeline. Guards,tools/pre-execute/post-execute, approvals and sandbox-escalation approval (approveEscalation) all still apply. The tests check guard denial and post-policy replacement.- Hybrid narrows bindings through
programToolSet().view(), and nested dispatch resolves throughtools.executable(name, scope, toolSet). So team, group, agent, goal and other native-only tools can't be reached from code. The view returns empty for other scopes and respects step admission (when). Code-only exposes everything, the same as stock PTC. - The PR adds no eval or sandbox of its own. Isolation,
timeoutMsand cancellation come from the host runtime. Innertool/ptc-dispatchaudit events are still written, because they don't depend on thelog: undefinedpassed to the PTC executor. - The cap applies only to the model-visible outer text. Nested values and images are not capped, as documented.
capResultText's marker loop converges, and the cap is ≥256 > marker length.
Minor
execute()writes its owntool/call/tool/resultevents for program calls, copying the shape of DSH's internalBatchSettlement. If DSH changes that event shape, these logs will drift. A comment naming the dependency would help.- A
run_codein a batch splits it into separate segments, so native calls on either side of it no longer share one parallel pool. This is fine as a barrier, but worth one line in the doc.
Overlap with other open PRs
- #1765 and #1298 merge cleanly with
devbut conflict with this PR inds-bot/package-lock.json(the peer block). The conflict is mechanical: whichever lands second runsscripts/merge-dev.shand regenerates the lock. Suggest landing #1765 first, since it is narrower, then this PR. - #1302 and #524 already conflict with
devand gainpackage.json/ lock conflicts from this PR. - The other
tools.js/scoped-tools-creation.test.jsPRs (#1453, #1163, #985, #954, #1168) conflict withdevalready and gain no new conflicts. - No open PR bumps the DSH pin.
Do not auto-install executor or runtime copies into older hosts when the independent code-mode entry is unused. Keep wildcard peers host-provided and mirror optional metadata in the lockfile.
Use the public dsh-tools package metadata to reject pre-rc.1 hosts and name absent optional packages before importing the implementation. Keep main-plugin import and the unsupported-host error covered by the legacy CI job.
Keep the active ds-bot bundle switch off by default and import the optional executor only when enabled. Scope it to Bot and group agents without reviving the retired app engine bundle or changing DSH presets. Document the applyPatch prerequisite and engine restart, and cover scope cleanup plus the scripted desktop smoke command.
Fei2411
left a comment
There was a problem hiding this comment.
Re-review at 4f4b171 (comments only). The three items from my earlier review are fixed. I found no blockers; this looks ready to merge once the lockfile conflict below is handled.
Earlier items
- Optional peers: fixed. The 4 DSH packages are now
peerDependenciesMeta.optionalin bothpackage.jsonand the lock. With the switch off,plugin.jsnever importscode-mode.js, so they are not loaded. - DSH minimum: fixed.
code-mode.jschecks@deepseek-ai/dsh-toolsagainst0.2.2-rc.1and the 4 packages before it loads the implementation, and throws one message naming the minimum version and what is missing. The new test asserts that message, and thatplugin.apply({ codeMode: { enabled: true } })rejects with it, so the legacy0.2.0-rc.2CI job now runs the old-host path instead of only skipping.semveris already a dependency, anddsh-toolsexports./package.json. - Smoke test: reported as passing (52/52 on dsh-v0.2.2-rc.1), which covers the
index.js,tools.jsand newsrc/host/changes. I did not re-run it.
New switch (bot.config.codeMode.enabled)
- Off by default:
ds-bot/cordis.patch.ymlsetsenabled: false. With it off,createRuntimegets nocodeModeargument,rt.scopeCodeModeis never defined, and the newhideBotUnusedToolsline does nothing. - It does reach the desktop app.
app/src/profile.mjsputs theds-botbundle in the app profile, so itsbotrow and this config load there.@deepseek-ai/dsh-base(also in the app profile) mountsptc-runtime(dsh-ptc-runtime-node) and leavestool-executor-ptcdisabled, so theptcRuntimedependency is met with no executor clash. A user override in<DSH_HOME>/profiles/ds-bot/cordis.patch.ymlsurvives import, becausewriteModelRowskeeps rows it does not own. Moving the switch out of the retiredapp/engine/preset was right. I did not drive the desktop app myself; the PR reports ahost.mjsrun with the switch on and off. - Scoping: the executor mounts only in owned Bot and group Session scopes and is disposed when a Session leaves, an Agent is disposed or the plugin unloads. This is tested. Ordinary DSH Agents keep the fallback executor.
Non-blocking notes
- When the switch is on, the whole Bot team runtime runs inside a child plugin that injects
ptcRuntime. If someone disables theptc-runtimerow, the team waits silently instead of showing an error. That is fine for an opt-in experiment, but worth a line in the design note. - There is no in-app UI for the switch: users edit the profile patch file and restart the engine, as documented.
CI: 16/16 green, including the DSH 0.2.0-rc.2 job.
Overlaps: #1765 and #1298 still conflict with this PR only in ds-bot/package-lock.json, and the PR merges cleanly into dev. Same order as before: land #1765, then run scripts/merge-dev.sh here and regenerate the lock.
Avoid waiting on an unmet child injection that silently suppresses the Bot team. Start the normal runtime and report the missing provider and recovery options through the existing logger and Feedback diagnostics. Cover API startup, diagnostics visibility and logging in a regression test.
There was a problem hiding this comment.
The opt-in executor is separate from #1754's native tool-call parsing issue, but removing it breaks tool execution for live Sessions. Please keep ordinary DSH execution working when a Session leaves Bot ownership or the plugin unloads.
| const remove = id => { | ||
| const held = scopes.get(id) | ||
| scopes.delete(id) | ||
| return held?.scope.dispose() |
There was a problem hiding this comment.
Disposing this scope leaves the DSH executor slot unavailable rather than restoring the inherited executor. The new real-harness test currently asserts that selectExecutor(agent) throws after the Session loses ownership and after plugin unload. A former Bot Session can be adopted as a plain DSH Session, so leaving it without any executor is a user-visible regression. Use a supported lifecycle that restores inherited execution (or constrain activation to a lifecycle that can safely replace the Agent), and change the test to assert that native tool execution works on the same live Session afterward.
# Conflicts: # ds-bot/index.js
Keep both DeepSeek Harness attribution entries and rebuild the client and link bundles from the merged sources. Preserve the code-mode optional peers alongside dev's additions.
Issue
No issue. Follows lulu's PTC benchmark and the Claude Code Code Mode doc (https://code.claude.com/docs/en/code-mode).
What changed / 改了什么
New plugin entry
ds-bot/code-mode(ds-bot/src/host/code-mode.js). It registers a tool executor built only from public DSH APIs: it composesNativeToolExecutorandPtcExecutorand does not patch DSH.mode: hybrid(default): the model gets every normal tool plusrun_codeand picks one itself. Program bindings cover only fs, search, shell, web andmcp__*. Team, group, agent and goal tools stay native-only.mode: code-only: onlyrun_code, like the PTC preset.maxResultChars(default 8000) caps the model-visiblerun_coderesult with head and tail kept, plus an explicit "N characters omitted, filter in code" marker.tool-fs.applyPatch: true.bot.config.codeMode.enabledinds-bot/cordis.patch.yml, off by default. When on, the executor mounts in the Bot and group agent scopes; restart the engine after changing it. When off, Bot behavior is unchanged.peerDependencies, loaded only when the switch is on. On hosts older than DSH 0.2.2-rc.1, enabling it fails with a clear error naming the minimum version and the missing packages.docs/plans/2026-11-18-code-mode.md.Benchmark on headless DSH 0.2.2-rc.3 with deepseek-v4.1-flash: 6 tasks × 3 runs, compared against the earlier baseline. Costs are list-price estimates.
Compared with the baseline PTC, hybrid costs 21% less and code-only 13% less, both with 18/18 success. Both still cost more than same-day standard: hybrid +7%, code-only +18%. Standard's two failures were cheap aborts caused by malformed native tool-call JSON, the issue deferred to #1754. Hybrid chose
run_codein 10 steps and native tools in 73. Many-file edits are still the expensive case: code-only spent 51% more than the baseline PTC there.Changelog
none (opt-in, off by default)
How I checked it / 怎么验证的
npm test(inds-bot/): 2959 pass, 0 fail, 3 skipped. Under legacy DSH 0.2.0-rc.2, the minimum-host error tests run and pass.node scripts/build-client.mjs --checknpm run lintdev/bench.shon dsh-v0.2.2-rc.1): all 52 steps passedapp/src/host.mjs, mock model): with the switch on,run_codeappears next to the normal tools and one call worked; with it off,run_codeis absent.Checklist / 检查
src/client/changed →npm run buildran andclient.jsis committed. (not changed)Co-authored-by.Implemented in session Compare DSH PTC and standard presets on DeepSeek
Review with Devin · Open in Devin Desktop