Skip to content

fix(adf): remediate agent spawning for opencode, model flags, resource limits, compound review#731

Open
AlexMikhalev wants to merge 5 commits intomainfrom
task/117-adf-remediation
Open

fix(adf): remediate agent spawning for opencode, model flags, resource limits, compound review#731
AlexMikhalev wants to merge 5 commits intomainfrom
task/117-adf-remediation

Conversation

@AlexMikhalev
Copy link
Copy Markdown
Contributor

Summary

  • Add opencode CLI support to spawner: run --format json args and -m model flag
  • Compose provider/model string in orchestrator for opencode agents
  • Thread resource_limits through SpawnRequest to spawner
  • Add wall-clock timeout in poll_agent_exits() to kill hung agents
  • Fix compound review to use cli_tool, provider, model from CompoundReviewConfig

Test plan

  • cargo test -p terraphim_spawner -- 46 tests pass (includes 4 new opencode tests + 3 resource_limits tests)
  • cargo test -p terraphim_orchestrator -- 13 tests pass (includes 2 new composition tests + 1 timeout test)
  • cargo clippy -p terraphim_spawner -p terraphim_orchestrator -- -D warnings -- clean
  • Deploy to bigbox and verify all 12 active agents run non-interactively
  • Verify memory < 10GB after 24h operation

Fixes Gitea #117
Related: Gitea #105, #104, #106

Generated with Claude Code

AlexMikhalev and others added 5 commits March 27, 2026 18:29
WorktreeManager::with_base() now resolves relative worktree_base paths
against repo_path, preventing CWD-dependent behaviour when the ADF binary
runs from /opt/ai-dark-factory/ via systemd but the repo lives elsewhere.

Refs #104

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…n and latency tracking Refs #116

- Extend CostTracker with ExecutionMetrics for per-run token/latency/cost capture
- Add AgentMetrics for aggregated per-agent statistics
- Create metrics_persistence module for terraphim_persistence integration
- Implement InMemoryMetricsPersistence for testing
- Add fleet-wide metrics aggregation
- Export new types from lib.rs

Phase 1 complete: Per-agent cost/token/latency metrics captured and ready for storage.
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