Merge remote-tracking branch 'origin/master' into worktree/pr743-merge-20260727

# Conflicts:
#	examples/acp-agent/tests/snapshots/escalation-approved/session.jsonl
#	examples/acp-agent/tests/snapshots/escalation-rejected/session.jsonl
#	examples/acp-agent/tests/snapshots/fs-escalation-approved/session.jsonl
#	examples/acp-agent/tests/snapshots/hook-cc-pretool-ask/session.jsonl
#	examples/acp-agent/tests/snapshots/session-query-spill/session.jsonl
#	examples/cordis-agent/tests/cordis-tools.e2e.ts
#	examples/headless-agent/tests/snapshots/advanced-toolchain/session.1.jsonl
#	examples/headless-agent/tests/snapshots/advanced-toolchain/session.2.jsonl
#	examples/headless-agent/tests/snapshots/advanced-toolchain/session.jsonl
This commit is contained in:
Tianyi Cui
2026-07-27 23:59:33 +08:00
528 changed files with 10636 additions and 10785 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')
@@ -11,18 +11,18 @@ buffer
2| " deepseek-v4-flash • main-session"
style 1-34 dim
3| <blank>
4| " Entering plan mode (applies from the next step). Use /plan off to leave. "
style 1-72 fg=bright-black
5| <blank>
6| "▌ "
4| " "
style 0-0 fg=bright-blue
7| "▌ You "
5| "▌ You "
style 0-0 fg=bright-blue
style 2-4 fg=bright-blue bold
8| "▌ Reply with exactly the word: ONE. No tools. "
6| "▌ Reply with exactly the word: ONE. No tools. "
style 0-0 fg=bright-blue
9| "▌ "
7| "▌ "
style 0-0 fg=bright-blue
8| <blank>
9| " Entering plan mode (applies from the next step). Use /plan off to leave. "
style 1-72 fg=bright-black
10| <blank>
11| " Reasoning "
style 1-9 fg=bright-black italic
@@ -36,20 +36,20 @@ buffer
17| " Leaving plan mode (applies from the next step). "
style 1-47 fg=bright-black
18| <blank>
19| " Context · plan-mode "
style 1-19 dim
20| " The user switched this session back to the default mode. "
style 1-56 fg=bright-black
21| <blank>
22| "▌ "
19| " "
style 0-0 fg=bright-blue
23| "▌ You "
20| "▌ You "
style 0-0 fg=bright-blue
style 2-4 fg=bright-blue bold
24| "▌ Reply with exactly the word: TWO. No tools. "
21| "▌ Reply with exactly the word: TWO. No tools. "
style 0-0 fg=bright-blue
25| "▌ "
22| "▌ "
style 0-0 fg=bright-blue
23| <blank>
24| " Context · plan-mode "
style 1-19 dim
25| " The user switched this session back to the default mode. "
style 1-56 fg=bright-black
26| <blank>
27| " Reasoning "
style 1-9 fg=bright-black italic