zylon-ai/private-gpt · error · ValueError
code_execution provider is not configured.
Error message
code_execution provider is not configured.
What it means
ValueError from TextEditorToolBuilder._session: CodeExecutionComponent.get_or_create_session returned None, which happens when settings.code_execution.provider is unset or not found in the provider registry (code_execution_component.py:33-43). Every text editor sub-tool (view, str_replace, create, ...) funnels through _session, so any of them raises this before touching a file.
Source
Thrown at private_gpt/components/tools/builders/text_editor_tool_builder.py:67
@singleton
class TextEditorToolBuilder:
@inject
def __init__(
self,
code_execution_component: CodeExecutionComponent,
settings: Settings,
) -> None:
self._component = code_execution_component
self._settings = settings
async def _session(
self, config: CodeExecutionSessionConfig
) -> CodeExecutionSession:
session = await self._component.get_or_create_session(config)
if session is None:
raise ValueError("code_execution provider is not configured.")
return session
async def build_view_tool(
self,
config: CodeExecutionSessionConfig,
name: str = TEXT_EDITOR_VIEW_TOOL_NAME,
type: str = TEXT_EDITOR_VIEW_TOOL_NAME + "_v1",
description: str = TEXT_EDITOR_VIEW_TOOL_FN.metadata.description,
) -> ToolSpec:
async def view(
path: str,
view_range: list[int] | None = None,
) -> list[ResultContentBlockType]:
resolved_view_range: tuple[int, int] | None = None
if view_range is not None:
if len(view_range) != 2:
raise ValueError("view_range must contain exactly two integers")
resolved_view_range = (view_range[0], view_range[1])View on GitHub (pinned to 4a030776a3)
Solutions
- Configure code_execution.provider to a valid provider in settings and restart.
- Verify the provider resolves: ensure its implementing module/dependency is installed and the registry contains the name.
- If code execution is intentionally disabled, remove text editor tools from the toolset.
Example fix
# settings.yaml before
code_execution: {}
# after
code_execution:
provider: sandbox Defensive patterns
Strategy: validation
Validate before calling
from private_gpt.settings.settings import settings assert settings().code_execution.provider, "text editor tools need code_execution.provider"
Try / catch
try:
session = await builder._session(config)
except ValueError as e:
if "provider is not configured" in str(e):
raise RuntimeError("Configure code_execution.provider to use text editor tools") from e
raise Prevention
- Configure code_execution.provider wherever text editor tools are enabled.
- Fail fast at startup: refuse to register text editor tools when no provider resolves.
- Keep provider dependencies installed alongside the settings that reference them.
When it happens
Trigger: Any text editor tool invocation while code_execution.provider is None/empty/unknown in settings; get_or_create_session returns None and _session raises immediately.
Common situations: Enabling text editor tools without a code execution backend; settings profile that omits the code_execution section; provider name typo; provider registered only when its own optional dependency is installed and that dependency is missing.
Related errors
- Code execution provider '{name}' is not registered. Availabl
- code_execution provider is not configured.
- Unable to view file
- Unable to replace text
- Unable to create file
AI-assisted analysis of zylon-ai/private-gpt@4a030776a3 (2026-08-15).
Data as JSON: /api/errors/7adfbb2f9d2bf21a.
Report an issue: GitHub.