Default runtime
The ADK runtime is the default and needs no extra configuration:Switch the execution backend
Useruntime to select the inner-loop execution backend:
Use the Codex runtime
The Codex runtime requires the optionalcodex dependency group, which is not
installed with VeADK by default. Install the required dependencies before using
it:
codex extra includes the OpenAI Codex SDK and the Codex CLI binary.
The model name, API endpoint, and API key still come from the agent’s model
configuration:
Agent configuration; the Codex runtime does
not require a separate registration path:
- function tools in
toolsare exposed as callable tools to the model; - an MCPToolset in
toolssupports tool discovery and invocation; - skills loaded through
SkillToolsetor VeADK’s legacy entry are made available through the Codex skill mechanism.
Codex security configuration
The Codex runtime defaults to least-privilege settings suited to a multi-tenant service: each invocation uses a session-isolated workspace, theworkspace_write sandbox, no network access, and denial of escalated
operations. Broader access must be enabled explicitly.
Pass a CodexRuntimeConfig through the Agent codex_runtime_config
parameter:
agent.py
CodexRuntimeConfig parameters:
The following environment variables override the corresponding
CodexRuntimeConfig field without changing code, and take precedence over codex_runtime_config:
Codex observability
Codex-native lifecycle notifications and ADK Function/MCP tool calls are converted into standard ADK Events, so tool calls, results, state changes, confirmations, and authentication surface in Session, Trace, and the UI. Runtime logs use stablecodex_* event names and attribution fields such as invocation_id, call_id, tool, status, and duration_ms. Tool arguments, tool results, API tokens, credentials, and backend addresses are not logged. Token usage is exposed through codex_event_type=token_usage events and the corresponding log entry.
Configure transient-error retries
When the Codex runtime calls the model backend, it retries transient failures such as rate limits, server errors, overloads, and timeouts. It retries at most twice by default. Use these environment variables to change the behavior:Use PiAgent
- the executable referenced by
PIAGENT_BINARY; - the managed cache under
PIAGENT_INSTALL_DIR, which defaults to~/.cache/veadk/piagent; - if the cache is missing, a downloaded and verified PiAgent release.
Automatic installation requires access to the PiAgent release host. In offline or restricted networks, install the binary in advance and set
PIAGENT_BINARY.Request processing
Without touching business logic, you can inject shared cross-cutting processing into each run. Pass a processor torun_processor, for example to enforce login
via identity authentication:
AuthRequestProcessor as a ready-made implementation for identity authentication.
Custom processors
Every processor subclasses the abstract baseBaseRunProcessor and implements
its process_run(runner, message) method. That method returns a decorator
wrapping the run’s event stream, letting you:
- inject logic before and after the whole run (auth, logging, monitoring);
- intercept, rewrite, or inject events produced during the run;
- build control logic such as retries on top of that.