Summary
Allow users to configure the temperature parameter for subAgents via config.yaml, enabling fine-grained control over their randomness and creativity at launch.
Motivation
Currently, subAgents are launched without configurable temperature, meaning their behavior is fixed by the default LLM settings. Users may want to adjust temperature per-subAgent or globally to control the randomness of their outputs — lower for precise, deterministic tasks and higher for creative, exploratory work.
Proposed Solution
Add a temperature field to the subAgent configuration in config.yaml. When launching a subAgent, read this value and pass it to the LLM call. Support both a global default and per-subAgent override.
Example config:
subAgents:
temperature: 0.7 # global default
skills:
- name: audit-code
temperature: 0.3 # override for specific skill
Alternatives Considered
- Command-line flag only — Less convenient for persistent configuration. Config.yaml is the right home for this.
- Per-skill in the skill definition — Would require modifying each skill file. Config.yaml keeps it centralized and user-controlled.
OpenSpec Note
This project uses OpenSpec for feature development. If this request is approved, I will:
- Run
/opsx:propose to generate a full proposal with specs and tasks
- Iterate on the design before any code is written
- Follow the task-driven implementation workflow
Additional Context
The temperature parameter is a standard LLM parameter that controls randomness in model outputs. This would give users more control over subAgent behavior without needing to modify system prompts or skill definitions.
Environment
- OS: Linux 7.0.2-7-pve
- Node.js: v25.8.1
- madz version: 1.18.0
- LLM provider: Unknown — user to confirm---
Audit Findings
Current Architecture
- File:
src/tools/subAgent.js — SubAgents are spawned as separate node index.js processes (line 113). Each subAgent is a full madz instance that reads its own config.yaml.
- File:
src/provider/openai.js — Temperature is passed to ChatOpenAI at model creation time (line 24). Currently reads from provider config only.
- File:
config.yaml — Temperature is configured at providers.openai.temperature (line 9). SubAgent config lives under process.subAgent (lines 84-89) but has no temperature field.
Integration Points
src/tools/subAgent.js:113 — spawnSubAgentProcess() spawns the child process. This is where temperature would need to be passed (env var or CLI arg).
src/tools/subAgent.js:258-274 — resolveTimeout() shows the existing pattern: per-call > env var > config default. Temperature resolution should follow the same hierarchy.
src/provider/openai.js:21-32 — createChatModel() accepts temperature from config. The spawned process would need to override this with the subAgent-specific value.
config.yaml:84-89 — process.subAgent section is the natural home for subAgent-specific config including temperature.
Proposed Implementation Path
- Add
temperature field to process.subAgent in config.yaml (e.g., 0.7)
- Pass temperature to spawned process via
MADZ_SUBAGENT_TEMPERATURE env var in spawnSubAgentProcess()
- In the spawned process, override provider temperature if
MADZ_SUBAGENT_TEMPERATURE is set
- Follow the same resolution pattern as timeout: per-call > env var > config default > provider default
- Add temperature to the subAgent tool schema (optional per-call override)
Config Schema Change
process:
subAgent:
timeout: 600000
maxConcurrent: 4
sessionMode: isolated
defaultStrategy: parallel
defaultOnError: continue
temperature: 0.7 # NEW — subAgent temperature (0-2, follows OpenAI spec)
Summary
Allow users to configure the temperature parameter for subAgents via config.yaml, enabling fine-grained control over their randomness and creativity at launch.
Motivation
Currently, subAgents are launched without configurable temperature, meaning their behavior is fixed by the default LLM settings. Users may want to adjust temperature per-subAgent or globally to control the randomness of their outputs — lower for precise, deterministic tasks and higher for creative, exploratory work.
Proposed Solution
Add a
temperaturefield to the subAgent configuration in config.yaml. When launching a subAgent, read this value and pass it to the LLM call. Support both a global default and per-subAgent override.Example config:
Alternatives Considered
OpenSpec Note
This project uses OpenSpec for feature development. If this request is approved, I will:
/opsx:proposeto generate a full proposal with specs and tasksAdditional Context
The temperature parameter is a standard LLM parameter that controls randomness in model outputs. This would give users more control over subAgent behavior without needing to modify system prompts or skill definitions.
Environment
Audit Findings
Current Architecture
src/tools/subAgent.js— SubAgents are spawned as separatenode index.jsprocesses (line 113). Each subAgent is a full madz instance that reads its own config.yaml.src/provider/openai.js— Temperature is passed to ChatOpenAI at model creation time (line 24). Currently reads from provider config only.config.yaml— Temperature is configured atproviders.openai.temperature(line 9). SubAgent config lives underprocess.subAgent(lines 84-89) but has no temperature field.Integration Points
src/tools/subAgent.js:113—spawnSubAgentProcess()spawns the child process. This is where temperature would need to be passed (env var or CLI arg).src/tools/subAgent.js:258-274—resolveTimeout()shows the existing pattern: per-call > env var > config default. Temperature resolution should follow the same hierarchy.src/provider/openai.js:21-32—createChatModel()accepts temperature from config. The spawned process would need to override this with the subAgent-specific value.config.yaml:84-89—process.subAgentsection is the natural home for subAgent-specific config including temperature.Proposed Implementation Path
temperaturefield toprocess.subAgentin config.yaml (e.g.,0.7)MADZ_SUBAGENT_TEMPERATUREenv var inspawnSubAgentProcess()MADZ_SUBAGENT_TEMPERATUREis setConfig Schema Change