Merge origin/master into feat/tui-master-port

This commit is contained in:
Tianyi Cui
2026-07-27 23:34:56 +08:00
713 changed files with 16615 additions and 13373 deletions
+13 -4
View File
@@ -80,10 +80,19 @@ class ScriptedTuiAdapter extends LlmAdapter {
throw new Error('the scripted TUI request did not apply the selected model and reasoning effort')
}
const lastMessage = options.messages.at(-1)
const lastText = (lastMessage?.content ?? [])
.filter(block => block.type === 'text')
.map(block => block.text)
.join('\n')
// The loop appends plugin-sourced context (the plan-mode notice, the
// tool-skill catalog) AFTER the admitted prompt, so the scripted trigger
// may sit one or more user messages back: scan the whole trailing run of
// user-role messages since the last assistant message.
const trailingUserTexts: string[] = []
for (let index = options.messages.length - 1; index >= 0; index--) {
const message = options.messages[index]
if (message?.role !== 'user') break
for (const block of message.content) {
if (block.type === 'text') trailingUserTexts.push(block.text)
}
}
const lastText = trailingUserTexts.join('\n')
if (lastText.includes(DEFAULT_MODE_PROBE)) {
if (options.system?.includes('Stay in plan mode for this scripted TUI test.')) {
throw new Error('the scripted TUI request retained plan guidance after /plan off')
@@ -4,6 +4,10 @@
- id: scripted-llm
name: './tui-scripted-llm.ts'
# Managed child-process groups for the bash executor (spawn/kill/output plumbing).
- id: subprocess
name: '@deepseek-ai/dsh-subprocess-local'
- id: bash
name: '@deepseek-ai/dsh-bash-local'
@@ -11,12 +11,12 @@ buffer
2| " main-session"
style 1-12 dim
3| <blank>
4| "Entering plan mode (applies from the next step). Use /plan off to leave. "
style 0-71 fg=bright-black
5| <blank>
6| "You "
4| "You "
style 0-2 fg=bright-blue bold underline
7| "Reply with exactly the word: ONE. No tools. "
5| "Reply with exactly the word: ONE. No tools. "
6| <blank>
7| "Entering plan mode (applies from the next step). Use /plan off to leave. "
style 0-71 fg=bright-black
8| <blank>
9| "Assistant "
style 0-8 fg=bright-magenta bold underline
@@ -31,14 +31,14 @@ buffer
15| "Leaving plan mode (applies from the next step). "
style 0-46 fg=bright-black
16| <blank>
17| "Context · plan-mode "
style 0-18 dim
18| "The user switched this session back to the default mode. "
style 0-55 fg=bright-black
19| <blank>
20| "You "
17| "You "
style 0-2 fg=bright-blue bold underline
21| "Reply with exactly the word: TWO. No tools. "
18| "Reply with exactly the word: TWO. No tools. "
19| <blank>
20| "Context · plan-mode "
style 0-18 dim
21| "The user switched this session back to the default mode. "
style 0-55 fg=bright-black
22| <blank>
23| "Assistant "
style 0-8 fg=bright-magenta bold underline
+2
View File
@@ -8,6 +8,7 @@ import { scrubRequestHeaders } from '@deepseek-ai/dsh-acp-snapshot'
import type { Agent } from '@deepseek-ai/dsh-agent'
import * as AgentCore from '@deepseek-ai/dsh-agent-spine-demo'
import { LocalBashExecutor } from '@deepseek-ai/dsh-bash-local'
import LocalSubprocessService from '@deepseek-ai/dsh-subprocess-local'
import WorkerCodeRuntime from '@deepseek-ai/dsh-code-runtime-worker'
import CommandService from '@deepseek-ai/dsh-commands'
import LocalFileSystem from '@deepseek-ai/dsh-fs-local'
@@ -220,6 +221,7 @@ async function mountScenarioContext(
skills: { local: { agentsHome: join(cwd, '.agents') } },
})
await ctx.plugin(TokenMeterService)
await ctx.plugin(LocalSubprocessService)
await ctx.plugin(LocalBashExecutor, { cwd, timeoutMs: 30_000 })
await ctx.plugin(SnapshotLocalFileSystem, { cwd: '/' })
await ctx.plugin(FsPolicy)