fix: handle single-connector case in matching heuristic and CEO prompt
- matchConnector returns honest reason when only one connector is ready - CEO prompt detects single-connector scenario and tells CEO to use it for all agents - Removes misleading 'Best match' language when there's no actual choice
This commit is contained in:
1 parent
51dbeb0cac
commit
6f13d324e4
2 files changed
+18
-2
No files matched your search
@@ -140,10 +140,13 @@ export function matchConnector(input: ConnectorMatchInput): ConnectorMatchResult
|
|||||||
|
|
||||||
// recommended should always be set if readySet.size > 0, but guard
|
// recommended should always be set if readySet.size > 0, but guard
|
||||||
if (recommended) {
|
if (recommended) {
|
||||||
|
const onlyOneReady = readySet.size === 1;
|
||||||
return {
|
return {
|
||||||
recommendedConnectorId: recommended,
|
recommendedConnectorId: recommended,
|
||||||
fallbackConnectorId: fallback,
|
fallbackConnectorId: fallback,
|
||||||
reason: `Best match for ${taskType} tasks: ${CONNECTOR_STRENGTHS[recommended]}`,
|
reason: onlyOneReady
|
||||||
|
? `Only available connector: ${recommended}. Assign to all agents.`
|
||||||
|
: `Best match for ${taskType} tasks: ${CONNECTOR_STRENGTHS[recommended]}`,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -928,7 +928,19 @@ IMPORTANT: Wait for the Board to approve before starting business operations.
|
|||||||
return `- **${c.label}** (\`${c.id}\`): ${strengths} [STATUS: ${c.status}]`;
|
return `- **${c.label}** (\`${c.id}\`): ${strengths} [STATUS: ${c.status}]`;
|
||||||
});
|
});
|
||||||
|
|
||||||
sections.push(`# Available Connectors for Hiring
|
const readyConnectors = ctx.allConnectors.filter((c) => c.status === "ready");
|
||||||
|
const onlyOneConnector = readyConnectors.length === 1;
|
||||||
|
|
||||||
|
if (onlyOneConnector) {
|
||||||
|
const sole = readyConnectors[0];
|
||||||
|
sections.push(`# Available Connectors for Hiring
|
||||||
|
You have ONE available connector:
|
||||||
|
${connectorLines.join("\n")}
|
||||||
|
|
||||||
|
Since only **${sole.label}** (\`${sole.id}\`) is ready, assign it to ALL agents you create. Do not worry about matching connectors to roles — use this connector for every agent.
|
||||||
|
`);
|
||||||
|
} else {
|
||||||
|
sections.push(`# Available Connectors for Hiring
|
||||||
When hiring agents, assign the best connector for their role:
|
When hiring agents, assign the best connector for their role:
|
||||||
${connectorLines.join("\n")}
|
${connectorLines.join("\n")}
|
||||||
|
|
||||||
@@ -940,6 +952,7 @@ Connector Assignment Guide:
|
|||||||
- If preferred connector is not listed as "ready", use the next best available
|
- If preferred connector is not listed as "ready", use the next best available
|
||||||
- NEVER assign a connector with status "not_installed" or "error"
|
- NEVER assign a connector with status "not_installed" or "error"
|
||||||
`);
|
`);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else if (hasPendingOrgApproval) {
|
} else if (hasPendingOrgApproval) {
|
||||||
sections.push(`# Operating Instructions (CEO — Awaiting Org Approval)
|
sections.push(`# Operating Instructions (CEO — Awaiting Org Approval)
|
||||||
|
|||||||
Reference in new issue
Block a user