You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have numerous coding assistant clients (e.g., Cline, CoPilot, Continue, Aider, and others in the pipeline) that sometimes conform to a common standard (e.g., OpenAI) but often introduce unique deviations in our code in how they serialize input and process streams. To accommodate these differences cleanly, we need a modular “client providers” system—similar to our modular providers system—to identify each client (potentially via user-agent or other metadata) and apply client-specific logic.
Background & Motivation
Current Issue: Each new coding assistant has its own peculiarities (e.g., prompt structure or stream handling (start end delimiters), which forces us to write ad hoc parsing or abstraction logic in code. This approach becomes unscalable and error-prone as we add more assistants.
User-Agent Challenges: While user-agents could be a natural way to detect the client, some VS Code extensions or tools send generic UAs (e.g., “Node/16.x”), preventing a straightforward identification.
Goal: A dedicated, modular mechanism that helps us detect and handle each client’s unique prompt/stream format seamlessly without duplicating effort.
Requirements
Client Identification Logic
Implement a robust strategy to detect which client is sending the request. Potential approaches include:
User-Agent inspection (if reliably set).
Custom header (e.g., X-Coding-Assistant: cline).
A fallback or heuristic if no identifying header is present.
Provide a clear, documented flow for adding new identification rules or hooking into existing ones.
Modular Architecture
Similar to our current “providers” model, implement a “client providers” system where each coding assistant (Cline, CoPilot, Continue, Aider, etc.) has its own plugin/module.
Each module should define:
Serialization/Deserialization logic for prompts and responses.
Any specialized stream handling (if they differ from a standard JSON or SSE approach).
Summary
We have numerous coding assistant clients (e.g., Cline, CoPilot, Continue, Aider, and others in the pipeline) that sometimes conform to a common standard (e.g., OpenAI) but often introduce unique deviations in our code in how they serialize input and process streams. To accommodate these differences cleanly, we need a modular “client providers” system—similar to our modular providers system—to identify each client (potentially via user-agent or other metadata) and apply client-specific logic.
Background & Motivation
Requirements
Client Identification Logic
X-Coding-Assistant: cline
).Modular Architecture
Fallback Handling
Scalability
Testing & Validation
Proposed Implementation Steps
Client Detection
Client Modules
clients/
) akin to our “providers/” directory.detect()
(optional) if the client includes a unique pattern in the request.parseRequest()
to handle the request body and convert it into a standardized internal format.processStream()
if streaming differences exist.serializeResponse()
to convert the internal response format back into the client’s expected format.Generic Handler
Refactor Existing Code
Documentation & Examples
Acceptance Criteria
The text was updated successfully, but these errors were encountered: