fix: share build cache across agent worktrees#763
Merged
AlexMikhalev merged 2 commits intomainfrom Apr 6, 2026
Merged
Conversation
Set CARGO_TARGET_DIR to main repo's target/ for all spawned agents so worktree builds reuse the existing compilation cache instead of building from scratch. Also detect sccache and set RUSTC_WRAPPER for cross-worktree content-addressed caching. Without this, each worktree agent triggered a full cargo build from zero (30+ minutes) because git worktrees get empty target/. Co-Authored-By: Terraphim AI <noreply@terraphim.ai>
Circuit breakers now keyed by provider:model (e.g., anthropic:claude-opus-4-6) instead of just provider name. If opus is down but sonnet works, only opus is marked unhealthy -- anthropic provider stays healthy. Added: model_health(), is_model_healthy(), record_model_success(), record_model_failure() for per-model operations. provider_health() and is_healthy() still work at aggregate level: provider is healthy if ANY of its models is healthy. unhealthy_providers() reports a provider only if ALL its models are down. Fixes HIGH finding from compound-review #413. Co-Authored-By: Terraphim AI <noreply@terraphim.ai>
AlexMikhalev
added a commit
that referenced
this pull request
Apr 22, 2026
…able agents in context - Fix AgentRunRecord construction: extract chain fields from active_agents via .get() instead of referencing non-existent local variable - Add mention_parent_agent field to ManagedAgent, set at all 3 dispatch sites - Pass available_agents in MentionContextArgs so spawned agents know who they can chain to - Add 2 tests for available_agents in mention context output Refs #763 Refs #764 Refs #144
AlexMikhalev
added a commit
that referenced
this pull request
Apr 22, 2026
AlexMikhalev
added a commit
that referenced
this pull request
Apr 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
CARGO_TARGET_DIRto main repo'starget/for all spawned agentsRUSTC_WRAPPERfor cross-worktree compilation cachingProblem
Each agent worktree gets an empty
target/directory, triggering a fullcargo buildfrom scratch (30+ minutes). This blocked implementation-swarm from completing work.Test plan
cargo test -p terraphim_orchestrator-- 379 tests passGenerated with Terraphim AI