# https://github.com/continuedev/continue 项目说明书

生成时间：2026-05-16 04:20:22 UTC

## 目录

- [Architecture Overview](#architecture-overview)
- [Protocol and Communication](#protocol-communication)
- [Core Library](#core-library)
- [IDE Extensions](#ide-extensions)
- [CLI Tool](#cli-tool)
- [Model Providers and LLM Integration](#model-providers)
- [Chat and Agent System](#chat-system)
- [Autocomplete System](#autocomplete)
- [Next Edit Feature](#next-edit)
- [Configuration System](#config-system)

<a id='architecture-overview'></a>

## Architecture Overview

### 相关页面

相关主题：[Protocol and Communication](#protocol-communication), [Core Library](#core-library)

<details>
<summary>相关源码文件</summary>

以下源码文件用于生成本页说明：

- [gui/src/components/StyledMarkdownPreview/utils/patchNestedMarkdown.ts](https://github.com/continuedev/continue/blob/main/gui/src/components/StyledMarkdownPreview/utils/patchNestedMarkdown.ts)
- [extensions/cli/src/systemMessage.ts](https://github.com/continuedev/continue/blob/main/extensions/cli/src/systemMessage.ts)
- [gui/src/redux/slices/sessionSlice.ts](https://github.com/continuedev/continue/blob/main/gui/src/redux/slices/sessionSlice.ts)
- [extensions/cli/src/slashCommands.ts](https://github.com/continuedev/continue/blob/main/extensions/cli/src/slashCommands.ts)
- [packages/config-yaml/src/interfaces/SecretResult.ts](https://github.com/continuedev/continue/blob/main/packages/config-yaml/src/interfaces/SecretResult.ts)
- [gui/src/pages/stats.tsx](https://github.com/continuedev/continue/blob/main/gui/src/pages/stats.tsx)
- [README.md](https://github.com/continuedev/continue/blob/main/README.md)
</details>

# Architecture Overview

Continue is an open-source AI coding assistant that integrates with various IDEs and provides AI-powered code checks, autocompletion, and chat capabilities. This document provides a comprehensive overview of the system's architecture, component organization, and data flow.

## System Architecture

Continue follows a modular, multi-layer architecture designed to support multiple IDE integrations, deployment modes, and AI model providers.

### High-Level Architecture

```mermaid
graph TD
    subgraph Client["Client Layer"]
        IDE[IntelliJ IDE Plugin]
        VSCode[VS Code Extension]
        CLI[Continue CLI]
    end
    
    subgraph Core["Core Services"]
        Chat[Chat Service]
        Autocomplete[Autocomplete Service]
        Checks[AI Checks Service]
    end
    
    subgraph Model["Model Integration"]
        LLM[LLM Providers]
        MCP[Model Context Protocol]
    end
    
    IDE --> Core
    VSCode --> Core
    CLI --> Core
    Core --> LLM
    Core --> MCP
```

### Key Architectural Layers

| Layer | Purpose | Technologies |
|-------|---------|--------------|
| **Client Layer** | IDE integrations and user interfaces | TypeScript, React |
| **Core Layer** | Business logic, session management, AI orchestration | TypeScript, Redux |
| **Model Layer** | LLM provider abstraction, MCP integration | TypeScript |
| **Configuration Layer** | Secret management, profile configuration | YAML, TypeScript |

## Directory Structure

The repository follows a monorepo structure:

```
continue/
├── core/                  # Core business logic
├── gui/                   # Web-based UI components
│   └── src/
│       ├── components/    # React components
│       ├── pages/         # Page components
│       └── redux/         # State management
├── extensions/            # IDE and CLI extensions
│   ├── cli/              # Command-line interface
│   ├── intellij/         # IntelliJ plugin
│   └── vscode/           # VS Code extension
└── packages/             # Shared libraries
    └── config-yaml/      # Configuration utilities
```

## Core Components

### Session Management

The session system manages chat sessions, history, and metadata. It uses Redux for state management with a dedicated session slice.

```mermaid
graph LR
    A[User Input] --> B[Session Slice]
    B --> C[allSessionMetadata]
    B --> D[currentSession]
    B --> E[title]
```

**Session Slice Actions** (资料来源：[gui/src/redux/slices/sessionSlice.ts:1-100]())

| Action | Purpose |
|--------|---------|
| `addSessionMetadata` | Add new session metadata to history |
| `updateSessionMetadata` | Update existing session metadata |
| `deleteSessionMetadata` | Remove session from history |
| `setTitle` | Update current session title |
| `setAllSessionMetadata` | Bulk update session list |

The slice maintains:
- `allSessionMetadata`: Array of all session metadata
- `id`: Current session ID
- `title`: Current session title
- `history`: Chat history for current session

### Markdown Processing

The `patchNestedMarkdown` utility handles nested code blocks in markdown content, converting markdown-specific code block delimiters to prevent rendering conflicts.

```mermaid
graph TD
    A[Input String] --> B{Match md/markdown/gfm?}
    B -->|No| C[Return Original]
    B -->|Yes| D[Initialize State Tracker]
    D --> E[Process Lines]
    E --> F{Bare Backticks?}
    F -->|Yes| G[Convert to Tildes]
    F -->|No| H[Next Line]
    G --> I{Last Delimiter?}
    I -->|Yes| J[Close Block]
    I -->|No| H
    H --> E
```

Key features (资料来源：[gui/src/components/StyledMarkdownPreview/utils/patchNestedMarkdown.ts:1-50]()):

- Early return optimization for non-markdown content
- `MarkdownBlockStateTracker` for efficient line analysis
- Handles GitHub-specific variants: `gfm`, `github-markdown`
- Converts ` ``` ` to `~~~` for nested blocks

### CLI Slash Commands

The CLI provides numerous slash commands for various operations:

| Command | Action | Description |
|---------|--------|-------------|
| `/clear` | `{ clear: true }` | Clear chat history |
| `/exit` | `{ exit: true }` | Exit the session |
| `/config` | `{ openConfigSelector: true }` | Open config selector |
| `/login` | - | Handle login flow |
| `/model` | `{ openModelSelector: true }` | Open model selector |
| `/compact` | `{ compact: true }` | Compact session history |
| `/mcp` | `{ openMcpSelector: true }` | Open MCP selector |
| `/resume` | `{ openSessionSelector: true }` | Resume previous session |
| `/title` | - | Update session title |
| `/init` | - | Initialize new project |
| `/jobs` | - | List background jobs |
| `/skills` | - | Manage skills |
| `/sessions` | - | List sessions |
| `/export` | - | Export session data |
| `/import` | - | Import session data |

资料来源：[extensions/cli/src/slashCommands.ts:1-80]()

### System Message Composition

The system message is dynamically composed based on execution context:

```mermaid
graph TD
    A[Base System Message] --> B{headless mode?}
    B -->|Yes| C[Add Headless Instructions]
    B -->|No| D{format === json?}
    D -->|Yes| E[Add JSON Instructions]
    D -->|No| F{agentContent/rules?}
    F -->|Yes| G[Add Rules Section]
    F -->|No| H[Final Message]
    C --> H
    E --> H
    G --> H
```

**Message Components** (资料来源：[extensions/cli/src/systemMessage.ts:1-60]()):

| Mode | Instruction Type |
|------|------------------|
| Headless | "Provide ONLY your final answer" |
| JSON | "Your final response MUST be valid JSON" |
| Rules | User-defined agent content and rules |

## Configuration System

### Secret Management

The `SecretResult` interface provides encoding and decoding for various secret types:

```typescript
enum SecretType {
  Organization,
  User,
  Package,
  NotFound,
  ModelsAddOn,
  FreeTrial,
  LocalEnv,
  ProcessEnv
}
```

**Secret Location Encoding** (资料来源：[packages/config-yaml/src/interfaces/SecretResult.ts:1-80]()):

| Secret Type | Format |
|-------------|--------|
| Organization | `Organization:orgSlug/secretName` |
| User | `User:userSlug/secretName` |
| Package | `Package:ownerSlug/packageSlug/secretName` |
| LocalEnv | `LocalEnv:secretName` |
| ProcessEnv | `ProcessEnv:secretName` |

### Model Configuration

Models are organized by role:

| Role | Purpose |
|------|---------|
| `chat` | General conversation and code assistance |
| `autocomplete` | Inline code completion as you type |
| `edit` | Transform selected code sections |

Each model can have configuration status:
- `VALID`: Properly configured
- `MISSING_API_KEY`: API key not set
- `MISSING_ENV_SECRET`: Required environment variable missing

资料来源：[gui/src/pages/config/sections/ModelsSection.tsx:1-60]()

## Statistics and Usage Tracking

The stats page displays token usage data (资料来源：[gui/src/pages/stats.tsx:1-80]()):

**Token Tracking Tables:**

| Table | Columns | Purpose |
|-------|---------|---------|
| Daily Usage | Day, Generated Tokens, Prompt Tokens | Daily consumption |
| Per-Model | Model, Generated Tokens, Prompt Tokens | Breakdown by model |

Data is formatted with locale-aware number formatting for readability.

## Error Handling

The `FatalErrorNotice` component provides graceful error handling:

```mermaid
graph TD
    A[Error State] --> B{configLoading?}
    B -->|Yes| C[Show "Reloading..."]
    B -->|No| D[Show Actions]
    D --> E[View Config Page]
    D --> F[Open Docs]
    D --> G[Reload]
```

Actions available (资料来源：[gui/src/components/config/FatalErrorNotice.tsx:1-50]()):
- **View**: Navigate to configuration page
- **Help**: Open documentation troubleshooting page
- **Reload**: Refresh profiles

## Extension Architecture

### IntelliJ Plugin

The IntelliJ extension loads the GUI in a webview with IDE detection:

```html
<script>
  localStorage.setItem("ide", '"jetbrains"');
</script>
```

资料来源：[extensions/intellij/src/main/resources/webview/index.html:1-20]()

### CLI Extension

The CLI provides headless operation with:
- Commit signature generation
- JSON output mode
- Headless mode for automation
- Session resumption

## Data Flow

```mermaid
graph TD
    subgraph Input["Input Processing"]
        UserInput[User Input]
        SlashCmd[Slash Commands]
    end
    
    subgraph Processing["Processing Layer"]
        Dispatcher[Action Dispatcher]
        Reducer[Session Reducer]
        Rules[Rules Processor]
    end
    
    subgraph Output["Output Layer"]
        UI[UI Components]
        API[External APIs]
        FS[File System]
    end
    
    UserInput --> Dispatcher
    SlashCmd --> Dispatcher
    Dispatcher --> Reducer
    Reducer --> Rules
    Rules --> UI
    Rules --> API
    Rules --> FS
```

## Summary

Continue's architecture is designed for:

1. **Modularity**: Clear separation between UI, core logic, and integrations
2. **Extensibility**: Support for multiple IDEs and model providers
3. **State Management**: Redux-based centralized state with session tracking
4. **Security**: Secret management with encoding/decoding utilities
5. **User Experience**: Graceful error handling and helpful status indicators

The system supports both GUI-based usage through IDE extensions and headless CLI operation for CI/CD integration, making it suitable for individual development and team enforcement workflows.

---

<a id='protocol-communication'></a>

## Protocol and Communication

### 相关页面

相关主题：[Architecture Overview](#architecture-overview), [Core Library](#core-library)

<details>
<summary>相关源码文件</summary>

以下源码文件用于生成本页说明：

- [core/protocol/core.ts](https://github.com/continuedev/continue/blob/main/core/protocol/core.ts)
- [core/protocol/ide.ts](https://github.com/continuedev/continue/blob/main/core/protocol/ide.ts)
- [core/protocol/messenger/index.ts](https://github.com/continuedev/continue/blob/main/core/protocol/messenger/index.ts)
- [binary/src/IpcIde.ts](https://github.com/continuedev/continue/blob/main/binary/src/IpcIde.ts)
</details>

# Protocol and Communication

## Overview

The Continue codebase implements a sophisticated inter-process communication (IPC) protocol system that enables seamless communication between the Continue core engine and various IDE integrations (VS Code, JetBrains, etc.). This protocol layer abstracts the underlying transport mechanisms while providing a type-safe, event-driven communication architecture.

The communication system is built around three core concepts:

1. **Protocol Definitions** - Type-safe interfaces defining the contract between components
2. **Messenger System** - The message passing infrastructure with callbacks and event handling
3. **IPC Transport** - Platform-specific implementations (Electron IPC, WebViews, etc.)

```mermaid
graph TD
    A[IDE Extension] -->|IPC Bridge| B[Binary/Core]
    C[Continue Core] -->|Messenger| B
    D[GUI Components] -->|Protocol Messages| C
    B -->|Transport Layer| E[Platform IPC]
```

## Core Protocol Definitions

### Protocol Message Structure

The core protocol defines the fundamental message envelope used throughout the communication system. All messages share a common structure that includes metadata for routing, identification, and error handling.

| Field | Type | Description |
|-------|------|-------------|
| `messageId` | `string` | Unique identifier for message tracking |
| `type` | `MessageType` | Enumerated message type |
| `payload` | `any` | Message data payload |
| `timestamp` | `number` | Unix timestamp of message creation |
| `source` | `string` | Origin component identifier |
| `target` | `string` | Destination component identifier |

资料来源：[core/protocol/core.ts:1-50]()

### Message Type Categories

The protocol distinguishes between several categories of messages:

**Event Messages** - Fire-and-forget notifications about state changes or actions:
- Used for UI updates, progress notifications, and logging
- No response expected

**Request-Response Messages** - Pairs with callback mechanisms:
- Includes correlation ID for matching responses
- Supports timeout handling

**Streaming Messages** - Chunked data transfers:
- Used for large code generation, file transfers
- Includes sequence numbering for ordering

资料来源：[core/protocol/core.ts:51-100]()

## IDE Protocol

The IDE protocol defines the interface contract between Continue and the host IDE. This abstraction allows the core logic to remain IDE-agnostic while enabling platform-specific implementations.

### IdeProtocol Interface

```typescript
interface IdeProtocol {
  // File System Operations
  readFile(path: string): Promise<string>;
  writeFile(path: string, content: string): Promise<void>;
  getOpenFiles(): Promise<string[]>;
  
  // Editor Operations
  getFileContents(filepath: string): Promise<string>;
  highlightCode(filepath: string, range: Range): Promise<void>;
  
  // UI Operations
  showNotification(message: string, type: NotificationType): void;
  openUrl(url: string): void;
  
  // Context Retrieval
  getGitRoot(): Promise<string>;
  getWorkspaceDirs(): Promise<string[]>;
}
```

资料来源：[core/protocol/ide.ts:1-60]()

### Supported IDE Operations

| Category | Operations | Description |
|----------|------------|-------------|
| **File System** | `readFile`, `writeFile`, `createFile`, `deleteFile` | Direct file manipulation |
| **Navigation** | `getOpenFiles`, `getCurrentFile`, `showInEditor` | Editor state queries |
| **Git Integration** | `getGitRoot`, `getDiff`, `getBranch` | Version control operations |
| **Terminal** | `runCommand`, `getCwd` | Shell execution |
| **UI** | `showNotification`, `openUrl`, `getIdeInfo` | User interface interactions |

资料来源：[core/protocol/ide.ts:61-120]()

## Messenger System

The messenger provides the core messaging infrastructure for Continue. It manages callback registration, message dispatching, and response handling in a type-safe manner.

### Messenger Architecture

```mermaid
graph LR
    A[Message Producer] -->|post| B[Messenger Core]
    B -->|dispatch| C[Registered Callbacks]
    D[Response Handler] -->|correlate| B
    B -->|respond| A
```

### Core Messenger Methods

| Method | Signature | Description |
|--------|-----------|-------------|
| `post` | `(message: ProtocolMessage) => void` | Send a message without expecting response |
| `request` | `(message: ProtocolMessage) => Promise<Response>` | Send message and wait for response |
| `on` | `(type: string, callback: Handler) => void` | Register a callback for message type |
| `off` | `(type: string, callback: Handler) => void` | Unregister a callback |
| `once` | `(type: string, callback: Handler) => void` | Register one-time callback |

资料来源：[core/protocol/messenger/index.ts:1-80]()

### Callback Registration Pattern

The messenger uses a callback-based pattern for handling incoming messages:

```typescript
// Register handler for specific message type
messenger.on('file-changed', async (message: FileChangedMessage) => {
  await handleFileChange(message.payload);
});

// Register with correlation for request-response
messenger.on('context-response', async (message: ContextResponse) => {
  const pending = pendingRequests.get(message.correlationId);
  if (pending) {
    pending.resolve(message.payload);
    pendingRequests.delete(message.correlationId);
  }
});
```

资料来源：[core/protocol/messenger/index.ts:81-150]()

### Message Flow

```mermaid
sequenceDiagram
    participant IDE as IDE Extension
    participant M as Messenger
    participant Core as Continue Core
    participant GUI as GUI Components
    
    IDE->>M: post(message)
    M->>Core: dispatch(message)
    Core->>M: post(response)
    M->>IDE: deliver(response)
    
    GUI->>M: request(message)
    M->>Core: dispatch(message)
    Core-->>M: response
    M-->>GUI: resolve Promise
```

## IPC Transport Layer

The IPC (Inter-Process Communication) layer provides the actual transport mechanism for messages between the Continue core and IDE extensions. The binary component contains platform-specific implementations.

### IpcIde Implementation

The `IpcIde` class bridges the protocol layer with the underlying IPC mechanism:

```typescript
class IpcIde implements IdeProtocol {
  private transport: IpcTransport;
  private pendingRequests: Map<string, PendingRequest>;
  
  constructor(transport: IpcTransport) {
    this.transport = transport;
    this.setupMessageHandler();
  }
  
  private setupMessageHandler(): void {
    this.transport.onMessage((message) => {
      this.dispatchMessage(message);
    });
  }
}
```

资料来源：[binary/src/IpcIde.ts:1-50]()

### Transport Interface

| Method | Description |
|--------|-------------|
| `send(message: Uint8Array): void` | Send binary-encoded message |
| `onMessage(handler: MessageHandler): void` | Register incoming message handler |
| `close(): void` | Clean up transport resources |
| `isConnected(): boolean` | Check connection status |

资料来源：[binary/src/IpcIde.ts:51-100]()

### Message Serialization

Messages are serialized using Protocol Buffers or similar binary format for efficient transport:

```typescript
// Encode outgoing message
function encodeMessage(message: ProtocolMessage): Uint8Array {
  return protobuf.encode(ProtocolMessageSchema, message);
}

// Decode incoming message
function decodeMessage(buffer: Uint8Array): ProtocolMessage {
  return protobuf.decode(ProtocolMessageSchema, buffer);
}
```

资料来源：[binary/src/IpcIde.ts:101-150]()

## Communication Patterns

### Request-Response Pattern

Used for operations requiring a response before proceeding:

```mermaid
graph TD
    A[Caller] -->|1. Request| B[Messenger]
    B -->|2. Dispatch| C[Handler]
    C -->|3. Process| D[Result]
    D -->|4. Response| B
    B -->|5. Resolve| A
```

**Implementation:**

```typescript
async function request<T>(
  message: ProtocolMessage,
  timeout: number = 30000
): Promise<T> {
  const correlationId = generateId();
  const pending = new PendingPromise<T>();
  
  pendingRequests.set(correlationId, pending);
  
  setTimeout(() => {
    if (pendingRequests.has(correlationId)) {
      pending.reject(new TimeoutError());
      pendingRequests.delete(correlationId);
    }
  }, timeout);
  
  messenger.post({ ...message, correlationId });
  return pending.promise;
}
```

资料来源：[core/protocol/messenger/index.ts:151-200]()

### Event Subscription Pattern

Used for broadcasting state changes to multiple subscribers:

```typescript
// Subscribe to session updates
messenger.on('session-updated', (message: SessionUpdate) => {
  updateSessionUI(message.payload);
});

// Subscribe to tool execution events
messenger.on('tool-call', (message: ToolCallMessage) => {
  displayToolProgress(message.payload);
});
```

资料来源：[core/protocol/messenger/index.ts:201-250]()

### Streaming Pattern

Used for long-running operations with progress updates:

```typescript
messenger.on('streaming-response', (message: StreamChunk) => {
  // Accumulate chunks
  buffer += message.chunk;
  
  // Update UI with partial content
  updatePreview(buffer);
  
  if (message.isFinal) {
    processComplete(buffer);
  }
});
```

## Error Handling

### Error Message Types

| Error Type | Code | Description |
|------------|------|-------------|
| `TransportError` | `1000-1099` | IPC transport failures |
| `ProtocolError` | `2000-2099` | Malformed messages or protocol violations |
| `TimeoutError` | `3000-3099` | Request timeouts |
| `HandlerError` | `4000-4099` | Errors in message handlers |

### Error Recovery

The messenger implements automatic retry for transient failures:

```typescript
async function withRetry<T>(
  operation: () => Promise<T>,
  maxRetries: number = 3,
  backoff: number = 1000
): Promise<T> {
  let lastError: Error;
  
  for (let attempt = 0; attempt < maxRetries; attempt++) {
    try {
      return await operation();
    } catch (error) {
      lastError = error;
      if (!isRetryable(error)) throw error;
      await sleep(backoff * Math.pow(2, attempt));
    }
  }
  
  throw lastError;
}
```

资料来源：[core/protocol/messenger/index.ts:251-300]()

## Security Considerations

### Message Validation

All incoming messages undergo validation before processing:

1. **Schema Validation** - Verify message structure matches protocol definition
2. **Type Checking** - Ensure payload types are correct
3. **Size Limits** - Reject messages exceeding maximum size
4. **Source Verification** - Validate message origin

```typescript
function validateMessage(message: unknown): ValidationResult {
  if (!isObject(message)) {
    return { valid: false, error: 'Message must be an object' };
  }
  
  if (!isString(message.messageId)) {
    return { valid: false, error: 'Invalid messageId' };
  }
  
  if (message.payload && !isValidPayload(message.payload)) {
    return { valid: false, error: 'Invalid payload' };
  }
  
  return { valid: true };
}
```

资料来源：[core/protocol/core.ts:101-150]()

## Configuration Options

| Option | Type | Default | Description |
|--------|------|---------|-------------|
| `messageTimeout` | `number` | `30000` | Default timeout for request-response messages |
| `maxRetries` | `number` | `3` | Maximum retry attempts for failed messages |
| `maxMessageSize` | `number` | `10485760` | Maximum message size in bytes (10MB) |
| `enableLogging` | `boolean` | `false` | Enable message logging for debugging |

资料来源：[core/protocol/messenger/index.ts:301-350]()

## Integration with Redux

The GUI components integrate the messenger with Redux for state management:

```typescript
// Middleware connects messenger events to Redux actions
const messengerMiddleware = (messenger: Messenger) => (store) => {
  messenger.on('state-update', (message) => {
    store.dispatch(updateState(message.payload));
  });
  
  return (next) => (action) => {
    const result = next(action);
    if (isMessengerAction(action)) {
      messenger.post(actionToMessage(action));
    }
    return result;
  };
};
```

资料来源：[core/protocol/messenger/index.ts:351-400]()

## Summary

The Protocol and Communication system in Continue provides a robust, extensible messaging infrastructure that:

- **Abstraction Layer**: Separates business logic from transport mechanisms
- **Type Safety**: Uses TypeScript interfaces for compile-time safety
- **Async-First**: Built on Promises for non-blocking operations
- **Error Resilient**: Implements retry logic and timeout handling
- **Extensible**: New message types can be added without modifying core infrastructure

This architecture enables Continue to maintain compatibility across multiple IDE platforms while providing a consistent, reliable communication channel between all components.

---

<a id='core-library'></a>

## Core Library

### 相关页面

相关主题：[Model Providers and LLM Integration](#model-providers), [Configuration System](#config-system), [Chat and Agent System](#chat-system)

<details>
<summary>相关源码文件</summary>

以下源码文件用于生成本页说明：

- [core/llm/index.ts](https://github.com/continuedev/continue/blob/main/core/llm/index.ts)
- [core/config/ConfigHandler.ts](https://github.com/continuedev/continue/blob/main/core/config/ConfigHandler.ts)
- [core/indexing/CodebaseIndexer.ts](https://github.com/continuedev/continue/blob/main/core/indexing/CodebaseIndexer.ts)
- [core/tools/index.ts](https://github.com/continuedev/continue/blob/main/core/tools/index.ts)
- [core/context/retrieval/retrieval.ts](https://github.com/continuedev/continue/blob/main/core/context/retrieval/retrieval.ts)
</details>

# Core Library

The **Continue Core Library** (`/core`) is the central backend module of the Continue platform—a source-controlled AI coding assistant that runs as GitHub status checks on pull requests. It provides the foundational abstractions for LLM interaction, codebase indexing, tool execution, configuration management, and context retrieval.

## Architecture Overview

```mermaid
graph TD
    A[Continue Core] --> B[LLM Module]
    A --> C[Config Handler]
    A --> D[Codebase Indexer]
    A --> E[Tools System]
    A --> F[Context Retrieval]
    
    B --> G[Model Abstractions]
    C --> H[Profile Management]
    D --> I[Code Chunking]
    E --> J[Tool Registry]
    F --> K[Vector Search]
```

The Core Library serves as the backend engine powering both the GUI extensions (VS Code, JetBrains) and the standalone CLI (`cn`), enabling consistent AI-powered coding assistance across different IDE environments.

## Module Breakdown

### 1. LLM Module (`core/llm/index.ts`)

The LLM module provides the model abstraction layer for interacting with large language models.

| Component | Purpose |
|-----------|---------|
| `ILLM` interface | Defines contract for all LLM implementations |
| Model streaming | Handles real-time token generation |
| Token counting | Tracks prompt and completion tokens |
| Function calling | Supports structured output via tools |

**资料来源：** [core/llm/index.ts](https://github.com/continuedev/continue/blob/main/core/llm/index.ts)

The module supports multiple model providers and abstracts away provider-specific implementation details, allowing configuration-driven model selection.

### 2. Config Handler (`core/config/ConfigHandler.ts`)

The configuration system manages user preferences, model settings, and workspace-specific configurations.

```mermaid
graph LR
    A[config.ts] --> B[ConfigHandler]
    B --> C[Profiles]
    B --> D[Model Selection]
    B --> E[Rule Processing]
```

Key responsibilities include:
- Loading and validating configuration profiles
- Managing model assignments by role (chat, autocomplete, edit)
- Processing custom rules defined in `.continue/checks/`
- Handling secret/API key management

**资料来源：** [core/config/ConfigHandler.ts](https://github.com/continuedev/continue/blob/main/core/config/ConfigHandler.ts)

### 3. Codebase Indexer (`core/indexing/CodebaseIndexer.ts`)

The indexer builds and maintains a searchable representation of the codebase for context-aware retrieval.

| Feature | Description |
|---------|-------------|
| Code chunking | Splits files into semantically meaningful segments |
| Language detection | Identifies programming languages for specialized processing |
| Incremental updates | Re-indexes only changed portions of the codebase |
| Embedded retrieval | Generates vector embeddings for similarity search |

The indexer operates asynchronously and integrates with the retrieval system to provide relevant code context during conversations.

**资料来源：** [core/indexing/CodebaseIndexer.ts](https://github.com/continuedev/continue/blob/main/core/indexing/CodebaseIndexer.ts)

### 4. Tools System (`core/tools/index.ts`)

The tools module defines the available actions that can be performed by the LLM during agent execution.

**Core tool categories:**

| Category | Examples |
|----------|----------|
| File operations | Read, write, edit, delete files |
| Search | Grep, find, navigate code |
| Git operations | Commit, branch, diff |
| Shell commands | Execute terminal commands |
| Custom checks | User-defined validation rules |

Tools follow a standardized interface that allows new tools to be registered dynamically through configuration.

**资料来源：** [core/tools/index.ts](https://github.com/continuedev/continue/blob/main/core/tools/index.ts)

### 5. Context Retrieval (`core/context/retrieval/retrieval.ts`)

The retrieval system fetches relevant code context to augment LLM prompts.

```mermaid
graph TD
    A[Query] --> B[Retrieval Engine]
    B --> C[Vector Similarity]
    B --> D[Keyword Matching]
    C --> E[Hybrid Ranking]
    D --> E
    E --> F[Ranked Context]
    F --> G[Prompt Augmentation]
```

Retrieval strategies include:
- Dense vector embeddings via embeddings API
- Sparse keyword matching
- Hybrid approaches combining both methods
- Filtering by file type, path patterns, or recency

**资料来源：** [core/context/retrieval/retrieval.ts](https://github.com/continuedev/continue/blob/main/core/context/retrieval/retrieval.ts)

## CLI Integration

The Core Library powers the `cn` CLI for headless AI checks in CI/CD pipelines:

```bash
# Install CLI
npm i -g @continuedev

# Run headless check
cn check --pr <pr-number>
```

**Headless mode behavior:**
- Provides only final answers without explanations
- Operates in JSON output mode when required
- Includes commit signature generation in messages

**资料来源：** [extensions/cli/src/systemMessage.ts](https://github.com/continuedev/continue/blob/main/extensions/cli/src/systemMessage.ts)

## UI Components (Related)

While the Core Library handles backend logic, GUI components provide the user interface:

| Component | Purpose |
|-----------|---------|
| `IntroMessage` | Displays model and config status in terminal |
| `ModelCard` | Renders model selection cards |
| `ContextItemsPeek` | Shows context item previews |
| `patchNestedMarkdown` | Handles nested markdown code block rendering |

**资料来源：** [gui/src/components/StyledMarkdownPreview/utils/patchNestedMarkdown.ts](https://github.com/continuedev/continue/blob/main/gui/src/components/StyledMarkdownPreview/utils/patchNestedMarkdown.ts)

## Data Flow

```mermaid
sequenceDiagram
    participant User
    participant GUI as GUI/CLI
    participant Core as Core Library
    participant LLM as LLM Provider
    
    User->>GUI: Query/Action
    GUI->>Core: Process Request
    Core->>Core: Load Config
    Core->>Core: Retrieve Context
    Core->>LLM: Send Prompt
    LLM-->>Core: Response + Tool Calls
    Core->>Core: Execute Tools
    Core->>Core: Update Index
    Core-->>GUI: Result
    GUI-->>User: Display
```

## Summary

The Continue Core Library provides:

1. **Model Abstraction** - Unified interface for multiple LLM providers
2. **Configuration Management** - Flexible, profile-based settings
3. **Code Intelligence** - Indexing and semantic search capabilities
4. **Tool Execution** - Extensible action system for code operations
5. **Context Retrieval** - Hybrid search for relevant code snippets

This modular architecture enables Continue to operate consistently across different IDEs (VS Code, JetBrains) and environments (GUI, CLI), while providing a foundation for source-controlled AI checks in CI/CD pipelines.

---

<a id='ide-extensions'></a>

## IDE Extensions

### 相关页面

相关主题：[Protocol and Communication](#protocol-communication)

<details>
<summary>相关源码文件</summary>

以下源码文件用于生成本页说明：

- [extensions/vscode/src/extension.ts](https://github.com/continuedev/continue/blob/main/extensions/vscode/src/extension.ts)
- [extensions/vscode/src/autocomplete/completionProvider.ts](https://github.com/continuedev/continue/blob/main/extensions/vscode/src/autocomplete/completionProvider.ts)
- [extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/continue/IntelliJIde.kt](https://github.com/continuedev/continue/blob/main/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/continue/IntelliJIde.kt)
- [extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/autocomplete/ContinueInlineCompletionProvider.kt](https://github.com/continuedev/continue/blob/main/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/autocomplete/ContinueInlineCompletionProvider.kt)
- [gui/src/pages/config/sections/UserSettingsSection.tsx](https://github.com/continuedev/continue/blob/main/gui/src/pages/config/sections/UserSettingsSection.tsx)
- [gui/src/pages/config/sections/ModelsSection.tsx](https://github.com/continuedev/continue/blob/main/gui/src/pages/config/sections/ModelsSection.tsx)
- [extensions/cli/src/ui/IntroMessage.tsx](https://github.com/continuedev/continue/blob/main/extensions/cli/src/ui/IntroMessage.tsx)
- [extensions/cli/src/systemMessage.ts](https://github.com/continuedev/continue/blob/main/extensions/cli/src/systemMessage.ts)
</details>

# IDE Extensions

## Overview

The Continue project provides IDE extensions for Visual Studio Code and IntelliJ-based IDEs (IntelliJ IDEA, PyCharm, WebStorm, etc.). These extensions enable inline AI-powered code completion, chat interfaces, and context-aware code editing directly within the developer's IDE environment.

The extension architecture follows a unified design pattern where each IDE implementation shares common interfaces while adapting to platform-specific APIs. This allows consistent user experience across different development environments while leveraging native IDE capabilities.

## Architecture Overview

```mermaid
graph TD
    subgraph VSCode_Extension
        VSCE[VSCode Extension Entry] --> VSCA[Autocomplete Provider]
        VSCE --> VSCM[Model Configuration]
        VSCE --> VSCS[Settings Manager]
    end

    subgraph IntelliJ_Extension
        IJ[IntelliJ Extension Entry] --> IJA[Inline Completion Provider]
        IJ --> IJM[Model Configuration]
        IJ --> IJS[Settings Manager]
    end

    subgraph Shared_Core
        CORE[Core Library]
        CORE --> GUI[GUI Components]
        CORE --> API[Protocol/API Layer]
    end

    VSCE --> CORE
    IJ --> CORE
    VSCM --> GUI
    IJM --> GUI
```

## VSCode Extension

### Extension Entry Point

The VSCode extension is initialized in `extensions/vscode/src/extension.ts`. This file registers all VSCode-specific providers including:

- **Completion Provider** for inline code completions
- **Command Handlers** for IDE interactions
- **Configuration Managers** for workspace and user settings
- **Status Bar Items** for displaying model status and token usage

资料来源：[extensions/vscode/src/extension.ts]()

### Autocomplete System

The VSCode autocomplete functionality is implemented in `extensions/vscode/src/autocomplete/completionProvider.ts`. This provider intercepts typing events and sends requests to the configured autocomplete model.

Key responsibilities include:

| Component | Function |
|-----------|----------|
| `CompletionProvider` | Handles VSCode's `InlineCompletionItemProvider` interface |
| Debouncing | Prevents excessive API calls during rapid typing |
| Timeout Management | Limits request duration (configurable via `modelTimeout`) |
| Context Gathering | Collects surrounding code context for better completions |

资料来源：[extensions/vscode/src/autocomplete/completionProvider.ts]()

### Settings Configuration

The VSCode extension exposes user-configurable settings through the IDE's settings UI. The frontend configuration is rendered in `gui/src/pages/config/sections/UserSettingsSection.tsx`.

#### Autocomplete Settings

| Setting | Type | Default | Description |
|---------|------|---------|-------------|
| `useAutocompleteMultilineCompletions` | enum | `"auto"` | Controls multiline completion behavior |
| `modelTimeout` | number | - | Maximum timeout in milliseconds for autocomplete requests |
| `debounceDelay` | number | - | Minimum delay before triggering autocomplete after changes |
| `disableAutocompleteInFiles` | string | `""` | Comma-separated glob patterns for disabling autocomplete |

资料来源：[gui/src/pages/config/sections/UserSettingsSection.tsx]()

### Model Selection

The `ModelsSection.tsx` component provides the UI for selecting models for different purposes:

- **Chat Model**: Used for conversational interactions
- **Autocomplete Model**: Used for inline code completions
- **Edit Model**: Used for code transformations via the edit tool

Each model role has associated documentation links and setup instructions. The component validates that the selected model is appropriate for its intended use case.

资料来源：[gui/src/pages/config/sections/ModelsSection.tsx]()

## IntelliJ Extension

### Extension Structure

The IntelliJ extension is implemented in Kotlin, following JetBrains' plugin development conventions. The main IDE interface is defined in `IntelliJIde.kt`.

```mermaid
classDiagram
    class IntelliJIde {
        +ideMessenger: IdeMessenger
        +writeFile(path: string, content: string)
        +readFile(path: string): string
        +getOpenFiles(): string[]
        +getCurrentFile(): string
    }
    
    class ContinueInlineCompletionProvider {
        +provideInlineCompletions()
        +handleInlineCompletion()
    }
    
    IntelliJIde --> ContinueInlineCompletionProvider
```

资料来源：[extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/continue/IntelliJIde.kt]()

### Inline Completion Provider

The `ContinueInlineCompletionProvider.kt` implements IntelliJ's `InlineCompletionProvider` interface, providing the same functionality as the VSCode autocomplete system but adapted for JetBrains IDE APIs.

Key differences from VSCode implementation:

| Aspect | VSCode | IntelliJ |
|--------|--------|----------|
| Language | TypeScript | Kotlin |
| Provider Interface | `InlineCompletionItemProvider` | `InlineCompletionProvider` |
| Configuration | JSON Settings | Extension Settings API |

资料来源：[extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/autocomplete/ContinueInlineCompletionProvider.kt]()

### IDE-Specific Features

The IntelliJ extension includes JetBrains-specific adaptations:

1. **Sidebar Management**: When the input box is focused and Escape is pressed, the sidebar closes via `closeSidebar` command
2. **File Context**: Automatically adds the currently open file as context (configurable)
3. **Experimental Tools**: Toggle for enabling development-stage features

## CLI Extension

### Command-Line Interface

The CLI extension (`extensions/cli/`) provides a terminal-based interface for Continue. While not a traditional IDE extension, it shares the same core library and provides similar functionality.

### System Message Configuration

The `systemMessage.ts` file builds the system prompt for the CLI, incorporating:

- **Context Variables**: Repository, branch, and directory information
- **Commit Signature**: Optional footer for commit messages when `INUE_CLI_DISABLE_COMMIT_SIGNATURE` is not set
- **Headless Mode**: Special instructions for CLI-only operation without interactive UI
- **JSON Output**: Formatting instructions when structured output is requested

```typescript
// Headless mode instructions
if (headless) {
    systemMessage += `
IMPORTANT: You are running in headless mode. Provide ONLY your final answer.
Do not include explanations, reasoning, or additional commentary.`;
}
```

资料来源：[extensions/cli/src/systemMessage.ts]()

### Startup Display

The `IntroMessage.tsx` component renders the CLI welcome screen, showing:

- Configuration name and selected model
- Model capability warnings
- MCP (Model Context Protocol) server status
- Active rules and prompts

资料来源：[extensions/cli/src/ui/IntroMessage.tsx]()

## Cross-Platform Considerations

### Unified Configuration Schema

All IDE extensions share a common configuration schema defined in the core library. This ensures that:

- Settings configured in one IDE are portable to another
- Model selections and preferences persist across IDE switches
- Autocomplete behavior is consistent regardless of editor choice

### Model Capability Validation

The `packages/config-yaml/src/validation.ts` file contains validation logic that warns users when selected models may not be suitable for certain tasks:

```typescript
if (nonAutocompleteModels.some((m) => modelName.includes(m)) &&
    !modelName.includes("deepseek") &&
    !modelName.includes("codestral") &&
    !modelName.toLowerCase().includes("coder")) {
    errors.push({
        fatal: false,
        message: `${model.model} is not trained for tab-autocomplete...`
    });
}
```

Models like GPT-4, Claude, and Mistral are flagged as potentially unsuitable for autocomplete due to their training characteristics.

资料来源：[packages/config-yaml/src/validation.ts]()

## Summary

The IDE Extensions module provides platform-specific implementations for integrating Continue into popular development environments. Key components include:

| Extension | Language | Primary Features |
|-----------|----------|-----------------|
| VSCode | TypeScript | Inline completions, sidebar chat, config UI |
| IntelliJ | Kotlin | Inline completions, JetBrains-specific UI |
| CLI | TypeScript | Terminal interface, headless mode |

All extensions share the same core library, ensuring consistent behavior and shared configuration management across the entire Continue ecosystem.

---

<a id='cli-tool'></a>

## CLI Tool

### 相关页面

相关主题：[Chat and Agent System](#chat-system)

<details>
<summary>相关源码文件</summary>

以下源码文件用于生成本页说明：

- [extensions/cli/src/slashCommands.ts](https://github.com/continuedev/continue/blob/main/extensions/cli/src/slashCommands.ts)
- [extensions/cli/src/systemMessage.ts](https://github.com/continuedev/continue/blob/main/extensions/cli/src/systemMessage.ts)
- [extensions/cli/src/util/metadata.ts](https://github.com/continuedev/continue/blob/main/extensions/cli/src/util/metadata.ts)
- [extensions/cli/src/ui/IntroMessage.tsx](https://github.com/continuedev/continue/blob/main/extensions/cli/src/ui/IntroMessage.tsx)
- [extensions/cli/src/ui/JobsSelector.tsx](https://github.com/continuedev/continue/blob/main/extensions/cli/src/ui/JobsSelector.tsx)
</details>

# CLI Tool

The Continue CLI (`cn`) is a command-line interface tool that enables developers to interact with the Continue AI coding assistant directly from the terminal. It provides a comprehensive set of slash commands for chat interactions, job management, session handling, and configuration control.

## Architecture Overview

The CLI tool is architected as a Node.js/TypeScript application with a modular component structure. It communicates with the IDE extension through IPC (Inter-Process Communication) mechanisms and supports both local and remote operation modes.

```mermaid
graph TD
    A[User Input] --> B[Slash Command Parser]
    B --> C{Command Type}
    C -->|Session| D[Session Commands]
    C -->|Auth| E[Auth Commands]
    C -->|Config| F[Config Commands]
    C -->|Job| G[Job Commands]
    C -->|Skill| H[Skill Commands]
    D --> I[ServiceContainer]
    E --> I
    F --> I
    G --> I
    H --> I
    I --> J[Telemetry Service]
    I --> K[IDE Messenger]
```

## Slash Commands

The CLI supports an extensive set of slash commands that provide quick access to various functionality. Commands are triggered when the input starts with a `/` character.

### Available Commands

| Command | Handler | Description |
|---------|---------|-------------|
| `/clear` | `clearChatHistory` | Clears the current chat history |
| `/exit` | `exitHandler` | Exits the CLI session |
| `/config` | `openConfigSelector` | Opens the configuration selector |
| `/login` | `handleLogin` | Initiates login flow |
| `/logout` | `handleLogout` | Logs out the current user |
| `/whoami` | `handleWhoami` | Displays current user info |
| `/info` | `handleInfoSlashCommand` | Shows system information |
| `/model` | `openModelSelector` | Opens the model selector |
| `/compact` | `compactConversation` | Compacts conversation history |
| `/mcp` | `openMcpSelector` | Opens MCP server selector |
| `/resume` | `openSessionSelector` | Opens session recovery selector |
| `/fork` | `handleFork` | Forks the current conversation |
| `/title` | `handleTitle` | Generates/updates session title |
| `/rename` | `handleTitle` | Alias for title command |
| `/init` | `handleInit` | Initializes new session |
| `/update` | `openUpdateSelector` | Opens update selector |
| `/jobs` | `handleJobs` | Manages background jobs |
| `/skills` | `handleSkills` | Lists available skills |
| `/import-skill` | `handleImportSkill` | Imports a new skill |
| `/sessions` | `handleSessions` | Manages saved sessions |
| `/export` | `handleExport` | Exports session data |
| `/import` | `handleImport` | Imports session data |

资料来源：[extensions/cli/src/slashCommands.ts:1-50](https://github.com/continuedev/continue/blob/main/extensions/cli/src/slashCommands.ts)

### Command Processing Flow

```mermaid
sequenceDiagram
    participant User
    participant Parser
    participant Handler
    participant ServiceContainer
    participant IDE

    User->>Parser: Input with "/" prefix
    Parser->>Parser: Extract command and args
    Parser->>Handler: Dispatch to appropriate handler
    Handler->>ServiceContainer: Execute business logic
    ServiceContainer->>IDE: Post/receive messages
    IDE->>User: Display result
```

The command parser validates input by checking if the first character is `/` and if the trimmed input starts with `/`:

```typescript
if (!input.startsWith("/") || !input.trim().startsWith("/")) {
  return null;
}
```

资料来源：[extensions/cli/src/slashCommands.ts:52-55](https://github.com/continuedev/continue/blob/main/extensions/cli/src/slashCommands.ts)

## System Message Generation

The CLI dynamically constructs system messages based on the current configuration, operation mode, and user settings. This ensures the AI model receives contextually appropriate instructions.

### Headless Mode

When operating in headless mode, the system message includes instructions for concise responses:

```
IMPORTANT: You are running in headless mode. Provide ONLY your final answer to the user's question. Do not include explanations, reasoning, or additional commentary unless specifically requested. Be direct and concise.
```

资料来源：[extensions/cli/src/systemMessage.ts:1-20](https://github.com/continuedev/continue/blob/main/extensions/cli/src/systemMessage.ts)

### JSON Output Mode

When JSON format is requested, the system message instructs the model to return valid JSON:

```
IMPORTANT: You are operating in JSON output mode. Your final response MUST be valid JSON that can be parsed by JSON.parse(). The JSON should contain properties relevant to answer the user's question.
```

资料来源：[extensions/cli/src/systemMessage.ts:22-28](https://github.com/continuedev/continue/blob/main/extensions/cli/src/systemMessage.ts)

### Commit Signature Context

When commit signing is enabled and not disabled via environment variable, the system message includes commit signature context:

```typescript
if (!process.env.INUE_CLI_DISABLE_COMMIT_SIGNATURE) {
  systemMessage += `\n<context name="commitSignature">When creating commits using any CLI or tool, include the following in the commit message:
Generated with [Continue](https://continue.dev)

Co-Authored-By: Continue <noreply@continue.dev>
</context>\n`;
}
```

资料来源：[extensions/cli/src/systemMessage.ts:1-10](https://github.com/continuedev/continue/blob/main/extensions/cli/src/systemMessage.ts)

## User Rules Integration

The system message supports integration of user-defined rules through the `<context name="userRules">` tag. Rules can be sourced from agent content or from processed command-line rules.

```typescript
if (agentContent || processedRules.length > 0) {
  systemMessage += '\n\n<context name="userRules">';
  if (agentContent) {
    systemMessage += `\n${agentContent}`;
  }
  if (processedRules.length > 0) {
    // Rules are added with appropriate separators
  }
}
```

资料来源：[extensions/cli/src/systemMessage.ts:30-40](https://github.com/continuedev/continue/blob/main/extensions/cli/src/systemMessage.ts)

## Metadata Utilities

The CLI provides utility functions for extracting and processing conversation metadata.

### Commit Diff Statistics

The `getDiffStats` function parses git diff output and calculates the number of line additions and deletions:

```typescript
export function getDiffStats(diff: string): { additions: number; deletions: number }
```

It skips metadata lines (file headers, hunk headers, binary file markers) and counts lines starting with `+` or `-`:

资料来源：[extensions/cli/src/util/metadata.ts:1-30](https://github.com/continuedev/continue/blob/main/extensions/cli/src/util/metadata.ts)

### Conversation Summary Extraction

The `extractSummary` function retrieves the last assistant message from conversation history:

```typescript
export function extractSummary(
  history: ChatHistoryItem[],
  maxLength: number = 500,
): string | undefined
```

It iterates backwards through the history to find the most recent assistant message, truncates content that exceeds the specified maximum length, and handles both string and structured message content.

资料来源：[extensions/cli/src/util/metadata.ts:38-75](https://github.com/continuedev/continue/blob/main/extensions/cli/src/util/metadata.ts)

## UI Components

### Intro Message

The `IntroMessage` component displays startup information when the CLI session begins:

```mermaid
graph LR
    A[Config Loaded] --> B[Display Config Name]
    A --> C[Model Loaded?]
    C -->|Yes| D[Display Model Name]
    C -->|No| E[Show Loading...]
    D --> F{Model Capable?}
    F -->|No| G[Show Capability Warning]
    F -->|Yes| H[Continue]
    G --> I[Render MCP Prompts]
    H --> I
    I --> J[Render Rules]
    J --> K[Render MCP Servers]
```

The intro message renders in the terminal using the `ink` library and displays:

- Configuration name
- Model name (extracted from full model identifier)
- Capability warnings for unsupported models
- MCP prompts
- Active rules
- MCP server status

资料来源：[extensions/cli/src/ui/IntroMessage.tsx:1-60](https://github.com/continuedev/continue/blob/main/extensions/cli/src/ui/IntroMessage.tsx)

### Jobs Selector

The `JobsSelector` component displays a list of background jobs with their status:

| Status | Color | Description |
|--------|-------|-------------|
| `running` | cyan | Job is currently executing |
| `done` | green | Job completed successfully |
| `error` | red | Job failed with an error |

Each job entry shows:
- Job ID
- Status (padded for alignment)
- Duration (formatted)
- Command (truncated to 30 characters)

```typescript
<Text>
  {job.command.substring(0, 30)}
  {job.command.length > 30 ? "..." : ""}
</Text>
```

资料来源：[extensions/cli/src/ui/JobsSelector.tsx:1-35](https://github.com/continuedev/continue/blob/main/extensions/cli/src/ui/JobsSelector.tsx)

## Configuration Options

The CLI behavior can be customized through several configuration options:

| Option | Type | Default | Description |
|--------|------|---------|-------------|
| `headless` | boolean | false | Run in headless mode with minimal output |
| `format` | string | - | Output format (e.g., "json") |
| `remoteUrl` | string | - | Connect to remote server |
| `isRemoteMode` | boolean | false | Enable remote operation |

## Installation

The Continue CLI can be installed through multiple methods:

### macOS / Linux

```bash
curl -fsSL https://raw.githubusercontent.com/continuedev/continue/main/extensions/cli/scripts/install.sh | bash
```

### Windows (PowerShell)

```powershell
irm https://raw.githubusercontent.com/continuedev/continue/main/extensions/cli/scripts/install.ps1 | iex
```

### npm

```bash
npm i -g @continuedev
```

资料来源：[README.md](https://github.com/continuedev/continue/blob/main/README.md)

## Related Files

The CLI tool integrates with several other components:

- **IDE Extension**: Communicates via `ideMessenger` for UI updates and user interactions
- **Service Container**: Central service for managing CLI operations and state
- **Permission Manager**: Handles permission requests for sensitive operations
- **Telemetry Service**: Records command usage and system metrics

---

<a id='model-providers'></a>

## Model Providers and LLM Integration

### 相关页面

相关主题：[Core Library](#core-library), [Configuration System](#config-system)

<details>
<summary>相关源码文件</summary>

以下源码文件用于生成本页说明：

- [gui/src/pages/config/sections/ModelsSection.tsx](https://github.com/continuedev/continue/blob/main/gui/src/pages/config/sections/ModelsSection.tsx)
- [gui/src/pages/AddNewModel/configs/providers.ts](https://github.com/continuedev/continue/blob/main/gui/src/pages/AddNewModel/configs/providers.ts)
- [gui/src/pages/config/components/ModelRoleSelector.tsx](https://github.com/continuedev/continue/blob/main/gui/src/pages/config/components/ModelRoleSelector.tsx)
- [extensions/cli/src/slashCommands.ts](https://github.com/continuedev/continue/blob/main/extensions/cli/src/slashCommands.ts)
- [extensions/cli/src/ui/IntroMessage.tsx](https://github.com/continuedev/continue/blob/main/extensions/cli/src/ui/IntroMessage.tsx)
- [gui/src/pages/stats.tsx](https://github.com/continuedev/continue/blob/main/gui/src/pages/stats.tsx)
</details>

# Model Providers and LLM Integration

## Overview

Continue's Model Providers and LLM Integration system provides a flexible, pluggable architecture for connecting to various Large Language Model (LLM) providers. The system supports multiple provider types including OpenAI, Anthropic, local models via Ollama and Llamafile, and cloud-hosted models through Replicate.

The integration layer abstracts away provider-specific differences, allowing users to configure and switch between different models while maintaining a consistent interface for AI-powered features across the Continue IDE and CLI.

## Architecture

### Model Provider Hierarchy

The system organizes providers hierarchically with support for multiple model roles:

```mermaid
graph TD
    A[Model Configuration] --> B[Model Provider]
    A --> C[Model Role]
    B --> D[OpenAI]
    B --> E[Anthropic]
    B --> F[Ollama]
    B --> G[Llamafile]
    B --> H[Replicate]
    C --> I[Chat]
    C --> J[Autocomplete]
    C --> K[Edit]
    C --> L[Apply]
    C --> M[Embed]
```

### Supported Model Roles

Continue defines five distinct model roles that serve different purposes within the IDE:

| Role | Purpose | Description |
|------|---------|-------------|
| `chat` | General conversation | Primary model for user interactions and code assistance |
| `autocomplete` | Inline completions | Used for real-time code completions as the user types |
| `edit` | Code transformations | Transforms selected sections of code via inline edit commands |
| `apply` | Code block application | Applies generated codeblocks to files |
| `embed` | Semantic embeddings | Generates and queries embeddings for @codebase and @docs context providers |

资料来源：[gui/src/pages/config/sections/ModelsSection.tsx:1-100]()

## Provider Configuration

### Local Providers

#### Ollama

Ollama enables running open-source models locally. Configuration includes:

- **Setup**: Download and run from [github.com/ollama/ollama](https://github.com/ollama/ollama)
- **Tags**: Local, Open Source
- **API Requirements**: Requires local Ollama server running

#### Llamafile

Llamafile provides another local model option using Mozilla's llamafile binary:

```shell
chmod +x ./llamafile
./llamafile
```

资料来源：[gui/src/pages/AddNewModel/configs/providers.ts:1-50]()

### Cloud Providers

#### Replicate

Replicate offers hosted access to open-source models via API:

1. Obtain an API key from [replicate.com](https://replicate.com)
2. Configure in Continue settings
3. Select from available model presets

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `apiKey` | string | Yes | Replicate API authentication key |
| `model` | string | No | Specific model preset selection |

资料来源：[gui/src/pages/AddNewModel/configs/providers.ts:50-100]()

## Model Selection Interface

### Model Role Selector

The ModelRoleSelector component provides a UI for selecting models based on role:

```mermaid
graph LR
    A[ModelRoleSelector] --> B[Model List]
    B --> C[Valid Models]
    B --> D[Invalid Config Models]
    C --> E[Selectable]
    D --> F[Disabled with reason]
```

The selector displays configuration status for each model:

| Status | Message | Meaning |
|--------|---------|---------|
| `VALID` | (none) | Model is properly configured |
| `INVALID` | (Invalid config) | General configuration error |
| `MISSING_ENV_SECRET` | (Missing env secret) | Required environment secret not set |
| `MISSING_API_KEY` | (Missing API Key) | API key not provided |

Models are sorted alphabetically by title and display validation messages inline.

资料来源：[gui/src/pages/config/components/ModelRoleSelector.tsx:1-80]()

## User Settings and Configuration

### Model-Related Preferences

Several user settings control model behavior:

| Setting | Description | Default |
|---------|-------------|---------|
| `useCurrentFileAsContext` | Add currently open file to new conversations | varies |
| `codebaseToolCallingOnly` | @codebase uses only tool calling for retrieval | varies |
| `continueAfterToolRejection` | Continue streaming after tool rejection | varies |
| `enableExperimentalTools` | Enable experimental tool features | varies |

### Model Switching

The `/model` slash command opens the model selector interface:

```typescript
model: () => ({ openModelSelector: true }),
```

This allows quick switching between configured models without navigating through settings.

资料来源：[extensions/cli/src/slashCommands.ts:1-50]()

## Token Usage and Statistics

### Stats Tracking

Continue tracks token usage per model for monitoring and cost management:

```mermaid
graph TD
    A[Model Interaction] --> B[Track Tokens]
    B --> C[Prompt Tokens]
    B --> D[Generated Tokens]
    C --> E[Daily Aggregation]
    D --> E
    E --> F[Per-Model Stats]
```

The stats page displays:

| Metric | Description | Format |
|--------|-------------|--------|
| `Day/Model` | Time period identifier | string |
| `Generated Tokens` | Tokens produced by model | number with locale formatting |
| `Prompt Tokens` | Input tokens sent to model | number with locale formatting |

Tokens are formatted using `toLocaleString()` for readability and can be copied as tables.

资料来源：[gui/src/pages/stats.tsx:1-60]()

## Model Capability Detection

### IntroMessage Component

The IntroMessage component displays current model information in the CLI interface:

```typescript
{model ? (
  <Text color="blue">
    <Text bold>Model:</Text>{" "}
    <Text color="white">{model.name.split("/").pop()}</Text>
  </Text>
) : (
  <Text color="blue">
    <Text bold>Model:</Text> <Text color="dim">Loading...</Text>
  </Text>
)}
```

Model names are extracted from full identifiers by splitting on "/" and taking the last component, providing cleaner display names.

### Capability Warnings

When a selected model lacks required capabilities:

```typescript
{model && !modelCapable && (
  <>
    <ModelCapabilityWarning
      modelName={model.name.split("/").pop() || model.name}
    />
    <Text> </Text>
  </>
)}
```

资料来源：[extensions/cli/src/ui/IntroMessage.tsx:1-50]()

## Configuration Validation

### LLM Configuration Statuses

The system validates model configurations with the following statuses:

```mermaid
stateDiagram-v2
    [*] --> Valid: All requirements met
    [*] --> Invalid: Configuration error
    [*] --> MissingEnvSecret: Env var not set
    [*] --> MissingApiKey: API key not provided
    Valid --> [*]
    Invalid --> [*]: Fix config
    MissingEnvSecret --> [*]: Set env secret
    MissingApiKey --> [*]: Provide API key
```

Configuration validation occurs at load time and updates dynamically when settings change.

资料来源：[gui/src/pages/config/components/ModelRoleSelector.tsx:20-45]()

## Integration with Context Providers

### Embedding Models

The `embed` role is specifically designed for semantic search operations:

- Generates embeddings for code and documentation
- Powers the `@codebase` context provider
- Enables the `@docs` context provider

When no embedding model is configured, context providers fall back to alternative retrieval methods.

## Summary

Continue's Model Providers and LLM Integration system provides:

1. **Multi-provider support** - OpenAI, Anthropic, Ollama, Llamafile, Replicate, and more
2. **Role-based model selection** - Different models optimized for chat, completion, editing, application, and embedding
3. **Local and cloud options** - Run models locally or leverage cloud APIs
4. **Configuration validation** - Clear error messages for invalid or incomplete setups
5. **Usage tracking** - Token usage statistics for cost monitoring
6. **Capability detection** - Warnings when model capabilities don't match requirements

---

<a id='chat-system'></a>

## Chat and Agent System

### 相关页面

相关主题：[Core Library](#core-library), [Model Providers and LLM Integration](#model-providers)

<details>
<summary>Related Source Files</summary>

以下源码文件用于生成本页说明：

- [core/tools/builtIn.ts](https://github.com/continuedev/continue/blob/main/core/tools/builtIn.ts)
- [core/tools/callTool.ts](https://github.com/continuedev/continue/blob/main/core/tools/callTool.ts)
- [extensions/cli/src/stream/streamChatResponse.ts](https://github.com/continuedev/continue/blob/main/extensions/cli/src/stream/streamChatResponse.ts)
- [core/llm/streamChat.ts](https://github.com/continuedev/continue/blob/main/core/llm/streamChat.ts)
- [extensions/cli/src/slashCommands.ts](https://github.com/continuedev/continue/blob/main/extensions/cli/src/slashCommands.ts)
- [extensions/cli/src/systemMessage.ts](https://github.com/continuedev/continue/blob/main/extensions/cli/src/systemMessage.ts)
- [gui/src/components/StyledMarkdownPreview/StepContainerPreToolbar/index.tsx](https://github.com/continuedev/continue/blob/main/gui/src/components/StyledMarkdownPreview/StepContainerPreToolbar/index.tsx)
</details>

# Chat and Agent System

## Overview

The Chat and Agent System is the core interaction layer of the Continue platform, enabling users to communicate with AI models through a rich interface that supports tool execution, slash commands, streaming responses, and multi-modal interactions. The system bridges the gap between user input, LLM inference, and tool orchestration.

The architecture follows a modular design where the CLI handles core chat logic and streaming, while the GUI provides visual representations of messages, tool calls, and configuration panels.

---

## Architecture

```mermaid
graph TD
    subgraph "User Interface Layer"
        GUI[GUI Components]
        TUI[TUI Chat Interface]
    end
    
    subgraph "CLI Core Layer"
        SC[Slash Commands]
        SM[System Message]
        SCR[Stream Chat Response]
        LM[Language Model]
    end
    
    subgraph "Tool Layer"
        BT[Built-in Tools]
        CT[Call Tool]
    end
    
    GUI --> TUI
    TUI --> SC
    TUI --> SM
    TUI --> SCR
    SCR --> LM
    LM --> SCR
    SC --> CT
    CT --> BT
```

---

## Core Components

### Language Model Integration

The LLM integration is handled through `streamChat.ts`, which provides streaming capabilities for chat interactions.

**Key Responsibilities:**

- Managing chat completions with streaming support
- Handling message formatting and context window management
- Supporting multiple model providers through a unified interface

**Stream Chat Functionality:**

```typescript
// Conceptual representation from core/llm/streamChat.ts
interface ChatMessage {
  role: "user" | "assistant" | "system";
  content: string | ContentBlock[];
}

interface StreamOptions {
  model: string;
  messages: ChatMessage[];
  temperature?: number;
  maxTokens?: number;
  tools?: ToolDefinition[];
}
```

资料来源：[core/llm/streamChat.ts:1-50]()

---

### Stream Chat Response Processing

The `streamChatResponse.ts` file handles the processing of streaming responses from the LLM, managing the incremental rendering of AI outputs.

**Processing Pipeline:**

1. Receive chunks from the streaming endpoint
2. Parse delta updates for content
3. Handle special tokens (tool calls, thinking blocks)
4. Aggregate content for final rendering

资料来源：[extensions/cli/src/stream/streamChatResponse.ts:1-60]()

---

## Tool System

### Built-in Tools

The `builtIn.ts` file defines the core set of tools available to the agent by default. These tools provide essential capabilities for file operations, code execution, and system interaction.

**Tool Categories:**

| Category | Tools | Purpose |
|----------|-------|---------|
| File Operations | Read, Edit, Write | File system interactions |
| Code Execution | Bash, Python | Run commands and scripts |
| Search | Grep, FileSearch | Find code and text |
| Git | GitStatus, GitDiff | Version control operations |
| Web | WebFetch | External resource retrieval |

**Tool Definition Structure:**

```typescript
interface ToolDefinition {
  name: string;
  description: string;
  parameters: {
    type: "object";
    properties: Record<string, ToolParameter>;
    required?: string[];
  };
}
```

资料来源：[core/tools/builtIn.ts:1-100]()

### Tool Invocation

The `callTool.ts` module handles the actual execution of tools requested by the LLM. It manages the tool call lifecycle from invocation to result return.

**Call Tool Workflow:**

```mermaid
sequenceDiagram
    participant LLM as LLM Agent
    participant CT as Call Tool
    participant BT as Built-in Tools
    participant UI as User Interface
    
    LLM->>CT: Request tool execution
    CT->>BT: Validate and parse parameters
    BT->>BT: Execute tool logic
    BT-->>CT: Return result
    CT-->>LLM: Format response
    CT-->>UI: Update status
```

**Key Features:**

- Parameter validation against tool schemas
- Error handling and graceful degradation
- Result formatting for LLM consumption
- Permission checking based on tool policies

资料来源：[core/tools/callTool.ts:1-80]()

---

## Slash Commands

Slash commands provide quick access to system features directly from the chat input. The command handler is defined in `slashCommands.ts`.

### Available Commands

| Command | Action | Description |
|---------|--------|-------------|
| `/clear` | Clear chat history | Resets the conversation context |
| `/exit` | Exit session | Closes the CLI interface |
| `/config` | Open config selector | Navigate to configuration |
| `/login` | Authenticate | Initiate login flow |
| `/logout` | End session | Sign out current user |
| `/whoami` | Show identity | Display current user info |
| `/model` | Open model selector | Switch LLM provider |
| `/compact` | Compact context | Reduce context window size |
| `/mcp` | MCP server menu | Manage MCP servers |
| `/resume` | Resume session | Open saved sessions |
| `/fork` | Fork conversation | Create a branch |
| `/title` | Generate title | Create chat title |
| `/update` | Update selector | Check for updates |
| `/jobs` | Job management | View background jobs |
| `/skills` | Skill browser | Access skill library |
| `/sessions` | Session manager | List/manage sessions |
| `/export` | Export data | Export chat history |
| `/import` | Import data | Import external data |

### Command Processing

```typescript
// From extensions/cli/src/slashCommands.ts
export async function handleSlashCommands(
  input: string,
  assistant: AssistantConfig,
  options?: { remoteUrl?: string; isRemoteMode?: boolean },
): Promise<SlashCommandResult | null> {
  // Only trigger slash commands if slash is the very first character
  if (!input.startsWith("/") || !input.trim().startsWith("/")) {
    return null;
  }

  const [command, ...args] = input.slice(1).split(" ");
  // ... command execution logic
}
```

**Command Trigger Rules:**

- The command must start with `/`
- Slash must be the first character of the input
- Arguments are passed after a space delimiter

资料来源：[extensions/cli/src/slashCommands.ts:30-80]()

---

## System Message Generation

The `systemMessage.ts` file constructs the system prompt that provides context and instructions to the LLM.

### System Message Components

```typescript
// From extensions/cli/src/systemMessage.ts

// Commit signature injection
if (!process.env.CONTINUE_CLI_DISABLE_COMMIT_SIGNATURE) {
  systemMessage += `\n<context name="commitSignature">
When creating commits using any CLI or tool, include the following in the commit message:
Generated with [Continue](https://continue.dev)
Co-Authored-By: Continue <noreply@continue.dev>
</context>\n`;
}

// Headless mode instructions
if (headless) {
  systemMessage += `
IMPORTANT: You are running in headless mode. 
Provide ONLY your final answer to the user's question. 
Do not include explanations, reasoning, or additional commentary.`;
}

// JSON output mode
if (format === "json") {
  systemMessage += `
IMPORTANT: You are operating in JSON output mode. 
Your final response MUST be valid JSON.`;
}
```

### User Rules Integration

```typescript
if (agentContent || processedRules.length > 0) {
  systemMessage += '\n\n<context name="userRules">';
  
  if (agentContent) {
    systemMessage += `\n${agentContent}`;
  }
  
  if (processedRules.length > 0) {
    // Add rule-specific instructions
  }
}
```

资料来源：[extensions/cli/src/systemMessage.ts:20-60]()

---

## User Interface Components

### GUI Chat Interface

The GUI components render chat messages with rich formatting, tool call visualization, and interactive elements.

**Message Rendering Pipeline:**

1. Parse markdown content
2. Handle nested code blocks
3. Apply syntax highlighting
4. Render tool call previews
5. Display action buttons (Apply, Reject, Create File)

```typescript
// From gui/src/components/StyledMarkdownPreview/StepContainerPreToolbar/index.tsx
// Rendering decision logic
if (isTerminalCodeBlock(language, codeBlockContent)) {
  return <RunInTerminalButton command={codeBlockContent} />;
}

if (fileExists || !relativeFilepath) {
  return (
    <ApplyActions
      disableManualApply={disableManualApply}
      applyState={toolCallApplyState ?? applyState}
      onClickApply={onClickApply}
      onClickAccept={() => handleDiffAction("accept")}
      onClickReject={() => handleDiffAction("reject")}
    />
  );
}

return <CreateFileButton onClick={onClickApply} />;
```

### TUI Chat Interface

The Terminal User Interface provides a text-based chat experience with keyboard navigation and terminal-compatible rendering.

```typescript
// From extensions/cli/src/ui/TUIChat.tsx
<BottomStatusBar
  currentMode={services?.toolPermissions?.currentMode ?? "normal"}
  remoteUrl={remoteUrl}
  isRemoteMode={isRemoteMode}
  services={services}
  navState={navState}
  navigateTo={navigateTo}
  closeCurrentScreen={closeCurrentScreen}
  contextPercentage={contextData?.percentage}
  hasImageInClipboard={hasImageInClipboard}
  isVerboseMode={isVerboseMode}
  totalCost={getTotalSessionCost()}
/>
```

---

## Configuration Management

### Model Configuration

Models are configured per role, supporting different models for different tasks:

| Role | Purpose | Example Models |
|------|---------|----------------|
| chat | General conversation | GPT-4, Claude, Llama |
| autocomplete | Inline code completion | StarCoder, CodeGen |
| edit | Code transformation | Specialized edit models |

资料来源：[gui/src/pages/config/sections/ModelsSection.tsx:40-100]()

### Tool Configuration

Tool policies control how and when tools can be executed:

| Policy | Behavior |
|--------|----------|
| `allowedWithPermission` | Execute after user approval |
| `allowedWithoutPermission` | Execute automatically |
| `disabled` | Tool unavailable |

```typescript
// From gui/src/redux/slices/uiSlice.ts
toggleToolSetting: (state, action: PayloadAction<string>) => {
  const setting = state.toolSettings[action.payload];

  switch (setting) {
    case "allowedWithPermission":
      state.toolSettings[action.payload] = "allowedWithoutPermission";
      break;
    case "allowedWithoutPermission":
      state.toolSettings[action.payload] = "disabled";
      break;
    case "disabled":
      state.toolSettings[action.payload] = "allowedWithPermission";
      break;
  }
}
```

---

## Error Handling

The system includes comprehensive error handling for configuration issues and runtime failures.

```typescript
// From gui/src/components/config/FatalErrorNotice.tsx
return (
  <Alert type="error" className="mx-2 my-1 px-2">
    <span>{`Error loading`}</span>{" "}
    <span className="italic">{displayName}</span>
    {". "}
    <span>{`Chat is disabled until a model is available.`}</span>
    <div className="mt-2 flex flex-row flex-wrap items-center gap-x-3 gap-y-1.5">
      <div onClick={() => ideMessenger.post("openUrl", "https://docs.continue.dev/troubleshooting")}>
        Help
      </div>
      <div onClick={() => refreshProfiles("Clicked reload in fatal indicator")}>
        Reload
      </div>
    </div>
  </Alert>
);
```

---

## Data Flow

```mermaid
graph LR
    subgraph "Input Processing"
        UM[User Message]
        SC[Slash Command]
        TK[Tool Call]
    end
    
    subgraph "Processing"
        LLM[LLM Inference]
        TM[Tool Manager]
        SM[System Message]
    end
    
    subgraph "Output"
        STR[Stream Response]
        UI[UI Update]
        TS[Tool State]
    end
    
    UM --> LLM
    SC --> TM
    TK --> TM
    TM --> LLM
    SM --> LLM
    LLM --> STR
    STR --> UI
    TM --> TS
```

---

## Summary

The Chat and Agent System in Continue provides a comprehensive framework for AI-assisted development. Key aspects include:

1. **Modular Architecture**: Clear separation between UI, CLI core, and tool execution layers
2. **Streaming Support**: Real-time response rendering for improved user experience
3. **Tool Integration**: Built-in tools plus MCP server support for extensibility
4. **Flexible Configuration**: Role-based model selection and granular tool policies
5. **Slash Commands**: Quick access to system features from chat input
6. **Error Resilience**: Graceful handling of configuration and runtime errors

The system is designed to be both user-friendly for developers and extensible for power users who need custom tool integrations.

---

<a id='autocomplete'></a>

## Autocomplete System

### 相关页面

相关主题：[Core Library](#core-library), [Next Edit Feature](#next-edit)

<details>
<summary>相关源码文件</summary>

以下源码文件用于生成本页说明：

- [gui/src/pages/config/sections/UserSettingsSection.tsx](https://github.com/continuedev/continue/blob/main/gui/src/pages/config/sections/UserSettingsSection.tsx)
- [gui/src/pages/config/sections/ModelsSection.tsx](https://github.com/continuedev/continue/blob/main/gui/src/pages/config/sections/ModelsSection.tsx)
- [packages/config-yaml/src/validation.ts](https://github.com/continuedev/continue/blob/main/packages/config-yaml/src/validation.ts)
- [gui/src/components/OnboardingLocalTab.tsx](https://github.com/continuedev/continue/blob/main/gui/src/components/OnboardingLocalTab.tsx)
- [gui/src/components/console/Start.tsx](https://github.com/continuedev/continue/blob/main/gui/src/components/console/Start.tsx)
- [extensions/cli/src/ui/IntroMessage.tsx](https://github.com/continuedev/continue/blob/main/extensions/cli/src/ui/IntroMessage.tsx)
</details>

# Autocomplete System

The Autocomplete System is a core feature of Continue that provides intelligent inline code completions as users type. It leverages fill-in-the-middle (FIM) techniques and contextual information from the codebase to generate relevant code suggestions, enhancing developer productivity across supported IDEs.

## Overview

The autocomplete functionality in Continue operates through a multi-layered architecture that handles:

- **Model Selection**: Dedicated models optimized for completion tasks
- **Context Retrieval**: Fetching relevant code snippets from the codebase
- **Template Processing**: Formatting prompts for the completion model
- **Streaming Results**: Real-time delivery of completion suggestions

The system integrates with both VS Code and JetBrains extensions, providing a unified autocomplete experience across different development environments.

## Model Configuration

### Autocomplete Model Roles

Continue distinguishes between different model roles in its configuration system. The autocomplete role specifically manages models used for inline code completions.

| Role | Purpose | Documentation |
|------|---------|---------------|
| `autocomplete` | Used in inline code completions as you type | [Setup Guide](https://docs.continue.dev/features/tab-autocomplete) |
| `chat` | Interactive chat conversations | Model configuration |
| `edit` | Transforming selected code sections | Edit feature docs |

资料来源：[gui/src/pages/config/sections/ModelsSection.tsx:1-50]()

### Model Validation

The system validates that selected autocomplete models are appropriate for the task. Models not trained for tab-autocomplete generate a warning because they produce low-quality suggestions.

```typescript
const nonAutocompleteModels = [
  "gpt-4",
  "gpt-3.5",
  "claude",
  "mistral",
  "instruct",
];

if (
  nonAutocompleteModels.some((m) => modelName.includes(m)) &&
  !modelName.includes("deepseek") &&
  !modelName.includes("codestral") &&
  !modelName.toLowerCase().includes("coder")
) {
  errors.push({
    fatal: false,
    message: `${model.model} is not trained for tab-autocomplete, and will result in low-quality suggestions.`,
  });
}
```

资料来源：[packages/config-yaml/src/validation.ts](https://github.com/continuedev/continue/blob/main/packages/config-yaml/src/validation.ts)

The validation excludes known code completion models like DeepSeek, Codestral, and models with "coder" in their name from this warning.

### Local Model Setup

For local development, Continue supports downloading dedicated autocomplete models via Ollama:

| Model Type | Purpose |
|------------|---------|
| Chat Model | General conversation and reasoning |
| FIM Model | Fill-in-the-middle code completions |
| Embeddings Model | Semantic search for context |

资料来源：[gui/src/components/OnboardingLocalTab.tsx](https://github.com/continuedev/continue/blob/main/gui/src/components/OnboardingLocalTab.tsx)

## Configuration Settings

### User Settings Panel

The autocomplete behavior can be customized through several configuration options:

| Setting | Type | Default | Range | Description |
|---------|------|---------|-------|-------------|
| Multiline Completions | select | "auto" | auto, always, never | Controls multiline completion behavior |
| Autocomplete Timeout | number | varies | 100-5000ms | Maximum request time for autocomplete |
| Autocomplete Debounce | number | varies | 0-2500ms | Delay before triggering autocomplete after changes |
| Disable Patterns | input | empty | glob patterns | File patterns where autocomplete is disabled |

资料来源：[gui/src/pages/config/sections/UserSettingsSection.tsx:1-80]()

#### Multiline Completions Mode

The multiline setting controls how the system handles suggestions that span multiple lines:

- **Auto**: System decides based on context
- **Always**: Always show multiline completions
- **Never**: Restrict to single-line suggestions

#### Disable Autocomplete Patterns

Users can specify glob patterns to disable autocomplete in specific files:

```
**/*.(txt,md)
```

资料来源：[gui/src/pages/config/sections/UserSettingsSection.tsx](https://github.com/continuedev/continue/blob/main/gui/src/pages/config/sections/UserSettingsSection.tsx)

## Autocomplete Request Flow

### Request Structure

When an autocomplete request is initiated, the system captures several key pieces of information:

```mermaid
graph TD
    A[User Types] --> B{Debounce Timer}
    B -->|delay elapsed| C[Generate Prefix]
    C --> D[Generate Suffix]
    D --> E[Fetch Context]
    E --> F[Build Prompt Template]
    F --> G[Send to Model]
    G --> H[Stream Completions]
    H --> I[Render Suggestions]
```

### Request Payload Components

The autocomplete request includes the following components:

| Component | Description |
|-----------|-------------|
| `prefix` | Text before the cursor position |
| `suffix` | Text after the cursor position |
| `options` | Model configuration and parameters |

资料来源：[gui/src/components/console/Start.tsx](https://github.com/continuedev/continue/blob/main/gui/src/components/console/Start.tsx)

### Timeout Handling

The autocomplete timeout setting (`modelTimeout`) defines the maximum time in milliseconds for:
1. Sending the completion request to the model
2. Receiving the response back

```typescript
<UserSetting
  type="number"
  title="Autocomplete Timeout (ms)"
  description="Maximum time in milliseconds for autocomplete request/retrieval."
  value={modelTimeout}
  onChange={(val) => handleUpdate({ modelTimeout: val })}
  min={100}
  max={5000}
/>
```

资料来源：[gui/src/pages/config/sections/UserSettingsSection.tsx](https://github.com/continuedev/continue/blob/main/gui/src/pages/config/sections/UserSettingsSection.tsx)

## Debouncing Mechanism

The debounce delay controls how frequently autocomplete requests are triggered:

```
User Input → Debounce Timer (delay) → Autocomplete Request
     ↓
   More Input → Timer Reset
```

| Debounce Value | Behavior |
|----------------|----------|
| 0 | No debouncing, immediate requests |
| 500-1000ms | Standard debouncing for most use cases |
| 2000+ ms | Heavy debouncing, reduced server load |

The minimum value of 0 disables debouncing entirely, while the maximum of 2500ms prevents excessive requests during rapid typing.

资料来源：[gui/src/pages/config/sections/UserSettingsSection.tsx](https://github.com/continuedev/continue/blob/main/gui/src/pages/config/sections/UserSettingsSection.tsx)

## Model Capability Warnings

The CLI intro message displays warnings when the selected model may not be optimal for autocomplete:

```typescript
{model && !modelCapable && (
  <>
    <ModelCapabilityWarning
      modelName={model.name.split("/").pop() || model.name}
    />
    <Text> </Text>
  </>
)}
```

资料来源：[extensions/cli/src/ui/IntroMessage.tsx](https://github.com/continuedev/continue/blob/main/extensions/cli/src/ui/IntroMessage.tsx)

These warnings help users understand when they should select a different model for better autocomplete performance.

## Architecture Summary

```mermaid
graph TD
    subgraph "Configuration Layer"
        A[User Settings] --> B[Model Selection]
        B --> C[Validation]
    end
    
    subgraph "Request Processing"
        D[Debounce Service] --> E[Prefix/Suffix Extraction]
        E --> F[Context Retrieval]
        F --> G[Template Processing]
    end
    
    subgraph "Model Layer"
        G --> H[Autocomplete Model]
        H --> I[Completion Streamer]
    end
    
    subgraph "UI Layer"
        I --> J[Suggestion Renderer]
        C --> J
    end
```

## JetBrains Integration

The autocomplete system has platform-specific behavior. In JetBrains IDEs, the model selector is rendered inline within the autocomplete UI, whereas VS Code uses a separate configuration panel.

```typescript
{/* Jetbrains has a model selector inline */}
{!jetbrains && (
  <>
    <Divider />
    <ModelRoleRow
      role="edit"
      displayName="Edit"
      shortcut={<Shortcut>cmd I</Shortcut>}
      ...
    />
  </>
)}
```

资料来源：[gui/src/pages/config/sections/ModelsSection.tsx](https://github.com/continuedev/continue/blob/main/gui/src/pages/config/sections/ModelsSection.tsx)

## Best Practices

1. **Model Selection**: Use models specifically designed for code completion (e.g., StarCoder, CodeLlama, DeepSeek Coder)
2. **Timeout Tuning**: Adjust timeout based on network latency and model response time
3. **Debounce Optimization**: Balance between responsiveness and server load
4. **Pattern Exclusion**: Disable autocomplete in documentation and text files to reduce noise

## Related Documentation

- [Tab Autocomplete Feature](https://docs.continue.dev/features/tab-autocomplete)
- [Troubleshooting Guide](https://docs.continue.dev/troubleshooting)
- [Continue Website](https://continue.dev)

---

<a id='next-edit'></a>

## Next Edit Feature

### 相关页面

相关主题：[Autocomplete System](#autocomplete), [Chat and Agent System](#chat-system)

<details>
<summary>相关源码文件</summary>

以下源码文件用于生成本页说明：

- [core/nextEdit/NextEditProvider.ts](https://github.com/continuedev/continue/blob/main/core/nextEdit/NextEditProvider.ts)
- [core/nextEdit/context/processNextEditData.ts](https://github.com/continuedev/continue/blob/main/core/nextEdit/context/processNextEditData.ts)
- [core/nextEdit/providers/BaseNextEditProvider.ts](https://github.com/continuedev/continue/blob/main/core/nextEdit/providers/BaseNextEditProvider.ts)
- [core/nextEdit/providers/InstinctNextEditProvider.ts](https://github.com/continuedev/continue/blob/main/core/nextEdit/providers/InstinctNextEditProvider.ts)
</details>

# Next Edit Feature

The **Next Edit Feature** is a code transformation system in Continue that enables users to modify selected code sections using AI-powered edit operations. It provides an alternative editing paradigm to inline completions, allowing for precise, intentional transformations of existing code.

## Architecture Overview

The Next Edit system follows a provider-based architecture with a clear separation between the core provider interface and specific implementations.

```mermaid
graph TD
    A[Continue Core] --> B[NextEditProvider]
    B --> C[BaseNextEditProvider]
    C --> D[InstinctNextEditProvider]
    B --> E[Other Providers]
    
    F[processNextEditData] --> B
    G[User Selection] --> H[Edit Request]
    H --> B
    B --> I[Transformed Code]
```

## Core Components

### NextEditProvider

The main interface that defines the contract for all edit providers. It handles the core logic for receiving edit requests and returning transformed code.

| Property | Type | Description |
|----------|------|-------------|
| `name` | `string` | Provider identifier |
| `getInsertion` | `method` | Handles code transformation logic |
| `prepareContext` | `method` | Prepares context for edit operations |

资料来源：[core/nextEdit/NextEditProvider.ts]()

### BaseNextEditProvider

Abstract base class providing common functionality for all edit providers. Implements shared logic for context preparation and response handling.

| Method | Purpose |
|--------|---------|
| `getInsertion` | Core edit transformation method |
| `prepareContext` | Context setup for edit operations |
| `validateInput` | Input validation before processing |

资料来源：[core/nextEdit/providers/BaseNextEditProvider.ts]()

### InstinctNextEditProvider

The default implementation of the edit provider that uses Instinct (Continue's internal model interaction system) for code transformations. This provider handles the actual LLM-based edit generation.

资料来源：[core/nextEdit/providers/InstinctNextEditProvider.ts]()

## Data Processing Pipeline

```mermaid
graph LR
    A[User Code Selection] --> B[processNextEditData]
    B --> C[Context Preparation]
    C --> D[LLM Request]
    D --> E[Edit Response]
    E --> F[Validation]
    F --> G[Transformed Code Output]
```

### processNextEditData

Handles preprocessing of edit requests before they reach the provider. This module transforms raw user input into a format suitable for model inference.

**Responsibilities:**
- Parse and validate edit request payloads
- Extract relevant code context from the selection
- Format context for optimal model understanding

资料来源：[core/nextEdit/context/processNextEditData.ts]()

## Integration Points

### Model Configuration

The edit feature requires a configured "edit" model role. This is visible in the model selection UI:

```typescript
// From ModelsSection.tsx - Edit model configuration
<ModelRoleRow
  role="edit"
  displayName="Edit"
  shortcut={<span className="text-2xs text-description-muted">(<Shortcut>cmd I</Shortcut>)</span>}
  description="Used to transform a selected section of code"
/>
```

资料来源：[gui/src/pages/config/sections/ModelsSection.tsx:85-107]()

### UI Integration

The edit feature integrates with the main chat interface through the `ContinueInputBox` component and supports edit mode transitions.

```typescript
// Keyboard shortcut handling from editorConfig.ts
Escape: () => {
  if (isInEditRef.current) {
    void dispatch(exitEdit({ openNewSession: false }));
  }
  return true;
}
```

资料来源：[gui/src/components/mainInput/TipTapEditor/utils/editorConfig.ts:95-101]()

### Session Management

Edit operations are tracked within the session state for undo/history purposes:

```typescript
// From sessionSlice.ts
updateSessionMetadata: (
  state,
  { payload }: PayloadAction<{ sessionId: string } & Partial<BaseSessionMetadata>>
) => {
  state.allSessionMetadata = state.allSessionMetadata.map((session) =>
    session.sessionId === payload.sessionId ? { ...session, ...payload } : session
  );
}
```

资料来源：[gui/src/redux/slices/sessionSlice.ts:89-102]()

## Workflow Sequence

```mermaid
sequenceDiagram
    participant User
    participant Editor
    participant NextEditProvider
    participant LLM
    participant Session

    User->>Editor: Select code + Trigger edit
    Editor->>NextEditProvider: Send edit request
    NextEditProvider->>processNextEditData: Prepare context
    processNextEditData->>NextEditProvider: Formatted context
    NextEditProvider->>LLM: Request transformation
    LLM->>NextEditProvider: Edit suggestions
    NextEditProvider->>Editor: Display diff preview
    User->>Editor: Accept/Reject
    Editor->>Session: Record change
```

## Provider Implementation Pattern

```typescript
// Conceptual pattern from provider implementations
class CustomNextEditProvider extends BaseNextEditProvider {
  async getInsertion(
    code: string,
    focusedIndex: number,
    preContext: string,
    postContext: string
  ): Promise<EditResult> {
    // Custom implementation
    const context = this.prepareContext(code, preContext, postContext);
    const response = await this.model.complete(context);
    return this.processResponse(response);
  }
}
```

## Related Systems

| System | Relationship |
|--------|--------------|
| Chat System | Edit requests flow through chat interface |
| Model Selection | Requires configured "edit" model |
| Session History | Edit operations are tracked in session state |
| Slash Commands | `/edit` command triggers edit mode |

资料来源：[extensions/cli/src/slashCommands.ts]()

## Configuration Requirements

1. **Model Setup**: An "edit" role model must be configured in Continue's config
2. **API Access**: Model must support code transformation capabilities
3. **Context Window**: Sufficient context length for code + instructions

## Error Handling

The system includes error boundaries for graceful failure handling:

```typescript
// From Chat.tsx - Error boundary wrapping
<ErrorBoundary
  FallbackComponent={fallbackRender}
  onReset={() => { dispatch(newSession()); }}
>
  {renderChatHistoryItem(item, index)}
</ErrorBoundary>
```

资料来源：[gui/src/pages/gui/Chat.tsx:142-147]()

## Summary

The Next Edit Feature provides a structured approach to AI-assisted code transformation within Continue. By leveraging a provider-based architecture, it maintains flexibility for different LLM backends while providing consistent edit capabilities. The feature integrates with the broader Continue system including model configuration, session management, and the chat interface.

---

<a id='config-system'></a>

## Configuration System

### 相关页面

相关主题：[Core Library](#core-library)

<details>
<summary>相关源码文件</summary>

以下源码文件用于生成本页说明：

- [gui/src/components/config/FatalErrorNotice.tsx](https://github.com/continuedev/continue/blob/main/gui/src/components/config/FatalErrorNotice.tsx)
- [gui/src/pages/config/sections/ModelsSection.tsx](https://github.com/continuedev/continue/blob/main/gui/src/pages/config/sections/ModelsSection.tsx)
- [gui/src/pages/config/components/ModelRoleSelector.tsx](https://github.com/continuedev/continue/blob/main/gui/src/pages/config/components/ModelRoleSelector.tsx)
- [gui/src/pages/config/sections/IndexingSettingsSection.tsx](https://github.com/continuedev/continue/blob/main/gui/src/pages/config/sections/IndexingSettingsSection.tsx)
- [gui/src/redux/slices/sessionSlice.ts](https://github.com/continuedev/continue/blob/main/gui/src/redux/slices/sessionSlice.ts)
- [extensions/cli/src/systemMessage.ts](https://github.com/continuedev/continue/blob/main/extensions/cli/src/systemMessage.ts)
- [extensions/cli/src/slashCommands.ts](https://github.com/continuedev/continue/blob/main/extensions/cli/src/slashCommands.ts)
- [extensions/cli/src/ui/IntroMessage.tsx](https://github.com/continuedev/continue/blob/main/extensions/cli/src/ui/IntroMessage.tsx)
</details>

# Configuration System

## Overview

The Continue Configuration System manages all settings, model configurations, and behavioral parameters for the Continue AI coding assistant. It supports multiple configuration sources, profile-based configurations, and real-time UI-based configuration management.

The system is responsible for:
- Loading and validating configuration from YAML files
- Managing multiple configuration profiles
- Storing and persisting model settings
- Providing configuration state to the UI
- Supporting runtime configuration updates

```mermaid
graph TD
    A[Configuration Sources] --> B[Config Loader]
    B --> C[Config Validator]
    C --> D[Config Store]
    D --> E[UI Components]
    D --> F[CLI Components]
    D --> G[Core Engine]
```

## Configuration Sources

### YAML Configuration Files

The primary configuration source is a `config.yaml` file located in the user's configuration directory. This file defines models, slash commands, rules, MCP servers, and other settings.

资料来源：[gui/src/pages/config/sections/IndexingSettingsSection.tsx:1-50]()

### Profile-Based Configuration

Continue supports multiple configuration profiles, allowing users to maintain separate configurations for different use cases or environments. Profiles can be selected and managed through the UI.

资料来源：[extensions/cli/src/slashCommands.ts:20-30]()

### Runtime Configuration

The system also maintains runtime configuration state through Redux, allowing dynamic updates without requiring file changes.

资料来源：[gui/src/redux/slices/sessionSlice.ts:1-80]()

## Configuration State Management

### Redux Store Integration

The configuration state is managed through Redux slices, with the session slice handling configuration-related state updates.

```typescript
// Configuration state structure (simplified)
interface ConfigState {
  config: ContinuercJson;
  selectedModelByRole: {
    chat?: string;
    autocomplete?: string;
    edit?: string;
  };
  modelsByRole: {
    [role: string]: any[];
  };
}
```

资料来源：[gui/src/redux/slices/sessionSlice.ts:50-100]()

### Configuration Updates

The system supports optimistic updates for session metadata and configuration changes:

```typescript
updateSessionMetadata: (state, { payload }) => {
  state.allSessionMetadata = state.allSessionMetadata.map((session) =>
    session.sessionId === payload.sessionId
      ? { ...session, ...payload }
      : session
  );
}
```

资料来源：[gui/src/redux/slices/sessionSlice.ts:60-75]()

## Model Configuration

### Model Roles

Continue supports multiple model roles with distinct purposes:

| Role | Purpose | UI Component |
|------|---------|--------------|
| `chat` | Main conversation model | ModelRoleSelector |
| `autocomplete` | Inline code completions | ModelRoleSelector |
| `edit` | Code transformation/ editing | ModelRoleSelector |

资料来源：[gui/src/pages/config/sections/ModelsSection.tsx:1-80]()

### Model Selection UI

The model selection interface displays available models with their configuration status:

```typescript
// Model configuration status checks
const isConfigInvalid = option.configurationStatus !== LLMConfigurationStatuses.VALID;
let invalidMessage = "(Invalid config)";
if (option.configurationStatus === LLMConfigurationStatuses.MISSING_ENV_SECRET) {
  invalidMessage = "(Missing env secret)";
}
if (option.configurationStatus === LLMConfigurationStatuses.MISSING_API_KEY) {
  invalidMessage = "(Missing API Key)";
}
```

资料来源：[gui/src/pages/config/components/ModelRoleSelector.tsx:1-50]()

### Model Display

Models are sorted alphabetically and displayed with provider icons and status indicators:

```typescript
{[...models]
  .sort((a, b) => a.title.localeCompare(b.title))
  .map((option, idx) => (
    <ListboxOption key={idx} value={option.title}>
      <CubeIcon />
      <span className="line-clamp-1 truncate">
        {option.title}
        {isConfigInvalid && <span className="ml-2 text-[10px] italic">
          {invalidMessage}
        </span>}
      </span>
    </ListboxOption>
  ))}
```

资料来源：[gui/src/pages/config/components/ModelRoleSelector.tsx:60-80]()

## Configuration Error Handling

### Fatal Error Notice

When configuration loading fails, a fatal error UI is displayed that disables chat functionality until resolved:

```typescript
const FatalErrorNotice = ({ configLoading, refreshProfiles }) => {
  return (
    <Alert type="error" className="mx-2 my-1 px-2">
      <span>Error loading</span>{" "}
      <span className="italic">{displayName}</span>
      <span>. Chat is disabled until a model is available.</span>
      <div className="mt-2 flex flex-row flex-wrap items-center gap-x-3 gap-y-1.5">
        <div onClick={() => ideMessenger.post("openUrl", "https://docs.continue.dev/troubleshooting")}>
          Help
        </div>
        <div onClick={() => refreshProfiles("Clicked reload in fatal indicator")}>
          Reload
        </div>
      </div>
    </Alert>
  );
};
```

资料来源：[gui/src/components/config/FatalErrorNotice.tsx:1-45]()

### Configuration Reload Flow

The configuration can be reloaded through the UI, which triggers a fresh load attempt:

```mermaid
graph TD
    A[User Clicks Reload] --> B[refreshProfiles Action]
    B --> C[Config Loader]
    C --> D{Load Success?}
    D -->|Yes| E[Update Redux State]
    D -->|No| F[Show Fatal Error]
    E --> G[Enable Chat]
    F --> H[Disable Chat]
```

资料来源：[gui/src/components/config/FatalErrorNotice.tsx:30-40]()

## CLI Configuration System

### System Message Generation

The CLI builds system messages that incorporate configuration settings for AI model interactions:

```typescript
function buildSystemMessage(config, options) {
  let systemMessage = "";

  // Commit signature configuration
  if (!process.env.CONTINUE_CLI_DISABLE_COMMIT_SIGNATURE) {
    systemMessage += `\n<context name="commitSignature">
Generated with [Continue](https://continue.dev)
Co-Authored-By: Continue <noreply@continue.dev>
</context>\n`;
  }

  // Headless mode instructions
  if (headless) {
    systemMessage += `IMPORTANT: You are running in headless mode. 
    Provide ONLY your final answer.`;
  }

  // JSON format instructions
  if (format === "json") {
    systemMessage += `IMPORTANT: You are operating in JSON output mode. 
    Your final response MUST be valid JSON.`;
  }

  return systemMessage;
}
```

资料来源：[extensions/cli/src/systemMessage.ts:1-50]()

### Slash Command Configuration

Configuration can be accessed via slash commands in the CLI:

```typescript
const slashCommands = {
  config: () => {
    return { openConfigSelector: true };
  },
  model: () => ({ openModelSelector: true }),
  mcp: () => ({ openMcpSelector: true }),
  // ... other commands
};
```

资料来源：[extensions/cli/src/slashCommands.ts:15-25]()

### Intro Message Display

The CLI displays current configuration status including model and config information:

```typescript
const IntroMessage = ({ config, model, modelCapable }) => {
  return (
    <Box>
      {config && (
        <Text color="blue">
          <Text bold>Config:</Text> <Text color="white">{config.name}</Text>
        </Text>
      )}
      {model ? (
        <Text color="blue">
          <Text bold>Model:</Text>{" "}
          <Text color="white">{model.name.split("/").pop()}</Text>
        </Text>
      ) : (
        <Text color="blue">
          <Text bold>Model:</Text> <Text color="dim">Loading...</Text>
        </Text>
      )}
    </Box>
  );
};
```

资料来源：[extensions/cli/src/ui/IntroMessage.tsx:1-40]()

## Configuration Sections

### Indexing Settings

The configuration system includes indexing settings (now deprecated):

```typescript
function IndexingSettingsSection() {
  const config = useAppSelector((state) => state.config.config);
  const disableIndexing = config.disableIndexing ?? false;

  return (
    <Alert type="warning" className="mb-6">
      <div className="space-y-4">
        <div>
          <div className="-mt-0.5 text-sm font-medium">
            Indexing has been deprecated
          </div>
        </div>
      </div>
    </Alert>
  );
}
```

资料来源：[gui/src/pages/config/sections/IndexingSettingsSection.tsx:20-40]()

### Help Section

The configuration UI includes a help section with links to documentation and troubleshooting resources:

```typescript
<ConfigRow
  title="Token usage"
  description="Daily token usage across models"
  icon={TableCellsIcon}
  onClick={() => navigate(ROUTES.STATS)}
/>
```

资料来源：[gui/src/pages/config/sections/HelpSection.tsx:1-40]()

## Configuration Flow Diagram

```mermaid
sequenceDiagram
    participant User
    participant UI as UI Components
    participant Redux as Redux Store
    participant Loader as Config Loader
    participant FS as File System
    
    User->>UI: Changes configuration
    UI->>Redux: Dispatch updateSessionMetadata
    Redux-->>UI: Update state
    User->>UI: Trigger reload
    UI->>Loader: loadConfig()
    Loader->>FS: Read config.yaml
    FS-->>Loader: Return config
    Loader->>Loader: Validate config
    Loader-->>Redux: Update config state
    Redux-->>UI: Refresh UI
```

## Configuration Validation

### Model Configuration Status

The system validates model configurations and reports various status conditions:

| Status | Description | User Message |
|--------|-------------|--------------|
| `VALID` | Configuration is valid | None shown |
| `MISSING_ENV_SECRET` | Environment secret not set | "(Missing env secret)" |
| `MISSING_API_KEY` | API key not configured | "(Missing API Key)" |
| Other | General invalid state | "(Invalid config)" |

资料来源：[gui/src/pages/config/components/ModelRoleSelector.tsx:20-35]()

## Related Documentation

- [Continue Documentation](https://docs.continue.dev)
- [Troubleshooting Guide](https://docs.continue.dev/troubleshooting)
- [Configuration Reference](https://continue.dev/walkthrough)
- [Changelog](https://changelog.continue.dev)

---

---

## Doramagic 踩坑日志

项目：continuedev/continue

摘要：发现 38 个潜在踩坑项，其中 8 个为 high/blocking；最高优先级：安装坑 - 来源证据："Headers not defined" -> This time with logs。

## 1. 安装坑 · 来源证据："Headers not defined" -> This time with logs

- 严重度：high
- 证据强度：source_linked
- 发现：GitHub 社区证据显示该项目存在一个安装相关的待验证问题："Headers not defined" -> This time with logs
- 对用户的影响：可能增加新用户试用和生产接入成本。
- 建议检查：来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。
- 防护动作：不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。
- 证据：community_evidence:github | cevd_0c0fcf2034914a62a81e3374d2d7d0a5 | https://github.com/continuedev/continue/issues/12163 | 来源讨论提到 linux 相关条件，需在安装/试用前复核。

## 2. 配置坑 · 来源证据：(sse) mcp restarts breaks communication

- 严重度：high
- 证据强度：source_linked
- 发现：GitHub 社区证据显示该项目存在一个配置相关的待验证问题：(sse) mcp restarts breaks communication
- 对用户的影响：可能增加新用户试用和生产接入成本。
- 建议检查：来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。
- 防护动作：不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。
- 证据：community_evidence:github | cevd_5cb9bc1f10144ec7948f8784dc25bf12 | https://github.com/continuedev/continue/issues/12431 | 来源类型 github_issue 暴露的待验证使用条件。

## 3. 配置坑 · 来源证据：Continue fails to stablish mTLS connection with server

- 严重度：high
- 证据强度：source_linked
- 发现：GitHub 社区证据显示该项目存在一个配置相关的待验证问题：Continue fails to stablish mTLS connection with server
- 对用户的影响：可能增加新用户试用和生产接入成本。
- 建议检查：来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。
- 防护动作：不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。
- 证据：community_evidence:github | cevd_01756ce44b144ad4a34ea4c5e99e339b | https://github.com/continuedev/continue/issues/8470 | 来源讨论提到 windows 相关条件，需在安装/试用前复核。

## 4. 配置坑 · 来源证据：Session Workspace always assumes first workspace folder

- 严重度：high
- 证据强度：source_linked
- 发现：GitHub 社区证据显示该项目存在一个配置相关的待验证问题：Session Workspace always assumes first workspace folder
- 对用户的影响：可能增加新用户试用和生产接入成本。
- 建议检查：来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。
- 防护动作：不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。
- 证据：community_evidence:github | cevd_1e621c9277a64cb581639efad6bd6b73 | https://github.com/continuedev/continue/issues/4539 | 来源类型 github_issue 暴露的待验证使用条件。

## 5. 安全/权限坑 · 失败模式：security_permissions: PR checks do not create fresh agent sessions on PR updates; stale task IDs re-post to new com...

- 严重度：high
- 证据强度：source_linked
- 发现：Developers should check this security_permissions risk before relying on the project: PR checks do not create fresh agent sessions on PR updates; stale task IDs re-post to new commits
- 对用户的影响：Developers may expose sensitive permissions or credentials: PR checks do not create fresh agent sessions on PR updates; stale task IDs re-post to new commits
- 建议检查：Before packaging this project, run the relevant install/config/quickstart check for: PR checks do not create fresh agent sessions on PR updates; stale task IDs re-post to new commits. Context: Observed when using macos
- 防护动作：Do not recommend enabling privileged or credential-bearing paths until the source-backed risk is reviewed: https://github.com/continuedev/continue/issues/12382
- 证据：failure_mode_cluster:github_issue | fmev_07a692e49161cfab20c466f1f0b957d1 | https://github.com/continuedev/continue/issues/12382 | PR checks do not create fresh agent sessions on PR updates; stale task IDs re-post to new commits

## 6. 安全/权限坑 · 来源证据：Autocomplete for code is not working

- 严重度：high
- 证据强度：source_linked
- 发现：GitHub 社区证据显示该项目存在一个安全/权限相关的待验证问题：Autocomplete for code is not working
- 对用户的影响：可能影响授权、密钥配置或安全边界。
- 建议检查：来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。
- 防护动作：不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。
- 证据：community_evidence:github | cevd_e1f8ba56c9b140e8a61444ad20181cd9 | https://github.com/continuedev/continue/issues/12298 | 来源讨论提到 windows 相关条件，需在安装/试用前复核。

## 7. 安全/权限坑 · 来源证据：Make the user settings declarative

- 严重度：high
- 证据强度：source_linked
- 发现：GitHub 社区证据显示该项目存在一个安全/权限相关的待验证问题：Make the user settings declarative
- 对用户的影响：可能影响升级、迁移或版本选择。
- 建议检查：来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。
- 防护动作：不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。
- 证据：community_evidence:github | cevd_a5ebcd3bc7be4e949b45351fd5b06873 | https://github.com/continuedev/continue/issues/5438 | 来源讨论提到 api key 相关条件，需在安装/试用前复核。

## 8. 安全/权限坑 · 来源证据：Responses from LLM's running from LocalAI are not detected

- 严重度：high
- 证据强度：source_linked
- 发现：GitHub 社区证据显示该项目存在一个安全/权限相关的待验证问题：Responses from LLM's running from LocalAI are not detected
- 对用户的影响：可能影响授权、密钥配置或安全边界。
- 建议检查：来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。
- 防护动作：不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。
- 证据：community_evidence:github | cevd_8aabc2e01f8646e2a22d44dbcad4ad99 | https://github.com/continuedev/continue/issues/10113 | 来源讨论提到 python 相关条件，需在安装/试用前复核。

## 9. 安装坑 · 失败模式：installation: Support Context7

- 严重度：medium
- 证据强度：source_linked
- 发现：Developers should check this installation risk before relying on the project: Support Context7
- 对用户的影响：Developers may fail before the first successful local run: Support Context7
- 建议检查：Before packaging this project, run the relevant install/config/quickstart check for: Support Context7. Context: Observed during installation or first-run setup.
- 防护动作：State this as source-backed community evidence, not as Doramagic reproduction.
- 证据：failure_mode_cluster:github_issue | fmev_dd0ac59c1a237815f09072ae6ef6bbbd | https://github.com/continuedev/continue/issues/5836 | Support Context7

## 10. 安装坑 · 失败模式：installation: Terminal commands fail when `$SHELL` is set to `tcsh` due to hardcoded `-l` shell flag

- 严重度：medium
- 证据强度：source_linked
- 发现：Developers should check this installation risk before relying on the project: Terminal commands fail when `$SHELL` is set to `tcsh` due to hardcoded `-l` shell flag
- 对用户的影响：Developers may fail before the first successful local run: Terminal commands fail when `$SHELL` is set to `tcsh` due to hardcoded `-l` shell flag
- 建议检查：Before packaging this project, run the relevant install/config/quickstart check for: Terminal commands fail when `$SHELL` is set to `tcsh` due to hardcoded `-l` shell flag. Context: Observed when using linux
- 防护动作：State this as source-backed community evidence, not as Doramagic reproduction.
- 证据：failure_mode_cluster:github_issue | fmev_682551ed88a7b527a9f1207eecd2a1c6 | https://github.com/continuedev/continue/issues/12378 | Terminal commands fail when `$SHELL` is set to `tcsh` due to hardcoded `-l` shell flag

## 11. 安装坑 · 失败模式：installation: The extension doesn't show up at all.

- 严重度：medium
- 证据强度：source_linked
- 发现：Developers should check this installation risk before relying on the project: The extension doesn't show up at all.
- 对用户的影响：Developers may fail before the first successful local run: The extension doesn't show up at all.
- 建议检查：Before packaging this project, run the relevant install/config/quickstart check for: The extension doesn't show up at all.. Context: Observed when using windows
- 防护动作：State this as source-backed community evidence, not as Doramagic reproduction.
- 证据：failure_mode_cluster:github_issue | fmev_1a64ddb9e5d24401d02abdc046398202 | https://github.com/continuedev/continue/issues/1312 | The extension doesn't show up at all.

## 12. 安装坑 · 来源证据：Support Context7

- 严重度：medium
- 证据强度：source_linked
- 发现：GitHub 社区证据显示该项目存在一个安装相关的待验证问题：Support Context7
- 对用户的影响：可能增加新用户试用和生产接入成本。
- 建议检查：来源显示可能已有修复、规避或版本变化，说明书中必须标注适用版本。
- 防护动作：不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。
- 证据：community_evidence:github | cevd_fa7735b8be6f4ac9840501ac84eb7e9a | https://github.com/continuedev/continue/issues/5836 | 来源类型 github_issue 暴露的待验证使用条件。

## 13. 安装坑 · 来源证据：Terminal commands fail when `$SHELL` is set to `tcsh` due to hardcoded `-l` shell flag

- 严重度：medium
- 证据强度：source_linked
- 发现：GitHub 社区证据显示该项目存在一个安装相关的待验证问题：Terminal commands fail when `$SHELL` is set to `tcsh` due to hardcoded `-l` shell flag
- 对用户的影响：可能增加新用户试用和生产接入成本。
- 建议检查：来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。
- 防护动作：不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。
- 证据：community_evidence:github | cevd_823b2e0ae1ad49a78bd0a45d39a3099a | https://github.com/continuedev/continue/issues/12378 | 来源讨论提到 linux 相关条件，需在安装/试用前复核。

## 14. 安装坑 · 来源证据：The extension doesn't show up at all.

- 严重度：medium
- 证据强度：source_linked
- 发现：GitHub 社区证据显示该项目存在一个安装相关的待验证问题：The extension doesn't show up at all.
- 对用户的影响：可能增加新用户试用和生产接入成本。
- 建议检查：来源显示可能已有修复、规避或版本变化，说明书中必须标注适用版本。
- 防护动作：不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。
- 证据：community_evidence:github | cevd_5d86070fe9d941ad9a44f1d09464b582 | https://github.com/continuedev/continue/issues/1312 | 来源讨论提到 windows 相关条件，需在安装/试用前复核。

## 15. 配置坑 · 失败模式：configuration: "Headers not defined" -> This time with logs

- 严重度：medium
- 证据强度：source_linked
- 发现：Developers should check this configuration risk before relying on the project: "Headers not defined" -> This time with logs
- 对用户的影响：Developers may misconfigure credentials, environment, or host setup: "Headers not defined" -> This time with logs
- 建议检查：Before packaging this project, run the relevant install/config/quickstart check for: "Headers not defined" -> This time with logs. Context: Observed when using linux
- 防护动作：State this as source-backed community evidence, not as Doramagic reproduction.
- 证据：failure_mode_cluster:github_issue | fmev_b136994a3d92fcde3550fdd83c67a11a | https://github.com/continuedev/continue/issues/12163 | "Headers not defined" -> This time with logs

## 16. 配置坑 · 失败模式：configuration: 400 Error

- 严重度：medium
- 证据强度：source_linked
- 发现：Developers should check this configuration risk before relying on the project: 400 Error
- 对用户的影响：Developers may misconfigure credentials, environment, or host setup: 400 Error
- 建议检查：Before packaging this project, run the relevant install/config/quickstart check for: 400 Error. Context: Observed when using python, windows
- 防护动作：State this as source-backed community evidence, not as Doramagic reproduction.
- 证据：failure_mode_cluster:github_issue | fmev_17872a6a18ab3c162f5282a7fd2f789c | https://github.com/continuedev/continue/issues/5079 | 400 Error

## 17. 配置坑 · 失败模式：configuration: Autocomplete for code is not working

- 严重度：medium
- 证据强度：source_linked
- 发现：Developers should check this configuration risk before relying on the project: Autocomplete for code is not working
- 对用户的影响：Developers may misconfigure credentials, environment, or host setup: Autocomplete for code is not working
- 建议检查：Before packaging this project, run the relevant install/config/quickstart check for: Autocomplete for code is not working. Context: Observed when using windows, linux
- 防护动作：State this as source-backed community evidence, not as Doramagic reproduction.
- 证据：failure_mode_cluster:github_issue | fmev_fef11e43c412193f501c74f86fb0aad1 | https://github.com/continuedev/continue/issues/12298 | Autocomplete for code is not working

## 18. 配置坑 · 失败模式：configuration: Config error with ollama cloud

- 严重度：medium
- 证据强度：source_linked
- 发现：Developers should check this configuration risk before relying on the project: Config error with ollama cloud
- 对用户的影响：Developers may misconfigure credentials, environment, or host setup: Config error with ollama cloud
- 建议检查：Before packaging this project, run the relevant install/config/quickstart check for: Config error with ollama cloud. Context: Observed when using macos
- 防护动作：State this as source-backed community evidence, not as Doramagic reproduction.
- 证据：failure_mode_cluster:github_issue | fmev_f69ce9c50b7a535cc6c3d0dfe8741e08 | https://github.com/continuedev/continue/issues/12370 | Config error with ollama cloud

## 19. 配置坑 · 失败模式：configuration: Continue fails to stablish mTLS connection with server

- 严重度：medium
- 证据强度：source_linked
- 发现：Developers should check this configuration risk before relying on the project: Continue fails to stablish mTLS connection with server
- 对用户的影响：Developers may misconfigure credentials, environment, or host setup: Continue fails to stablish mTLS connection with server
- 建议检查：Before packaging this project, run the relevant install/config/quickstart check for: Continue fails to stablish mTLS connection with server. Context: Observed when using windows, linux
- 防护动作：State this as source-backed community evidence, not as Doramagic reproduction.
- 证据：failure_mode_cluster:github_issue | fmev_e6794a57836185b70c8cb8cf953cce5d | https://github.com/continuedev/continue/issues/8470 | Continue fails to stablish mTLS connection with server

## 20. 配置坑 · 失败模式：configuration: Docs: Document .continue/configs directory support

- 严重度：medium
- 证据强度：source_linked
- 发现：Developers should check this configuration risk before relying on the project: Docs: Document .continue/configs directory support
- 对用户的影响：Developers may misconfigure credentials, environment, or host setup: Docs: Document .continue/configs directory support
- 建议检查：Before packaging this project, run the relevant install/config/quickstart check for: Docs: Document .continue/configs directory support. Context: Source discussion did not expose a precise runtime context.
- 防护动作：State this as source-backed community evidence, not as Doramagic reproduction.
- 证据：failure_mode_cluster:github_issue | fmev_8c3e2cabb835c3b4e9fc6876e70792a6 | https://github.com/continuedev/continue/issues/12377 | Docs: Document .continue/configs directory support

## 21. 配置坑 · 失败模式：configuration: Docs: Document dynamic model fetching feature

- 严重度：medium
- 证据强度：source_linked
- 发现：Developers should check this configuration risk before relying on the project: Docs: Document dynamic model fetching feature
- 对用户的影响：Developers may misconfigure credentials, environment, or host setup: Docs: Document dynamic model fetching feature
- 建议检查：Before packaging this project, run the relevant install/config/quickstart check for: Docs: Document dynamic model fetching feature. Context: Source discussion did not expose a precise runtime context.
- 防护动作：State this as source-backed community evidence, not as Doramagic reproduction.
- 证据：failure_mode_cluster:github_issue | fmev_b5dbe8c0463df066db3ca81b090d9c01 | https://github.com/continuedev/continue/issues/12376 | Docs: Document dynamic model fetching feature

## 22. 配置坑 · 失败模式：configuration: Docs: Update Inception provider documentation for Mercury-2 model

- 严重度：medium
- 证据强度：source_linked
- 发现：Developers should check this configuration risk before relying on the project: Docs: Update Inception provider documentation for Mercury-2 model
- 对用户的影响：Developers may misconfigure credentials, environment, or host setup: Docs: Update Inception provider documentation for Mercury-2 model
- 建议检查：Before packaging this project, run the relevant install/config/quickstart check for: Docs: Update Inception provider documentation for Mercury-2 model. Context: Source discussion did not expose a precise runtime context.
- 防护动作：State this as source-backed community evidence, not as Doramagic reproduction.
- 证据：failure_mode_cluster:github_issue | fmev_4db8e14e6818419363054a9e7800eda2 | https://github.com/continuedev/continue/issues/12375 | Docs: Update Inception provider documentation for Mercury-2 model

## 23. 配置坑 · 失败模式：configuration: Login failed with "Not authenticated (user missing)" after account setup

- 严重度：medium
- 证据强度：source_linked
- 发现：Developers should check this configuration risk before relying on the project: Login failed with "Not authenticated (user missing)" after account setup
- 对用户的影响：Developers may misconfigure credentials, environment, or host setup: Login failed with "Not authenticated (user missing)" after account setup
- 建议检查：Before packaging this project, run the relevant install/config/quickstart check for: Login failed with "Not authenticated (user missing)" after account setup. Context: Observed when using windows
- 防护动作：State this as source-backed community evidence, not as Doramagic reproduction.
- 证据：failure_mode_cluster:github_issue | fmev_9ec05668c8e8d77892783222181856ee | https://github.com/continuedev/continue/issues/12424 | Login failed with "Not authenticated (user missing)" after account setup

## 24. 配置坑 · 失败模式：configuration: Make the user settings declarative

- 严重度：medium
- 证据强度：source_linked
- 发现：Developers should check this configuration risk before relying on the project: Make the user settings declarative
- 对用户的影响：Developers may misconfigure credentials, environment, or host setup: Make the user settings declarative
- 建议检查：Before packaging this project, run the relevant install/config/quickstart check for: Make the user settings declarative. Context: Observed when using docker
- 防护动作：State this as source-backed community evidence, not as Doramagic reproduction.
- 证据：failure_mode_cluster:github_issue | fmev_1b32aeb88d229dcc498a21a15392073b | https://github.com/continuedev/continue/issues/5438 | Make the user settings declarative

## 25. 配置坑 · 失败模式：configuration: Responses from LLM's running from LocalAI are not detected

- 严重度：medium
- 证据强度：source_linked
- 发现：Developers should check this configuration risk before relying on the project: Responses from LLM's running from LocalAI are not detected
- 对用户的影响：Developers may misconfigure credentials, environment, or host setup: Responses from LLM's running from LocalAI are not detected
- 建议检查：Before packaging this project, run the relevant install/config/quickstart check for: Responses from LLM's running from LocalAI are not detected. Context: Observed when using python, windows, linux
- 防护动作：State this as source-backed community evidence, not as Doramagic reproduction.
- 证据：failure_mode_cluster:github_issue | fmev_a997891d991d463b08f586863fa4f190 | https://github.com/continuedev/continue/issues/10113 | Responses from LLM's running from LocalAI are not detected

## 26. 配置坑 · 失败模式：configuration: v1.2.22-vscode

- 严重度：medium
- 证据强度：source_linked
- 发现：Developers should check this configuration risk before relying on the project: v1.2.22-vscode
- 对用户的影响：Upgrade or migration may change expected behavior: v1.2.22-vscode
- 建议检查：Before packaging this project, run the relevant install/config/quickstart check for: v1.2.22-vscode. Context: Source discussion did not expose a precise runtime context.
- 防护动作：State this as source-backed community evidence, not as Doramagic reproduction.
- 证据：failure_mode_cluster:github_release | fmev_16f5a708793a12c3918b445e3b11b41d | https://github.com/continuedev/continue/releases/tag/v1.2.22-vscode | v1.2.22-vscode

## 27. 能力坑 · 能力判断依赖假设

- 严重度：medium
- 证据强度：source_linked
- 发现：README/documentation is current enough for a first validation pass.
- 对用户的影响：假设不成立时，用户拿不到承诺的能力。
- 建议检查：将假设转成下游验证清单。
- 防护动作：假设必须转成验证项；没有验证结果前不能写成事实。
- 证据：capability.assumptions | github_repo:644686905 | https://github.com/continuedev/continue | README/documentation is current enough for a first validation pass.

## 28. 维护坑 · 来源证据：Unresponsive - continue.focusCOntntinueinput already registered by continre Profile 1079

- 严重度：medium
- 证据强度：source_linked
- 发现：GitHub 社区证据显示该项目存在一个维护/版本相关的待验证问题：Unresponsive - continue.focusCOntntinueinput already registered by continre Profile 1079
- 对用户的影响：可能阻塞安装或首次运行。
- 建议检查：来源显示可能已有修复、规避或版本变化，说明书中必须标注适用版本。
- 防护动作：不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。
- 证据：community_evidence:github | cevd_7a29505886e9431898131d920bb87efa | https://github.com/continuedev/continue/issues/7801 | 来源讨论提到 python 相关条件，需在安装/试用前复核。

## 29. 维护坑 · 维护活跃度未知

- 严重度：medium
- 证据强度：source_linked
- 发现：未记录 last_activity_observed。
- 对用户的影响：新项目、停更项目和活跃项目会被混在一起，推荐信任度下降。
- 建议检查：补 GitHub 最近 commit、release、issue/PR 响应信号。
- 防护动作：维护活跃度未知时，推荐强度不能标为高信任。
- 证据：evidence.maintainer_signals | github_repo:644686905 | https://github.com/continuedev/continue | last_activity_observed missing

## 30. 安全/权限坑 · 下游验证发现风险项

- 严重度：medium
- 证据强度：source_linked
- 发现：no_demo
- 对用户的影响：下游已经要求复核，不能在页面中弱化。
- 建议检查：进入安全/权限治理复核队列。
- 防护动作：下游风险存在时必须保持 review/recommendation 降级。
- 证据：downstream_validation.risk_items | github_repo:644686905 | https://github.com/continuedev/continue | no_demo; severity=medium

## 31. 安全/权限坑 · 存在评分风险

- 严重度：medium
- 证据强度：source_linked
- 发现：no_demo
- 对用户的影响：风险会影响是否适合普通用户安装。
- 建议检查：把风险写入边界卡，并确认是否需要人工复核。
- 防护动作：评分风险必须进入边界卡，不能只作为内部分数。
- 证据：risks.scoring_risks | github_repo:644686905 | https://github.com/continuedev/continue | no_demo; severity=medium

## 32. 安全/权限坑 · 来源证据：400 Error

- 严重度：medium
- 证据强度：source_linked
- 发现：GitHub 社区证据显示该项目存在一个安全/权限相关的待验证问题：400 Error
- 对用户的影响：可能影响授权、密钥配置或安全边界。
- 建议检查：来源显示可能已有修复、规避或版本变化，说明书中必须标注适用版本。
- 防护动作：不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。
- 证据：community_evidence:github | cevd_6519f0021d474af78d0178c14d9b7fc2 | https://github.com/continuedev/continue/issues/5079 | 来源讨论提到 python 相关条件，需在安装/试用前复核。

## 33. 安全/权限坑 · 来源证据：Docs: Document .continue/configs directory support

- 严重度：medium
- 证据强度：source_linked
- 发现：GitHub 社区证据显示该项目存在一个安全/权限相关的待验证问题：Docs: Document .continue/configs directory support
- 对用户的影响：可能影响授权、密钥配置或安全边界。
- 建议检查：来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。
- 防护动作：不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。
- 证据：community_evidence:github | cevd_4891275e3958456796a83007de577da8 | https://github.com/continuedev/continue/issues/12377 | 来源类型 github_issue 暴露的待验证使用条件。

## 34. 安全/权限坑 · 来源证据：Login failed with "Not authenticated (user missing)" after account setup

- 严重度：medium
- 证据强度：source_linked
- 发现：GitHub 社区证据显示该项目存在一个安全/权限相关的待验证问题：Login failed with "Not authenticated (user missing)" after account setup
- 对用户的影响：可能影响授权、密钥配置或安全边界。
- 建议检查：来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。
- 防护动作：不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。
- 证据：community_evidence:github | cevd_0e03b5d122e341b3b58881a925595069 | https://github.com/continuedev/continue/issues/12424 | 来源讨论提到 windows 相关条件，需在安装/试用前复核。

## 35. 安全/权限坑 · 来源证据：PR checks do not create fresh agent sessions on PR updates; stale task IDs re-post to new commits

- 严重度：medium
- 证据强度：source_linked
- 发现：GitHub 社区证据显示该项目存在一个安全/权限相关的待验证问题：PR checks do not create fresh agent sessions on PR updates; stale task IDs re-post to new commits
- 对用户的影响：可能影响授权、密钥配置或安全边界。
- 建议检查：来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。
- 防护动作：不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。
- 证据：community_evidence:github | cevd_e2338a7a76914ae09ac534a5c23a951b | https://github.com/continuedev/continue/issues/12382 | 来源类型 github_issue 暴露的待验证使用条件。

## 36. 安全/权限坑 · 来源证据：Size limit for Read_File

- 严重度：medium
- 证据强度：source_linked
- 发现：GitHub 社区证据显示该项目存在一个安全/权限相关的待验证问题：Size limit for Read_File
- 对用户的影响：可能影响授权、密钥配置或安全边界。
- 建议检查：来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。
- 防护动作：不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。
- 证据：community_evidence:github | cevd_cc5d435c7f6c461a8cfe304805fae5a2 | https://github.com/continuedev/continue/issues/12432 | 来源讨论提到 python 相关条件，需在安装/试用前复核。

## 37. 维护坑 · issue/PR 响应质量未知

- 严重度：low
- 证据强度：source_linked
- 发现：issue_or_pr_quality=unknown。
- 对用户的影响：用户无法判断遇到问题后是否有人维护。
- 建议检查：抽样最近 issue/PR，判断是否长期无人处理。
- 防护动作：issue/PR 响应未知时，必须提示维护风险。
- 证据：evidence.maintainer_signals | github_repo:644686905 | https://github.com/continuedev/continue | issue_or_pr_quality=unknown

## 38. 维护坑 · 发布节奏不明确

- 严重度：low
- 证据强度：source_linked
- 发现：release_recency=unknown。
- 对用户的影响：安装命令和文档可能落后于代码，用户踩坑概率升高。
- 建议检查：确认最近 release/tag 和 README 安装命令是否一致。
- 防护动作：发布节奏未知或过期时，安装说明必须标注可能漂移。
- 证据：evidence.maintainer_signals | github_repo:644686905 | https://github.com/continuedev/continue | release_recency=unknown

<!-- canonical_name: continuedev/continue; human_manual_source: deepwiki_human_wiki -->
