Skip to content

Architecture Runtime Flow

YarCraSy edited this page Jul 8, 2026 · 3 revisions

Runtime Flow

Activation

  1. VS Code activates the extension from the contributions declared in package.json.
  2. src/Extension.ts creates the VS Code tool host.
  3. It registers WebviewProvider.viewType = "deepseek-copilot.chatView".
  4. It registers DropZoneProvider.
  5. It registers the openChat and addSelectionToChat commands.

Opening the chat

  1. VS Code resolves the deepseek-copilot.chatView view.
  2. WebviewProvider loads HTML from dist/webview.
  3. The React UI starts with vscodeApi.
  4. The UI requests configuration, history, and available tools.

User message

  1. The UI sends sendMessage.
  2. WebviewProvider delegates to ChatHandler.
  3. ChatHandler loads settings and API key.
  4. A direct DeepSeek provider is created.
  5. Conversation context is built.
  6. Streaming or full response execution starts.
  7. The backend sends streamChunk, streamReasoning, streamDone, or streamError.
  8. HistoryManager persists the conversation.

Tool calls

  1. DeepSeek emits tool calls.
  2. ToolCallSession evaluates metadata and execution mode.
  3. If the tool is dangerous, it sends toolCallConfirmationRequired.
  4. The UI asks for human confirmation.
  5. ToolExecutor runs using the injected ToolWorkspace.
  6. The result goes back to DeepSeek or is shown in the UI depending on the cycle.

Drag and drop

  1. The user drags files into the drop zone or input.
  2. UI/backend sends processFileDrop.
  3. WebviewProvider resolves URIs.
  4. It returns fileDropResult with previews/context.
  5. The chat can include those files as referenced context.

Clone this wiki locally