INNER CODE UNIT · JavaScript
renderRoutingPrompt
fengshao1227/ccg-workflow · dsh-ccg/src/index.js:256
export function renderRoutingPrompt(resolved, panel = []) {
// Nothing here may describe a capability this deployment does not have. With
// no tiers set every role lands on one model, so promising "several models at
// once" would advertise a tool that is not registered and a split that is not
// happening — the same lie the per-role model names are generated to avoid.
const anyPanel = panel.length >= 2 || resolved.some((entry) => entry.members.length >= 2)
const routed = resolved.some((entry) => entry.members.length > 0)
const lines = [
anyPanel
? 'CCG delegation — specialised work goes to the role whose model and instructions fit it,'
+ '\nand a question worth being right about goes to several models at once.'
: 'CCG delegation — specialised work goes to the role whose instructions fit it.',
'',
'Role tools (one child, the model that suits that work):',
]
for (const entry of resolved) {
const route = entry.members.length === 0