Skip to content

Commit 5b41835

Browse files
authored
Merge branch 'main' into fix/mcp-hub-test-ordering
2 parents 6e987c3 + 0306f2b commit 5b41835

97 files changed

Lines changed: 3634 additions & 411 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.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"zoo-code": minor
3+
---
4+
5+
Add settings to control whether editor tabs Zoo opens during diff edits are auto-closed after accept/reject: auto-close transiently-opened files, auto-close even after user interaction (a refinement of the first), and auto-close newly created files.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
"zoo-code": patch
3+
---
4+
5+
Fix diff view scroll position and tab handling when applying edits. The diff now opens scrolled to the first changed line (including end-of-file removals, which are clamped to a valid line in the modified document) instead of forcing the viewport to the top. After accepting or rejecting a diff, files that were already open are restored to their pre-edit scroll position, and files that were not open before the edit have their transiently opened tab closed -- unless the user activated that tab during the diff, in which case it is kept open. Focus is no longer pulled back to the edited file when the user has navigated elsewhere. A file that was open in a preview tab is restored in a preview tab with the original scroll position, even if the target file replaced the preview tab and was automatically closed after the diff was accepted or rejected. A file that was pinned before the edit is re-pinned after the diff closes, so applying a diff no longer drops the tab's pinned state.
6+
7+
When a user clicks or edits inside the diff pane, the target file's tab is kept open after saving -- even if it was not previously open. If the user only scrolls in the diff pane, the existing close behavior is preserved. When the target file is re-revealed after a diff, it scrolls to the position most recently viewed by the user: if the user last scrolled in the diff pane, the target file mirrors that scroll position; if the user last scrolled in the target file's own editor, that position is used instead; otherwise the pre-edit scroll position is restored.

.changeset/fix-multiline-quoted-command-parsing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ Quote masking is comment-aware: a quote character inside a `#` comment is not pa
1414

1515
**Pattern selector (UI)**: the command pattern breakdown shown after execution now uses the same heredoc- and quote-aware parser (`parseCommand`) before extracting patterns, so an unterminated or terminated heredoc no longer produces spurious tokens like `EOF`, body-line words, or `<<` fragments in the allow/deny selector.
1616

17-
Note: this change only prevents *auto-approval* of fragments from a malformed command; it does not reject malformed commands before execution, which will be addressed in a separate PR to keep the scope focused here.
17+
Note: this change only prevents _auto-approval_ of fragments from a malformed command; it does not reject malformed commands before execution, which will be addressed in a separate PR to keep the scope focused here.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ for this exact support, so if you are having problems or if you have question, j
8989
- [简体中文](locales/zh-CN/README.md)
9090
- [繁體中文](locales/zh-TW/README.md)
9191
- ...
92-
</details>
92+
</details>
9393

9494
---
9595

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
"tar-fs": ">=3.1.1",
6161
"esbuild": "0.28.1",
6262
"rollup": "4.60.4",
63-
"vite": "8.0.14",
63+
"vite": "8.0.16",
6464
"undici": ">=5.29.0",
6565
"form-data": ">=4.0.4",
6666
"bluebird": ">=3.7.2",

packages/types/src/global-settings.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,9 @@ export const globalSettingsSchema = z.object({
180180
execaShellPath: z.string().optional(),
181181

182182
diagnosticsEnabled: z.boolean().optional(),
183+
autoCloseZooOpenedFiles: z.boolean().optional(),
184+
autoCloseZooOpenedFilesAfterUserEdited: z.boolean().optional(),
185+
autoCloseZooOpenedNewFiles: z.boolean().optional(),
183186

184187
rateLimitSeconds: z.number().optional(),
185188
experiments: experimentsSchema.optional(),

packages/types/src/vscode-extension-host.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,9 @@ export type ExtensionState = Pick<
282282
| "terminalProfile"
283283
| "execaShellPath"
284284
| "diagnosticsEnabled"
285+
| "autoCloseZooOpenedFiles"
286+
| "autoCloseZooOpenedFilesAfterUserEdited"
287+
| "autoCloseZooOpenedNewFiles"
285288
| "language"
286289
| "modeApiConfigs"
287290
| "customModePrompts"

pnpm-lock.yaml

Lines changed: 119 additions & 119 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/api/providers/__tests__/unbound.spec.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,4 +181,24 @@ describe("UnboundHandler", () => {
181181
}),
182182
)
183183
})
184+
185+
it("completePrompt returns the response text", async () => {
186+
const mockCreate = (OpenAI as unknown as any)().chat.completions.create
187+
mockCreate.mockResolvedValue({
188+
choices: [{ message: { content: "completed text" } }],
189+
})
190+
191+
const handler = new UnboundHandler({
192+
unboundApiKey: "test-key",
193+
unboundModelId: "openai/gpt-4o",
194+
})
195+
196+
const result = await handler.completePrompt("Write a haiku")
197+
expect(result).toBe("completed text")
198+
expect(mockCreate).toHaveBeenCalledWith(
199+
expect.objectContaining({
200+
messages: [{ role: "system", content: "Write a haiku" }],
201+
}),
202+
)
203+
})
184204
})

src/api/providers/anthropic-vertex.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ export class AnthropicVertexHandler extends BaseProvider implements SingleComple
7171
messages: Anthropic.Messages.MessageParam[],
7272
metadata?: ApiHandlerCreateMessageMetadata,
7373
): ApiStream {
74-
let { id, info, temperature, maxTokens, reasoning: thinking, betas } = this.getModel()
74+
const { id, info, temperature, maxTokens, reasoning: thinking, betas } = this.getModel()
7575

7676
const { supportsPromptCache } = info
7777

@@ -210,7 +210,7 @@ export class AnthropicVertexHandler extends BaseProvider implements SingleComple
210210

211211
getModel() {
212212
const modelId = this.options.apiModelId
213-
let id = modelId && modelId in vertexModels ? (modelId as VertexModelId) : vertexDefaultModelId
213+
const id = modelId && modelId in vertexModels ? (modelId as VertexModelId) : vertexDefaultModelId
214214
let info: ModelInfo = vertexModels[id]
215215

216216
// Check if 1M context beta should be enabled for supported models
@@ -270,7 +270,7 @@ export class AnthropicVertexHandler extends BaseProvider implements SingleComple
270270

271271
async completePrompt(prompt: string) {
272272
try {
273-
let {
273+
const {
274274
id,
275275
info: { supportsPromptCache },
276276
temperature,

0 commit comments

Comments
 (0)