Skip to content

Commit 7ea3f75

Browse files
authored
Merge branch 'Zoo-Code-Org:main' into fix/lmstudio-reasoning-content
2 parents a3a9330 + 9081dde commit 7ea3f75

181 files changed

Lines changed: 9698 additions & 578 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/workflows/e2e.yml‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,12 @@ jobs:
150150
if: github.event_name != 'pull_request' || steps.e2e-marker.outputs.cache-hit != 'true'
151151
run: xvfb-run -a pnpm --filter @roo-code/vscode-e2e test:ci:mock
152152

153+
- name: Run mocked restart-persistence E2E test
154+
# Reuse the runner built by the full mocked suite; this direct invocation avoids
155+
# test:run's dotenv loading and does not repeat the bundle or webview build.
156+
if: github.event_name != 'pull_request' || steps.e2e-marker.outputs.cache-hit != 'true'
157+
run: TEST_FILE=restart-persistence.test USE_MOCK=true xvfb-run -a pnpm --filter @roo-code/vscode-e2e exec node ./out/runTest.js
158+
153159
- name: Explain skipped mocked E2E pass marker
154160
if: steps.e2e-marker.outputs.cache-hit != 'true' && steps.run-e2e.outcome == 'success' && steps.vscode-fallback.outputs.used == 'true'
155161
run: echo "Skipping mocked E2E pass marker because tests ran against a stale cached VS Code binary (VS Code download endpoints unreachable)."

‎CHANGELOG.md‎

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,47 @@
11
# Zoo Code Changelog
22

3+
## [3.78.0]
4+
5+
### Minor Changes
6+
7+
- Add NanoGPT as a configurable provider with dynamic model discovery, streaming and prompt completions, and routing preferences for speed, price, latency, throughput, tool support, and caching (PR #1239 by @taltas)
8+
- Add the new Gemini 3.7 Flash model to Google Gemini and Vertex AI with a 1M context window, multimodal input, prompt caching, and configurable reasoning (PR #1241 by @app/zoomote)
9+
- Add the new GLM 5.3 model to Z AI coding plans and OpenCode Go with a 1M context window, prompt caching, and extended reasoning controls (PR #1244 by @app/zoomote)
10+
- Add the new Qwen3.8 Max model to OpenCode Go with multimodal input, caching, streamed reasoning, and Anthropic Messages routing (PR #1245 by @app/zoomote)
11+
- Fix Azure OpenAI resource endpoints and improve Azure-specific setup guidance in OpenAI Compatible settings (#1191 by @edelauna, PR #1192 by @app/zoomote)
12+
- Preserve task-history titles when rapidly navigating away before a task's messages finish loading (#1180 by @edelauna, PR #1181 by @edelauna)
13+
- Correct Kimi Code output-token defaults and honor model limits returned by the server (#1215 by @myk1yt, PR #1217 by @myk1yt)
14+
- Update DeepSeek V4 Pro reasoning efforts and normalize medium, high, and extended reasoning mappings (#1235 by @WHMHammer, PR #1236 by @WHMHammer)
15+
- Correct DeepSeek V4 pricing and expand provider coverage for the V4 Pro 0813 checkpoint (PR #1237 by @app/zoomote)
16+
- Rename the default settings import/export file to `zoo-code-settings.json` throughout the extension (#1176 by @Rafael-Silva-Oliveira, PR #1177 by @Rafael-Silva-Oliveira)
17+
- Add Destructive Command Guard support for Intel-based macOS systems (PR #1213 by @app/zoomote)
18+
- Update `undici` to 6.28.0 to address security vulnerabilities (PR #1161 by @app/renovate)
19+
- Update Mermaid to 11.16.1 to address a prototype-pollution vulnerability (PR #1193 by @app/renovate)
20+
- Record tool usage centrally to prevent duplicate telemetry and sanitize raw tool names (PR #1073 by @edelauna)
21+
- Canonicalize shared provider settings identifiers and add registry-alignment coverage (PR #1109 by @WebMad)
22+
- Canonicalize provider identifiers across CLI configuration, environment mappings, and model selection (PR #1110 by @WebMad)
23+
- Complete the webview migration to canonical provider identifiers across provider settings and routing (PR #1141 by @WebMad)
24+
- Use canonical provider identifiers throughout API options and add focused interaction coverage (PR #1146 by @WebMad)
25+
- Canonicalize provider model configuration identifiers and provider-specific settings behavior (PR #1147 by @WebMad)
26+
- Migrate model-selection UI hooks to canonical provider identifiers (PR #1148 by @WebMad)
27+
- Reuse the retired Roo provider identifier registry while preserving migration compatibility (PR #1166 by @WebMad)
28+
- Introduce typed shared test utilities for API options, filesystem mocks, reset operations, VS Code doubles, and webview rendering (PR #1171 by @app/zoomote)
29+
- Reuse shared API option factories across Requesty, OpenRouter, and Vercel AI Gateway provider tests (PR #1178 by @app/zoomote)
30+
- Reuse the shared Responses client mock in X.AI provider tests (PR #1182 by @app/zoomote)
31+
- Reuse shared VS Code context, URI, and reset helpers in custom-mode configuration tests (PR #1190 by @app/zoomote)
32+
- Reuse shared reset helpers across code-index embedder tests (PR #1194 by @app/zoomote)
33+
- Reuse shared config test helpers and remove obsolete lint suppressions (PR #1195 by @app/zoomote)
34+
- Reuse shared webview render helpers across focused chat tests (PR #1196 by @app/zoomote)
35+
- Reuse shared reset helpers across terminal integration tests (PR #1197 by @app/zoomote)
36+
- Reuse shared VS Code and reset helpers in settings import/export tests (PR #1198 by @app/zoomote)
37+
- Reuse shared reset helpers across additional code-index tests (PR #1199 by @app/zoomote)
38+
- Complete another batch of shared reset-helper adoption in code-index tests (PR #1200 by @app/zoomote)
39+
- Finish reset-helper adoption in Semble and terminal test suites (PR #1201 by @app/zoomote)
40+
- Complete shared reset-helper adoption across provider tests (PR #1202 by @app/zoomote)
41+
- Reuse shared webview render helpers across chat and settings tests (PR #1203 by @app/zoomote)
42+
- Complete shared webview render-helper adoption in the remaining settings tests (PR #1204 by @app/zoomote)
43+
- Merge the v3.76.0 release preparation branch into `main` (PR #1173 by @navedmerchant)
44+
345
## [3.76.0]
446

547
### Minor Changes

‎README.md‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,13 @@ Zoo Code builds on the foundation created by Roo Code and continues to expand it
4646
- **More dependable terminal and editing workflows** — fixes for premature terminal completion, task-state races, context management, diff editing, and provider-specific tool use.
4747
- **More control over your workspace** — rules management, per-mode MCP restrictions, multi-root path controls, model reasoning options, and completion change review actions.
4848

49-
## What's New in v3.76.0
49+
## What's New in v3.78.0
5050

51-
- **Run longer, uninterrupted tasks with Destructive Command Guard (DCG)** — DCG blocks dangerous commands while letting Zoo keep working without you continuously pressing approval buttons, backed by hardened managed-binary downloads and installation.
52-
- **Better provider controls and reliability** — choose OpenAI Codex response speed, use updated DeepSeek configurations, and benefit from stronger isolation between provider-profile changes and running tasks.
53-
- **Critical terminal execution fix** — Zoo now waits for terminal commands to finish before starting the next step, preventing overlapping work and premature model continuation.
54-
- Smarter batching groups related tool approvals while keeping unrelated requests separate.
55-
- Telemetry delivery and model-cache fetching are more resilient under failures and concurrent requests.
51+
- **Three major new models have arrived** — use the brand-new Gemini 3.7 Flash, GLM 5.3, and Qwen3.8 Max models, plus updated DeepSeek V4 reasoning, pricing, and provider coverage.
52+
- **Connect to NanoGPT** — use dynamic model discovery, streaming and prompt completions, and routing preferences for speed, price, latency, throughput, tool support, and caching.
53+
- **More reliable providers and tasks** — fixes improve Azure OpenAI endpoint setup, Kimi Code output limits, task-history title preservation, and Zoo settings import/export.
54+
- Destructive Command Guard now supports Intel-based Macs.
55+
- Security updates address vulnerabilities in `undici` and Mermaid.
5656

5757
<details>
5858
<summary>🌐 Available languages</summary>

‎apps/cli/src/lib/utils/__tests__/context-window.test.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ describe("getContextWindow", () => {
1414
[providerIdentifiers.vercelAiGateway, "vercelAiGatewayModelId"],
1515
[providerIdentifiers.opencodeGo, "opencodeGoModelId"],
1616
[providerIdentifiers.kenari, "kenariModelId"],
17+
[providerIdentifiers.nanogpt, "nanoGptModelId"],
1718
[providerIdentifiers.zooGateway, "zooGatewayModelId"],
1819
] as const)("uses the provider-specific model field for %s", (provider, modelField) => {
1920
const config = { apiProvider: provider, [modelField]: "selected-model" } as ProviderSettings

‎apps/cli/src/lib/utils/context-window.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ function getModelIdForProvider(config: ProviderSettings): string | undefined {
5656
return config.opencodeGoModelId
5757
case providerIdentifiers.kenari:
5858
return config.kenariModelId
59+
case providerIdentifiers.nanogpt:
60+
return config.nanoGptModelId
5961
case providerIdentifiers.zooGateway:
6062
return config.zooGatewayModelId
6163
case providerIdentifiers.anthropic:
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"fixtures": [
3+
{
4+
"match": {
5+
"userMessage": "RESTART_PERSISTENCE_SMOKE"
6+
},
7+
"response": {
8+
"toolCalls": [
9+
{
10+
"name": "attempt_completion",
11+
"arguments": "{\"result\":\"RESTART_PERSISTENCE_MARKER\"}",
12+
"id": "call_restart_persistence_done"
13+
}
14+
]
15+
}
16+
}
17+
]
18+
}
Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
import * as path from "path"
2+
import * as fs from "fs/promises"
3+
4+
import { createWriteStream } from "fs"
5+
6+
export const PHASE_RESULT_VERSION = 1 as const
7+
8+
export type RestartPhase = "create" | "verify"
9+
export type PhaseStatus = "passed" | "failed"
10+
11+
export type PhaseError = {
12+
message: string
13+
stack?: string
14+
}
15+
16+
export type PhaseResult = {
17+
version: typeof PHASE_RESULT_VERSION
18+
phase: RestartPhase
19+
status: PhaseStatus
20+
values?: Record<string, string>
21+
error?: PhaseError
22+
}
23+
24+
const phaseResultNames: Record<RestartPhase, string> = {
25+
create: "01-create.json",
26+
verify: "02-verify.json",
27+
}
28+
29+
export function getPhaseResultPath(resultsDir: string, phase: RestartPhase): string {
30+
const resolvedResultsDir = path.resolve(resultsDir)
31+
const resultPath = path.resolve(resolvedResultsDir, phaseResultNames[phase])
32+
if (path.dirname(resultPath) !== resolvedResultsDir) {
33+
throw new Error(`Phase result path escaped the results directory: ${phase}`)
34+
}
35+
return resultPath
36+
}
37+
38+
export function serializePhaseError(error: unknown): PhaseError {
39+
if (error instanceof Error) {
40+
return {
41+
message: error.message.slice(0, 2_000),
42+
...(error.stack && { stack: error.stack.slice(0, 4_000) }),
43+
}
44+
}
45+
46+
return { message: String(error).slice(0, 2_000) }
47+
}
48+
49+
function isRecord(value: unknown): value is Record<string, unknown> {
50+
return typeof value === "object" && value !== null
51+
}
52+
53+
export function validatePhaseResult(value: unknown): asserts value is PhaseResult {
54+
if (!isRecord(value) || value.version !== PHASE_RESULT_VERSION) {
55+
throw new Error("Invalid phase result version")
56+
}
57+
if (value.phase !== "create" && value.phase !== "verify") {
58+
throw new Error("Invalid phase result phase")
59+
}
60+
if (value.status !== "passed" && value.status !== "failed") {
61+
throw new Error("Invalid phase result status")
62+
}
63+
if (value.values !== undefined) {
64+
if (!isRecord(value.values) || Object.values(value.values).some((entry) => typeof entry !== "string")) {
65+
throw new Error("Phase result values must be string-valued")
66+
}
67+
}
68+
if (value.error !== undefined) {
69+
if (!isRecord(value.error) || typeof value.error.message !== "string") {
70+
throw new Error("Invalid phase result error")
71+
}
72+
if (value.error.stack !== undefined && typeof value.error.stack !== "string") {
73+
throw new Error("Invalid phase result error stack")
74+
}
75+
}
76+
}
77+
78+
export async function writePhaseResult(resultsDir: string, result: PhaseResult): Promise<void> {
79+
validatePhaseResult(result)
80+
const targetPath = getPhaseResultPath(resultsDir, result.phase)
81+
const temporaryPath = `${targetPath}.${process.pid}.${Date.now()}.tmp`
82+
try {
83+
await writeJsonAtomically(temporaryPath, result)
84+
await fs.rename(temporaryPath, targetPath)
85+
} finally {
86+
await fs.rm(temporaryPath, { force: true })
87+
}
88+
}
89+
90+
async function writeJsonAtomically(filePath: string, value: PhaseResult): Promise<void> {
91+
await fs.mkdir(path.dirname(filePath), { recursive: true })
92+
await new Promise<void>((resolve, reject) => {
93+
const stream = createWriteStream(filePath, { encoding: "utf8" })
94+
stream.once("error", reject)
95+
stream.once("finish", resolve)
96+
stream.end(JSON.stringify(value))
97+
})
98+
}
99+
100+
export async function readPhaseResult(resultsDir: string, phase: RestartPhase): Promise<PhaseResult> {
101+
const result = JSON.parse(await fs.readFile(getPhaseResultPath(resultsDir, phase), "utf8")) as unknown
102+
validatePhaseResult(result)
103+
if (result.phase !== phase) {
104+
throw new Error(`Phase result does not match requested phase: ${phase}`)
105+
}
106+
return result
107+
}
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
import * as os from "os"
2+
import * as path from "path"
3+
import * as fs from "fs/promises"
4+
5+
const SCENARIO_ROOT_PREFIX = "roo-vscode-e2e-restart-"
6+
7+
export type ScenarioWorkspace = {
8+
root: string
9+
workspace: string
10+
userData: string
11+
extensions: string
12+
results: string
13+
}
14+
15+
function childPath(root: string, name: string): string {
16+
const resolvedRoot = path.resolve(root)
17+
const resolvedChild = path.resolve(resolvedRoot, name)
18+
if (path.dirname(resolvedChild) !== resolvedRoot) {
19+
throw new Error(`Scenario path escaped its root: ${name}`)
20+
}
21+
return resolvedChild
22+
}
23+
24+
export async function createScenarioWorkspace(): Promise<ScenarioWorkspace> {
25+
const root = await fs.mkdtemp(path.join(os.tmpdir(), SCENARIO_ROOT_PREFIX))
26+
const scenarioWorkspace: ScenarioWorkspace = {
27+
root,
28+
workspace: childPath(root, "workspace"),
29+
userData: childPath(root, "user-data"),
30+
extensions: childPath(root, "extensions"),
31+
results: childPath(root, "results"),
32+
}
33+
34+
await Promise.all(
35+
[
36+
scenarioPath(scenarioWorkspace, "workspace"),
37+
scenarioPath(scenarioWorkspace, "userData"),
38+
scenarioPath(scenarioWorkspace, "extensions"),
39+
scenarioPath(scenarioWorkspace, "results"),
40+
].map((directory) => fs.mkdir(directory, { recursive: true })),
41+
)
42+
43+
return scenarioWorkspace
44+
}
45+
46+
function scenarioPath(scenarioWorkspace: ScenarioWorkspace, key: "workspace" | "userData" | "extensions" | "results") {
47+
return scenarioWorkspace[key]
48+
}
49+
50+
export async function removeScenarioWorkspace(scenarioWorkspace: ScenarioWorkspace): Promise<void> {
51+
const root = path.resolve(scenarioWorkspace.root)
52+
const tempRoot = path.resolve(os.tmpdir())
53+
if (path.dirname(root) !== tempRoot || !path.basename(root).startsWith(SCENARIO_ROOT_PREFIX)) {
54+
throw new Error(`Refusing to remove an unowned scenario root: ${scenarioWorkspace.root}`)
55+
}
56+
57+
await fs.rm(root, { recursive: true, force: true })
58+
}
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
import { spawn } from "child_process"
2+
import * as path from "path"
3+
4+
import { readPhaseResult, type RestartPhase, type PhaseResult } from "./phaseProtocol"
5+
import type { ScenarioWorkspace } from "./scenarioWorkspace"
6+
7+
export type RestartCoordinatorOptions = {
8+
vscodeExecutablePath: string
9+
extensionDevelopmentPath: string
10+
extensionTestsPath: string
11+
scenario: string
12+
workspace: ScenarioWorkspace
13+
environment: NodeJS.ProcessEnv
14+
expectedExitPolicies: readonly ExpectedExitPolicy[]
15+
}
16+
17+
export type ExpectedExitPolicy = {
18+
phase: RestartPhase
19+
termination: "graceful-quit"
20+
code: number
21+
signal: NodeJS.Signals | null
22+
}
23+
24+
function phaseEnvironment(options: RestartCoordinatorOptions, phase: RestartPhase): NodeJS.ProcessEnv {
25+
return {
26+
...options.environment,
27+
E2E_PHASE: phase,
28+
E2E_SCENARIO: options.scenario,
29+
E2E_RESULTS_DIR: options.workspace.results,
30+
}
31+
}
32+
33+
function phaseArguments(options: RestartCoordinatorOptions): string[] {
34+
return [
35+
options.workspace.workspace,
36+
`--user-data-dir=${options.workspace.userData}`,
37+
`--extensions-dir=${options.workspace.extensions}`,
38+
"--no-sandbox",
39+
"--disable-gpu-sandbox",
40+
"--disable-updates",
41+
"--skip-welcome",
42+
"--skip-release-notes",
43+
"--disable-workspace-trust",
44+
`--extensionTestsPath=${options.extensionTestsPath}`,
45+
`--extensionDevelopmentPath=${options.extensionDevelopmentPath}`,
46+
]
47+
}
48+
49+
async function runPhase(options: RestartCoordinatorOptions, phase: RestartPhase): Promise<PhaseResult> {
50+
const args = phaseArguments(options)
51+
console.log(`[restart:${phase}] spawning VS Code: ${path.basename(options.vscodeExecutablePath)}`)
52+
53+
const child = spawn(options.vscodeExecutablePath, args, {
54+
env: phaseEnvironment(options, phase),
55+
shell: process.platform === "win32",
56+
stdio: ["ignore", "pipe", "pipe"],
57+
})
58+
59+
child.stdout?.on("data", (chunk: Buffer) => process.stdout.write(`[restart:${phase}] ${chunk}`))
60+
child.stderr?.on("data", (chunk: Buffer) => process.stderr.write(`[restart:${phase}] ${chunk}`))
61+
62+
const exit = await new Promise<{ code: number | null; signal: NodeJS.Signals | null }>((resolve, reject) => {
63+
child.once("error", reject)
64+
child.once("close", (code, signal) => resolve({ code, signal }))
65+
})
66+
67+
const result = await readPhaseResult(options.workspace.results, phase)
68+
if (result.status !== "passed") {
69+
throw new Error(`[restart:${phase}] phase result was not passed: ${result.error?.message ?? "unknown failure"}`)
70+
}
71+
72+
const expectedExit = options.expectedExitPolicies.find((policy) => policy.phase === phase)
73+
const isExpectedNonzeroExit =
74+
exit.code !== 0 &&
75+
expectedExit !== undefined &&
76+
expectedExit.termination === "graceful-quit" &&
77+
exit.code === expectedExit.code &&
78+
exit.signal === expectedExit.signal
79+
const isSuccessfulExit = exit.code === 0 && exit.signal === null
80+
if (!isSuccessfulExit && !isExpectedNonzeroExit) {
81+
throw new Error(`[restart:${phase}] VS Code exited with ${exit.code ?? exit.signal}`)
82+
}
83+
84+
return result
85+
}
86+
87+
export async function runRestartScenario(options: RestartCoordinatorOptions): Promise<void> {
88+
await runPhase(options, "create")
89+
await runPhase(options, "verify")
90+
}

0 commit comments

Comments
 (0)