> Discover all available pages from the documentation index: https://mastra.zisheng.pro/ko/llms.txt # 생성코딩Agent() `createCodingAgent()`코딩을 빌드합니다[`Agent`](https://mastra.zisheng.pro/ko/reference/agents/agent)코딩 Agent가 항상 필요로 하는 부분(로컬 작업 공간, 작업 목록 신호 제공자, 네트워크 재시도 오류 프로세서 및 목표 판단 Prompt)에 대한 이식 가능한 기본값이 있습니다. 공급만 가능`model`, `instructions`, 그리고`tools`작동하는 Agent를 얻거나 기본값을 무시합니다. 반환된 값은 표준 `Agent`이므로 `Agent`를 사용할 수 있는 모든 곳에서 작동합니다. 여기에는 [`AgentController`](https://mastra.zisheng.pro/ko/reference/agent-controller/agent-controller-class)에 전달하는 Agent도 포함됩니다. ## 사용예 Model, 지침 및 Tool을 전달합니다. 공장에서는 작업 공간, 작업 신호, 오류 프로세서 및 목표 Prompt를 채웁니다. ```typescript import { createCodingAgent } from '@mastra/core/coding-agent' const agent = createCodingAgent({ id: 'my-coding-agent', name: 'My Coding Agent', model: 'openai/gpt-5', instructions: 'You are a helpful coding assistant.', tools: {}, }) ``` ## 매개변수 `createCodingAgent()`는 아래 필드와 함께 [`AgentConfig`](https://mastra.zisheng.pro/ko/reference/agents/agent)의 모든 필드를 허용합니다. 사용자가 제공한 필드는 항상 팩터리 기본값보다 우선합니다. **model** (`MastraLanguageModel | DynamicArgument`): Agent가 사용하는 언어 Model입니다. Agent에 그대로 전달됩니다. **instructions** (`string | DynamicArgument`): Agent의 시스템 지침입니다. Agent에 그대로 전달됩니다. **tools** (`ToolsInput | DynamicArgument`): Agent가 사용할 수 있는 Tool입니다. Agent에 그대로 전달됩니다. **workspace** (`AnyWorkspace | undefined`): Agent를 지원하는 Workspace입니다. 키를 생략하면 기본 로컬 Workspace가 빌드됩니다. 명시적으로 undefined로 설정하면 팩터리가 기본값을 빌드하지 않습니다. Workspace가 다른 곳(예: AgentController 계층)에 연결된 경우 이 방식으로 제외하세요. **basePath** (`string`): workspace를 생략할 때 빌드되는 기본 Workspace의 기준 경로입니다. (Default: `process.cwd()`) **signals** (`SignalProvider[]`): Agent의 신호 Provider입니다. 생략하면 단일 TaskSignalProvider가 기본값으로 사용됩니다. **errorProcessors** (`Processor[]`): Agent의 오류 프로세서입니다. 생략하면 특수한 ECONNRESET 및 잘못된 요청 정책을 포함한 알 수 없는 스트림 오류 재시도와 PrefillErrorHandler 및 ProviderHistoryCompat가 기본값으로 사용됩니다. **goal** (`AgentGoalConfig`): 목표 구성입니다. Prompt 없이 제공하면 Prompt의 기본값은 DEFAULT\_GOAL\_JUDGE\_PROMPT입니다. ## 보고 **agent** (`Agent`): 확인된 Workspace, 신호, 오류 프로세서 및 목표가 적용된 코딩 Agent입니다. ## 기본값 공장에서는 해당 필드를 제공하지 않은 경우에만 기본값을 채웁니다. 호출자가 제공한 값은 항상 승리합니다. | 필드 | 생략 시 기본값 | | ----------------- | ------------------------------------------------------------------------------------------------------------------------------------- | | `workspace` | 기준 경로를 루트로 하는 `LocalFilesystem` 및 `LocalSandbox` 기반 [`Workspace`](https://mastra.zisheng.pro/ko/reference/workspace/workspace-class). | | `signals` | 단일 [`TaskSignalProvider`](https://mastra.zisheng.pro/ko/reference/signals/task-signal-provider). | | `errorProcessors` | 특수한 ECONNRESET 및 잘못된 요청 정책을 포함한 알 수 없는 스트림 오류 재시도와 `PrefillErrorHandler` 및 `ProviderHistoryCompat`. | | `goal.prompt` | `goal`이 구성된 경우에만 `DEFAULT_GOAL_JUDGE_PROMPT`. | ### 작업공간 `workspace` 키를 생략하면 팩터리는 `basePath`(기본값 `process.cwd()`)를 루트로 하는 로컬 Workspace를 빌드합니다. ```typescript import { Workspace, LocalFilesystem, LocalSandbox } from '@mastra/core/workspace' new Workspace({ filesystem: new LocalFilesystem({ basePath }), sandbox: new LocalSandbox({ workingDirectory: basePath }), }) ``` 옵트아웃하려면(예를 들어 작업공간이[`AgentController`](https://mastra.zisheng.pro/ko/reference/agent-controller/agent-controller-class) level), pass `workspace: undefined` explicitly: ```typescript const agent = createCodingAgent({ id: 'my-coding-agent', name: 'My Coding Agent', model: 'openai/gpt-5', instructions: 'You are a helpful coding assistant.', tools: {}, workspace: undefined, // opt out of the default workspace }) ``` ### 오류 프로세서 기본값[`StreamErrorRetryProcessor`](https://mastra.zisheng.pro/ko/reference/processors/stream-error-retry-processor) applies these retry policies: - Provider 메타데이터와 일치하지 않는 알 수 없는 오류 또는 특정 matcher가 일치하는 오류는 `3000ms` 지연을 두고 최대 두 번 재시도합니다. 알려진 인증 실패는 즉시 노출됩니다. - 네트워크 연결 재설정(`ECONNRESET` / `socket hang up`)은 지수 백오프(`1000ms * 2^retryCount`, 최대 `30000ms`)를 적용하여 최대 두 번 재시도합니다. - 잘못된 요청 오류는 `2000ms` 후 한 번 재시도합니다. 특정 네트워크 연결 재설정 및 잘못된 요청 정책은 알 수 없는 오류 정책보다 우선합니다. `errorProcessors`를 전달하면 기본 프로세서 스택이 대체됩니다. Provider 호환성을 위해 `PrefillErrorHandler`와 `ProviderHistoryCompat`도 포함됩니다. ## 관련된 - [`buildBasePrompt()`](https://mastra.zisheng.pro/ko/reference/coding-agent/build-base-prompt) - [`Agent`](https://mastra.zisheng.pro/ko/reference/agents/agent) - [`AgentController`](https://mastra.zisheng.pro/ko/reference/agent-controller/agent-controller-class)