Skip to content

Enhanced ChatGPT Clone: Features Agents, MCP, Skills, DeepSeek, Anthropic, AWS, OpenAI, Responses API, Azure, Groq, o1, GPT-5, Mistral, OpenRouter, Vertex AI, Gemini, Artifacts, AI model switching, message search, Code Interpreter, langchain, DALL-E-3, OpenAPI Actions, Functions, Secure Multi-User Auth, Presets, open-source for self-hosting. Active

625 B
Raw Blame
import type { TConversation } from 'librechat-data-provider';

/**
 * Only a conversation that ran against an attached code workspace can have a pull request: the
 * workspace is what reports the branch. Everything else never asks, so ordinary chats cost no
 * lookups and show no pull request state at all.
 */
export function isCodeConversation(
  conversation: Pick<TConversation, 'codeEnvironmentMode' | 'codeWorkspaces'> | null | undefined,
): boolean {
  if (conversation == null) return false;
  return (
    conversation.codeEnvironmentMode === 'attached' ||
    (conversation.codeWorkspaces?.length ?? 0) > 0
  );
}