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:
ZacharyZhang-NY committed 2026-03-22 13:00:11 -04:00
1 parent 51dbeb0cac
commit 6f13d324e4
2 files changed
+18 -2

No files matched your search

+4 -1
View File
@@ -140,10 +140,13 @@ export function matchConnector(input: ConnectorMatchInput): ConnectorMatchResult
// recommended should always be set if readySet.size > 0, but guard
if (recommended) {
const onlyOneReady = readySet.size === 1;
return {
recommendedConnectorId: recommended,
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]}`,
};
}
}