Skip to content

feat: complete SDK features — Hooks, MCP timeout, Image vision (#49, #51, #52)#92

Merged
devartifex merged 2 commits into
masterfrom
feat/sdk-features-49-51-52
Mar 14, 2026
Merged

feat: complete SDK features — Hooks, MCP timeout, Image vision (#49, #51, #52)#92
devartifex merged 2 commits into
masterfrom
feat/sdk-features-49-51-52

Conversation

@devartifex

Copy link
Copy Markdown
Owner

Summary

Completes 3 SDK feature issues from the feature audit.

Issue #49 — SDK Hooks: Complete Implementation

  • Added missing onUserPromptSubmitted hook to buildSessionHooks() (6th of 6 SDK hooks now wired)
  • Fixed resumeSession() not passing hooks — hook events now fire correctly after session resume
  • Added HookUserPromptMessage type and updated HookMessage/ServerMessage unions
  • Added unit tests for the new hook

Issue #51 — MCP Servers: Timeout Support

  • Added timeout?: number field to McpServerDefinition and McpServerInput types
  • Updated buildUserMcpServers() to conditionally pass timeout to SDK
  • Added timeout validation in parseMcpServers() (positive, max 300000ms, rounded to integer)
  • Added timeout input field in SettingsModal (both add and edit forms)
  • Updated isValidMcpServer() client-side validation
  • Added 6 new tests (1 session builder + 5 parser tests)

Issue #52 — Image Input: Vision Check + Thumbnails

  • Added vision capability warning when attaching images to non-vision models
  • Added 28×28 image thumbnail previews in ChatInput file chips (with URL.revokeObjectURL cleanup)
  • Extracted isImageFile()/hasImageAttachments() utilities in src/lib/utils/image.ts
  • Derived supportsVision from model capabilities in +page.svelte
  • Added 8 unit tests for image utilities

Validation

  • svelte-check: 0 errors, 0 warnings
  • npm run build: success
  • npm run test:unit: 321/321 tests passing (14 new tests added)

Files Changed (11 files)

Layer Files
Types src/lib/types/index.ts
Server src/lib/server/copilot/session.ts, src/lib/server/ws/handler.ts
Stores src/lib/stores/settings.svelte.ts
Components src/lib/components/ChatInput.svelte, src/lib/components/SettingsModal.svelte
Pages src/routes/+page.svelte
Utilities src/lib/utils/image.ts (new)
Tests session.test.ts, parse-mcp-servers.test.ts, image.test.ts (new)

Closes #49, closes #51, closes #52

devartifex and others added 2 commits March 14, 2026 19:16
Add optional timeout field throughout the MCP server stack:
- McpServerDefinition type (timeout?: number)
- McpServerInput interface and buildUserMcpServers() pass-through
- parseMcpServers() validation (positive number, max 300000ms)
- isValidMcpServer() client-side validation
- SettingsModal UI: timeout input in both add and edit forms
- Tests for session builder and parser timeout handling

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add vision capability checking and image thumbnail previews in ChatInput:
- Warn when attaching images to models without vision support
- Show 28x28 thumbnail previews for image files in attachment chips
- Extract isImageFile/hasImageAttachments utilities with 8 unit tests
- Derive supportsVision from model capabilities in +page.svelte

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@devartifex devartifex merged commit dde5b95 into master Mar 14, 2026
8 of 10 checks passed
@devartifex devartifex deleted the feat/sdk-features-49-51-52 branch March 25, 2026 19:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

1 participant