refactor(subagent): split manager.rs monolith into focused modules#4906
Merged
Conversation
bug-ops
force-pushed
the
split-subagent-manager
branch
from
June 6, 2026 11:07
4511cf2 to
e5ff37b
Compare
bug-ops
enabled auto-merge (squash)
June 6, 2026 11:09
…r_test
Split crates/zeph-subagent/src/manager.rs (5732 lines) into a focused
module hierarchy under manager/:
- spawn.rs — spawn, resume, cancel, spawn_for_task, prompt helpers,
MemoryAwareExecutor
- collect.rs — result collection, transcript finalization, status queries
- worktree.rs — WorktreeCleanupGuard and worktree lifecycle helpers
- secrets.rs — secret request/approval plumbing
- mod.rs — SubAgentManager struct, fields, ctor, setters, re-exports;
all #[cfg(test)] modules kept here
Additional changes in the same commit:
- Add #[tracing::instrument] to SubAgentManager::resume with span name
"subagent.manager.resume" (was missing, critical lifecycle path)
- Make transcript::utc_now pub(crate); remove utc_now_pub wrapper and its
doc-test; update 5 callers
- Add SubAgentDef::for_test(name) constructor (plain pub) in def.rs;
replace 5 duplicated test helpers across zeph-orchestration (scheduler,
planner, tick, router x2)
Closes #4882
Closes #4887
bug-ops
force-pushed
the
split-subagent-manager
branch
from
June 6, 2026 11:16
42c0f21 to
dc5f51b
Compare
This was referenced Jun 6, 2026
Closed
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
crates/zeph-subagent/src/manager.rs(5732 lines) into a focused module hierarchy undermanager/:spawn.rs,collect.rs,worktree.rs,secrets.rs,mod.rs(refactor(subagent): split manager.rs monolith (5732 lines) into focused modules #4882)SubAgentDef::for_test(name)constructor inzeph-subagentand replaces 5 duplicated test helpers acrosszeph-orchestration(refactor(orchestration): deduplicate SubAgentDef test-builder across planner/scheduler/tick #4887)#[tracing::instrument]toSubAgentManager::resume(missing on a critical lifecycle path)transcript::utc_nowpub(crate); removes theutc_now_pubwrapperChanges
manager.rsmanager/directorymanager/mod.rsmanager/spawn.rsmanager/collect.rsmanager/worktree.rsmanager/secrets.rsdef.rsSubAgentDef::for_test(name: &str) -> Selftranscript.rsutc_now→pub(crate), removeutc_now_pubzeph-orchestration(5 files)make_def/make_agenthelpers withSubAgentDef::for_testTest plan
cargo build --workspace— cleancargo +nightly fmt --check— cleancargo clippy --workspace -- -D warnings— cleanRUSTFLAGS="-D warnings" cargo check --workspace --all-targets --features desktop,ide,server,chat,pdf,scheduler— cleancargo nextest run --workspace --lib --bins— 10513 passed, 21 skippedcargo test --doc -p zeph-subagent— 23 passedlib.rs) byte-identical to mainCloses #4882
Closes #4887