fix(stella-cli): forward parallel_safe_names through every tool-stack decorator - #1836
Open
macanderson wants to merge 3 commits into
Open
fix(stella-cli): forward parallel_safe_names through every tool-stack decorator#1836macanderson wants to merge 3 commits into
macanderson wants to merge 3 commits into
Conversation
added 2 commits
August 6, 2026 03:17
… decorator PR #1776 added ToolExecutor::parallel_safe_names with an empty default, implemented only by ToolRegistry — but every production session wraps the registry in decorators, and none forwarded it, so the empty default won and sibling task calls still serialized in every real session. Forward it through DiscoveryToolSet, PolicyToolSet (intersected with the policy, mirroring its two-sided schemas/execute shape), InteractiveToolSet, CustomToolSet, TaskTap, ClaimTap, CommitObserver, HunkGate, McpToolSet and CandidateMcpView (native layer only — MCP tools never carry the claim), and serve's DelegatingTools. TaskTap moves to command_deck/task_tap.rs because command_deck.rs sat at exactly its file-size ceiling (the driver/settlement.rs split pattern). Also make ToolRegistry::parallel_safe_names poison-tolerant on late_tools like every sibling read path — 'if let Ok' silently dropped late-enabled claims after a panic elsewhere. Witnesses: the_production_tool_stack_forwards_parallel_safe_names asserts through the shipped deck composition; per-decorator tests cover the taps outside that stack; a PolicyToolSet test pins that a disabled tool is not advertised as parallel-safe; parallel_safe_names_survive_a_poisoned_late_overlay pins the lock repair.
…rrent dispatch The 'bounded by one child's cap' claim was written for the serialized world; with sibling spawns dispatched concurrently the bound is one cap per concurrently-running sibling, up to the engine's dispatch cap of 8.
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
There was a problem hiding this comment.
Sorry @macanderson, you have reached your weekly rate limit of 500000 diff characters.
Please try again later or upgrade to continue using Sourcery
Contributor
Reviewer's GuideEnsures ToolExecutor::parallel_safe_names is correctly forwarded through all tool-stack decorators (so parallel-safe tools like Sequence diagram for parallel_safe_names forwarding through the CLI tool stacksequenceDiagram
title parallel_safe_names forwarding through CLI tool stack
participant Engine
participant TaskTap
participant DiscoveryToolSet
participant PolicyToolSet
participant InteractiveToolSet
participant CustomToolSet
participant ToolRegistry
participant ToolPolicy
Engine->>TaskTap: parallel_safe_names()
TaskTap->>DiscoveryToolSet: parallel_safe_names()
DiscoveryToolSet->>PolicyToolSet: parallel_safe_names()
PolicyToolSet->>InteractiveToolSet: parallel_safe_names()
InteractiveToolSet->>CustomToolSet: parallel_safe_names()
CustomToolSet->>ToolRegistry: parallel_safe_names()
ToolRegistry->>ToolRegistry: parallel_safe_names()
ToolRegistry-->>CustomToolSet: HashSet<String>
CustomToolSet-->>InteractiveToolSet: HashSet<String>
InteractiveToolSet-->>PolicyToolSet: HashSet<String>
loop filter by policy
PolicyToolSet->>ToolPolicy: allows(name)
ToolPolicy-->>PolicyToolSet: bool
end
PolicyToolSet-->>DiscoveryToolSet: filtered HashSet<String>
DiscoveryToolSet-->>TaskTap: filtered HashSet<String>
TaskTap-->>Engine: filtered HashSet<String>
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
This was referenced Aug 6, 2026
# Conflicts: # crates/stella-cli/src/command_deck.rs
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.
Problem
#1776 added
ToolExecutor::parallel_safe_names()with an empty default, implemented only byToolRegistry. But no production session hands the engine a bare registry — the CLI wraps it asDiscoveryToolSet(PolicyToolSet(InteractiveToolSet(CustomToolSet(registry)))), the deck addsTaskTap, and stella-mcp/stella-serve/fleet each have their own decorators. None of them forwarded the method, so the empty default won at the outermost layer and siblingtaskcalls still serialized in every real session — the exact defect #1776 claims to fix, alive one layer up. (Its witness couldn't see this: it implements the trait directly on a bare fake executor.)Every decorator already forwards the sibling method
drain_sub_agent_spend_usdfor the same reason; this bringsparallel_safe_namesto parity in all eleven:discovery.rs,tool_policy.rs,interactive.rs,custom.rs,command_deck.rs(TaskTap, split intocommand_deck/task_tap.rsto respect the god-file ceiling),claims.rs,fleet_commits.rs,hunk_review.rs,stella-mcp/toolset.rs(both toolsets),stella-serve/subagents.rs.PolicyToolSetintersects instead of delegating blindly: a tool the policy withholds is refused byexecute, so advertising it as parallel-safe would be an empty promise — forwarded names are filtered throughpolicy.allows.Also in the same seam:
ToolRegistry::parallel_safe_namesnow recovers a poisonedlate_toolslock like every sibling read path (unwrap_or_else(|p| p.into_inner())) instead of silently returning an incomplete set.subagent.rsis corrected for the concurrent world: the bound is one child's cap per concurrently-running sibling (dispatch cap 8), not "one child's cap".Witness
subagent::tests::the_production_tool_stack_forwards_parallel_safe_names(stella-cli) — builds the real decorator stack and asserts the registry's claim survives to the outermost layer. Checked the artisanal way: withorigin/main'sdiscovery.rsrestored it fails (empty set at the top of the stack); with this change it passes.tool_policy:parallel_safe_names_are_forwarded_when_the_policy_allows+a_disabled_tool_is_not_advertised_as_parallel_safe(the two-sided contract).stella-mcp:parallel_safe_names_forward_from_the_native_layer.registry/tests.rs: poisoned-lock recovery.cargo test: stella-cli 1422 passed, stella-tools 718+119, stella-mcp all green, stella-serve 165+ green · clippy--all-targets -- -D warningsclean on all four crates ·cargo fmt --checkclean ·check-file-sizeOK (command_deck.rs shrank to 4,696).Notes
Found by a resilience audit of the #1776 seam. Follow-up defects in the same seam (sibling
agent_idcollision, the unreachable sub-agent spend-pool ceiling, child-panic spend loss) are being filed as separate issues.Summary by Sourcery
Ensure tool executor decorators correctly propagate parallel execution capability and harden registry handling of poisoned late tool overlays.
Bug Fixes:
Enhancements:
Tests: