fix: populate team color/displayName in tool approval from config.json

syntheticRequest for team launch was missing color and displayName
fields — they only existed in TeamCreateRequest (create flow).
Now reads color and name from config.json when building
syntheticRequest, so ToolApprovalRequest always has team color.
This commit is contained in:
iliya 2026-03-21 12:15:13 +02:00
parent 6d77e77200
commit ab2c40d358

View file

@ -3231,6 +3231,19 @@ export class TeamProvisioningService {
skipPermissions: request.skipPermissions,
};
// Enrich with color/displayName from config.json (always available for launched teams)
try {
const cfg = JSON.parse(configRaw) as Record<string, unknown>;
if (typeof cfg.color === 'string' && cfg.color.trim().length > 0) {
syntheticRequest.color = cfg.color.trim();
}
if (typeof cfg.name === 'string' && cfg.name.trim().length > 0) {
syntheticRequest.displayName = cfg.name.trim();
}
} catch {
// config already validated above — ignore parse errors here
}
const run: ProvisioningRun = {
runId,
teamName: request.teamName,