mirror of
https://github.com/MoonshotAI/kimi-code.git
synced 2026-09-12 14:36:39 +00:00
* feat(chat): preview files outside the workspace via host fs:content File preview is a local read-only action, so out-of-workspace absolute paths (chat/Markdown links, tool-call paths, turn-summary files) now read through the daemon's global fs:content instead of being refused with the outsideWorkspace error. The allowHostRead opt-in is removed entirely; workspace-level trust gating will land as a separate feature. * fix(chat): harden out-of-workspace preview reads - Lexically normalize absolute preview paths so an in-cwd path with ".." (src/../a.ts) keeps the session fs:read path (download / reveal / line count) instead of falling into the host-read branch. - Preserve the POSIX root when resolving relative links/images inside an out-of-workspace Markdown preview (/tmp/notes/a.md + ./b.md no longer resolves to the workspace-relative tmp/notes/b.md). - Cap readHostFileContent at 10 MiB (FileTooLargeError): fs:content has no truncation semantics and the body is decoded in full in the renderer, so an unbounded read could hang or OOM the app. The preview maps it to a dedicated too-large error state. * fix(chat): refuse oversized host reads early and load external markdown images - DaemonHttpClient.getBlob gains a maxBytes option that rejects at the Content-Length header (cancelling the body stream) instead of after the whole body is downloaded; readHostFileContent passes its 10 MiB cap through it, keeping the post-read check as the missing-header fallback. - resolveImageUrl now reads out-of-workspace absolute image paths via the host fs:content (base64 data URL), so relative images inside an external Markdown preview — and model-referenced /tmp images in chat — render instead of falling back to a same-origin URL that can never load. * fix(chat): handle Windows absolute paths in image and markdown-link resolution - resolveImageUrl classifies any local absolute path (POSIX, Windows drive, UNC) instead of POSIX-only: in-cwd ones relativize via pathRelativeTo for the session fs:read (in-workspace Windows absolute images render too now), outside ones read via the host fs:content. - The Markdown preview's link/image resolvers pass Windows-drive and UNC absolute targets through unchanged instead of拼接ing them onto the current file's directory (C:/tmp/b.md no longer becomes C:/notes/C:/tmp/b.md). |
||
|---|---|---|
| .. | ||
| agent-event-projector.test.ts | ||
| apply-event-slices.test.ts | ||
| apply-record-diff.test.ts | ||
| ask-user-tool-parse.test.ts | ||
| attachment-upload.test.ts | ||
| chat-turn-rendering.test.ts | ||
| clipboard.test.ts | ||
| composer-draft.test.ts | ||
| confirm-dialog.test.ts | ||
| daemon-client.test.ts | ||
| detail-panel-toggle.test.ts | ||
| event-batcher.test.ts | ||
| event-reducer.test.ts | ||
| index-html.test.ts | ||
| input-history.test.ts | ||
| lib-logic.test.ts | ||
| log.test.ts | ||
| mention-menu.test.ts | ||
| notification-logic.test.ts | ||
| open-file-attachment.test.ts | ||
| pinned-sessions.test.ts | ||
| planUsage.test.ts | ||
| riveInputs.test.ts | ||
| server-auth.test.ts | ||
| session-work-reconnect.test.ts | ||
| side-chat.test.ts | ||
| slash-menu.test.ts | ||
| storage-logic.test.ts | ||
| swarm-card-rows.test.ts | ||
| swarm-groups.test.ts | ||
| swarm-result.test.ts | ||
| task-poller.test.ts | ||
| tool-args.test.ts | ||
| trace.test.ts | ||
| turn-files-summary.test.ts | ||
| turn-injection-boundary.test.ts | ||
| turn-logic.test.ts | ||
| turns-projector.test.ts | ||
| useOAuthLoginFlow.test.ts | ||
| useUpdateStatus.test.ts | ||
| workspace-order.test.ts | ||
| workspace-state.test.ts | ||
| ws-lifecycle.test.ts | ||