Conversation
…arallelize OAuth MCP connect #3316: Record tool executor wall time and expose it as ZEPH_TOOL_DURATION_MS in the env vars passed to post_tool_use hooks. Timer starts after PreToolUse fires and stops before PostToolUse fires, matching the Claude Code v2.1.119 duration_ms semantics. #3315: Refactor connect_oauth_deferred in zeph-mcp to use JoinSet for parallel server handshakes, mirroring the existing connect_all pattern. Per-server errors remain non-fatal; shared-state writes are committed in separate guarded blocks after the drain phase to avoid holding a lock across .await. Closes #3316 Closes #3315
70c4267 to
d2b2c6c
Compare
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
ZEPH_TOOL_DURATION_MSto the env vars passed topost_tool_usehooks. The timer measures only tool executor wall time (starts afterPreToolUsefires, stops beforePostToolUsefires), matching the Claude Code v2.1.119duration_mssemantics.connect_oauth_deferredinzeph-mcpusingtokio::task::JoinSet, mirroring the existingconnect_allpattern. Per-server errors remain non-fatal; shared-state is committed after the drain phase with no lock held across.await.Changes
crates/zeph-subagent/src/agent_loop.rsInstant::now()before executor, insertZEPH_TOOL_DURATION_MSintohook_envaftercrates/zeph-mcp/src/manager.rsconnect_oauth_deferredrefactored from sequentialforloop to two-phaseJoinSetpatternTest plan
cargo +nightly fmt --check— passcargo clippy --workspace --lib --bins -- -D warnings— pass (0 warnings)cargo nextest run --workspace --lib --bins— 8338 tests passFollow-up
connect_oauth_deferredomitslog_tool_collisions(deferred, non-blocking)