CodingAgent
What it is
- A
CodingAgentimplementation backed by anOpencodeAgentserver. - Configured to operate within the
naas_abimodule working directory and guided by a fixed system prompt.
Public API
class CodingAgent(OpencodeAgent)- Agent specialization with:
name = "CodingAgent"description = "Coding agent backed by an opencode server for the naas_abi module."system_promptset to the module’sSYSTEM_PROMPT
- Agent specialization with:
CodingAgent.New(agent_shared_state: Optional[AgentSharedState] = None, agent_configuration: Optional[dict] = None) -> CodingAgent- Factory constructor that:
- Sets
workdirto thenaas_abimodule root (two levels above this file). - Reads optional configuration from environment variables:
NAAS_ABI_CODING_AGENT_PORT→port(int) orNoneif unset/blankNAAS_ABI_CODING_AGENT_MODEL→model(defaults to"openai/gpt-5.3-codex")
- Ignores
agent_configuration(explicitly deleted).
- Sets
- Factory constructor that:
Configuration/Dependencies
- Depends on:
naas_abi_core.services.agent.Agent.AgentSharedStatenaas_abi_core.services.agent.OpencodeAgent.OpencodeAgentnaas_abi_core.services.agent.OpencodeAgent.OpencodeAgentConfiguration
- Environment variables:
NAAS_ABI_CODING_AGENT_PORT: optional port for the opencode server (string parsed toint).NAAS_ABI_CODING_AGENT_MODEL: optional model identifier; default"openai/gpt-5.3-codex".
Usage
from naas_abi.agents.CodingAgent import CodingAgent
agent = CodingAgent.New()
With environment overrides:
import os
from naas_abi.agents.CodingAgent import CodingAgent
os.environ["NAAS_ABI_CODING_AGENT_PORT"] = "8080"
os.environ["NAAS_ABI_CODING_AGENT_MODEL"] = "openai/gpt-5.3-codex"
agent = CodingAgent.New()
Caveats
agent_configurationpassed toNew()is ignored.NAAS_ABI_CODING_AGENT_PORTmust be a valid integer if set; otherwiseint(...)will raiseValueError.