perf(main): reduce bootstrap transcript context scans
This commit is contained in:
parent
2f0abb430c
commit
ab8ed5e378
1 changed files with 32 additions and 8 deletions
|
|
@ -318,7 +318,6 @@ import {
|
|||
getBootstrapTranscriptSuccessSource,
|
||||
getCanonicalSendMessageFieldRule,
|
||||
getCanonicalSendMessageToolRule,
|
||||
isBootstrapTranscriptContextText,
|
||||
isTaskBoardSnapshotWorkCandidate,
|
||||
normalizeMemberDiagnosticText,
|
||||
shouldUseGeminiStagedLaunch,
|
||||
|
|
@ -740,6 +739,28 @@ interface ParsedBootstrapTranscriptTailCacheEntry {
|
|||
lines: ParsedBootstrapTranscriptTailLine[];
|
||||
}
|
||||
|
||||
function isNormalizedBootstrapTranscriptContextText(
|
||||
normalizedText: string,
|
||||
normalizedTeamName: string,
|
||||
normalizedMemberName: string
|
||||
): boolean {
|
||||
if (!normalizedText || !normalizedTeamName || !normalizedMemberName) {
|
||||
return false;
|
||||
}
|
||||
if (
|
||||
!normalizedText.includes(normalizedTeamName) ||
|
||||
!normalizedText.includes(normalizedMemberName)
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
return (
|
||||
normalizedText.includes('bootstrap') ||
|
||||
normalizedText.includes('bootstrapping') ||
|
||||
normalizedText.includes('member briefing') ||
|
||||
normalizedText.includes('task briefing')
|
||||
);
|
||||
}
|
||||
|
||||
import type {
|
||||
ActiveToolCall,
|
||||
AgentActionMode,
|
||||
|
|
@ -30426,6 +30447,7 @@ export class TeamProvisioningService {
|
|||
} = {}
|
||||
): Promise<BootstrapTranscriptOutcome | null> {
|
||||
const normalizedMemberName = memberName.trim().toLowerCase();
|
||||
const normalizedTeamName = teamName.trim().toLowerCase();
|
||||
const contextMemberNames = Array.from(
|
||||
new Set(
|
||||
[memberName, ...(options.contextMemberNames ?? [])]
|
||||
|
|
@ -30433,6 +30455,9 @@ export class TeamProvisioningService {
|
|||
.filter(Boolean)
|
||||
)
|
||||
);
|
||||
const normalizedContextMemberNames = contextMemberNames.map((name) =>
|
||||
name.trim().toLowerCase()
|
||||
);
|
||||
const cacheKey = this.buildBootstrapTranscriptOutcomeCacheKey({
|
||||
filePath,
|
||||
sinceMs,
|
||||
|
|
@ -30477,16 +30502,15 @@ export class TeamProvisioningService {
|
|||
}
|
||||
const lineNormalizedText = normalizedText ?? '';
|
||||
if (shouldCollectBootstrapContext) {
|
||||
for (const contextMemberName of contextMemberNames) {
|
||||
for (const contextMemberName of normalizedContextMemberNames) {
|
||||
if (
|
||||
isBootstrapTranscriptContextText(
|
||||
text,
|
||||
teamName,
|
||||
contextMemberName,
|
||||
lineNormalizedText
|
||||
isNormalizedBootstrapTranscriptContextText(
|
||||
lineNormalizedText,
|
||||
normalizedTeamName,
|
||||
contextMemberName
|
||||
)
|
||||
) {
|
||||
bootstrapContextMembers.add(contextMemberName.trim().toLowerCase());
|
||||
bootstrapContextMembers.add(contextMemberName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue