fix: delegate bounded native tools to orchestrated workers - #591
Conversation
|
@richardfogaca is attempting to deploy a commit to the Compozy Team on Vercel. A member of the Team first needs to authorize it. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: ⛔ Files ignored due to path filters (5)
📒 Files selected for processing (3)
Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review. WalkthroughThe change updates root delegation tool materialization for session MCP and runtime conditions. It derives unrestricted-agent tools from the native tool universe while preserving deny and override filtering. Tests validate session policies, spawned worker tool callability, and asynchronous tooltip rendering. ChangesDelegation tool materialization and validation
Estimated code review effort: 3 (Moderate) | ~20 minutes Severity of issue fixed: Medium Merge Risk: ⚪ Minimal · up to Root sessions now provide bounded native tools to eligible workers while preserving explicit denies, overrides, and restricted runtime behavior. The supplied coverage shows the intended worker access and denial boundaries, so the change is mergeable. 🚥 Pre-merge checks | ✅ 2 | ❌ 3❌ Failed checks (2 warnings, 1 inconclusive)
✅ Passed checks (2 passed)
Full details: Linked Issues checkExplanation The changes provide evidence for root delegation policy handling, native tool projection, denial behavior, parent-boundary preservation, and bounded worker verification. The reviewable summary does not identify a change to the stock conductor guidance or spawn recipe that explicitly grants the required native tools, so that requirement cannot be confirmed.
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
| Filename | Overview |
|---|---|
| internal/session/manager_allowed_tools.go | Materializes concrete root delegation budgets from resolved Agent policy while excluding runtimes without native session-tool support. |
| extensions/spec-cycle/skills/cy-orchestrate-tasks/SKILL.md | Updates the conductor recipe to grant a bounded native discovery and skill-reading bootstrap set explicitly. |
| internal/session/manager_lineage_test.go | Covers root user/system budgets, unrestricted Agents, deny policies, and explicit narrowing. |
| internal/daemon/daemon_implement_tasks_e2e_integration_test.go | Verifies that spawned workers can call delegated skill lookup while an undelegated task tool remains unavailable. |
| web/e2e/tests/network.spec.ts | Exempts public compozy__mcp_auth* ToolIDs from a credential-marker assertion without exempting canonical credential fields. |
| web/src/systems/onboarding/components/tests/onboarding-setup-frame.test.tsx | Awaits asynchronously rendered explanatory content after opening the onboarding workspace details. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Resolve root Agent policy] --> B{Eligible root user or system session?}
B -- No --> C[Keep existing lineage budget]
B -- Yes --> D[Expand explicit tools and toolsets or native universe]
D --> E[Remove Agent-denied tools]
E --> F[Persist concrete parent delegation budget]
F --> G[Conductor requests explicit worker tool subset]
G --> H{Subset of parent budget?}
H -- Yes --> I[Spawn bounded worker]
H -- No --> J[Reject permission widening]
Reviews (2): Last reviewed commit: "fix: preserve sessions without native to..." | Re-trigger Greptile
What & why
Fixes #588.
Tool-capable root system Sessions now materialize a concrete delegation budget from their resolved Agent policy, matching root user Sessions. For Agents without an allowlist, both root types now materialize the native universe minus Agent denies, matching the existing effective tool policy. Loop conductors previously had an empty budget even when native tools were available, so an explicit child grant was rejected.
The stock task conductor now explicitly delegates the native discovery and skill-reading tools its workers need. Previously its spawn recipe omitted permissions, so the worker correctly received zero tools and could not load required guidance.
The recipe requires a concrete subset of the parent's budget and blocks when a required grant is unavailable. Omitted permissions still deny all delegated tools; there is no implicit child inheritance. Verdict-only and MCP-disabled runtimes remain without a default delegation budget. Sessions with a parent retain their existing budget; Agent denies and explicit overrides still bound root authority.
Implementation assistance: Richard's agent. The diff was reviewed and its results verified locally.
How you verified it
TestCreateAllowedToolsOverrideNarrowsAgentProfileandTestCreateSystemSessionRecordsInternalProvenancepassed with-race, covering default/explicit budgets, denies, narrower overrides and unseeded provenance-linked system children. Default-budget cases failed before the fix.-race(368.476s). The strengthened fixture invokes native skill lookup; it also checks a nondelegated tool remains uncallable and workers settle under the selected Agent/Profile/runtime.session_denied.done, its worker stopped, and the disposable lab teardown reportedclean: true.make gatepassed on the final diff: lint reported zero issues, all affected race-test packages passed, and frontend validation passed with 7,117 tests across 771 files under Node 22.Impact
session_spawn.toolsand repeatedspawn --toolfields are unchanged. Root delegation budgets and the shipped conductor's use of those fields change.make gatepasses locally; this PR is delivered only after its required CI checks are greenSummary by CodeRabbit