Skip to content

feat: allow configuring subAgent temperature from config.yaml#439

Open
avoidwork wants to merge 4 commits into
mainfrom
feat/subagent-temperature-config
Open

feat: allow configuring subAgent temperature from config.yaml#439
avoidwork wants to merge 4 commits into
mainfrom
feat/subagent-temperature-config

Conversation

@avoidwork

@avoidwork avoidwork commented Jun 23, 2026

Copy link
Copy Markdown
Owner

Summary

Allow users to configure the temperature parameter for subAgents via config.yaml, enabling fine-grained control over their randomness and creativity at launch.

Changes

Config Schema

  • Added temperature field to process.subAgent in config.yaml (global default)
  • Added temperature field to process.subAgent.skills[].temperature (per-skill override)
  • Updated config schema validation in src/config/schemas.js

Implementation

  • src/tools/subAgent.js: Pass temperature to spawned process via MADZ_SUBAGENT_TEMPERATURE env var
  • src/provider/openai.js: Override provider temperature when MADZ_SUBAGENT_TEMPERATURE is set
  • Resolution hierarchy: per-call > per-skill > global > provider default

Tests

  • tests/unit/config.test.js: Config validation tests for temperature field
  • tests/unit/provider.test.js: Provider temperature override tests

Acceptance Criteria

  • config.yaml accepts process.subAgent.temperature as a valid field
  • config.yaml accepts process.subAgent.skills[].temperature as a valid field
  • Config validation rejects values outside 0-2 range
  • Spawned subAgent process receives MADZ_SUBAGENT_TEMPERATURE env var when configured
  • Spawned process overrides provider temperature when env var is set
  • Invalid env var values fall back to provider default
  • Per-call temperature override takes precedence over all config levels
  • Parent process temperature remains unchanged

Testing

  • All unit tests passing
  • Config validation tested with valid, boundary, and invalid values
  • Provider override tested with env var set and unset scenarios

Add temperature configuration for subAgents via config.yaml with:
- Global default under process.subAgent.temperature
- Per-skill override under process.subAgent.skills[].temperature
- Environment variable propagation via MADZ_SUBAGENT_TEMPERATURE
- Optional per-call temperature parameter in subAgent tool schema
- Resolution hierarchy: per-call > per-skill > global > provider default

Follows existing subAgent config patterns (timeout, maxConcurrent).
All changes are backward compatible — existing configs work unchanged.
@avoidwork avoidwork self-assigned this Jun 23, 2026
@avoidwork

Copy link
Copy Markdown
Owner Author

Audit Results: subagent-temperature-config

Coverage Audit

  • Goal 1 (Config schema): ✓ Covered by "Global subAgent temperature configuration" and "Per-skill temperature override" requirements
  • Goal 2 (Env var passing): ✓ Covered by "Temperature passed to spawned process via environment variable" requirement
  • Goal 3 (Provider override): ✓ Covered by "Spawned process overrides provider temperature" requirement
  • Goal 4 (Per-call override): ✓ Covered by "Per-call temperature override" and "Resolution hierarchy" requirements

Fidelity Audit

  • All goals are represented faithfully in the specs
  • Resolution hierarchy (per-call > per-skill > global > provider) is explicitly documented
  • Edge cases (invalid values, empty strings, concurrent processes) are covered in scenarios
  • Backward compatibility is addressed in design decisions

Completeness Audit

  • Minor gap: Concurrent subAgent interference (Goal 2 risk) not explicitly in specs, but covered in Task 5.2
  • Config validation tests mentioned in tasks but not specs — acceptable (implementation detail)
  • All acceptance criteria from goals are mapped to spec scenarios

Consistency Audit

  • Task group 1 (Config Schema) → Global + Per-skill requirements ✓
  • Task group 2 (Env var propagation) → Env var requirement ✓
  • Task group 3 (Provider override) → Provider override requirement ✓
  • Task group 4 (Per-call override) → Per-call + Resolution hierarchy requirements ✓
  • Task group 5 (Integration) → Cross-cutting verification ✓

Verdict

No errors found. Specs faithfully represent all goals with adequate coverage. Tasks map cleanly to requirements. Proceed to Step 6.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant