Skip to content

Commit f2adf7b

Browse files
Merge pull request #1046 from Dhruvkumar-Microsoft/psl-TASfeature
fix: resolved the intermittent issue related to sometimes agent is not showing in the plan approval card
2 parents f3940cf + 4bb63bd commit f2adf7b

1 file changed

Lines changed: 4 additions & 11 deletions

File tree

src/App/src/store/PlanDataService.tsx

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -384,21 +384,14 @@ export class PlanDataService {
384384
.replace(/\\"/g, '"') || '';
385385

386386
const steps: MPlanData['steps'] = [];
387-
const stepRegex = /MStep\(([^)]*?)\)/g;
387+
const stepRegex = /MStep\(\s*agent=(['"])([\s\S]*?)\1\s*,\s*action=(['"])([\s\S]*?)\3\s*\)/g;
388388
let stepMatch: RegExpExecArray | null;
389389
let idx = 1;
390390
const seen = new Set<string>();
391391
while ((stepMatch = stepRegex.exec(body)) !== null) {
392-
const chunk = stepMatch[1];
393-
const agent =
394-
chunk.match(/agent='([^']+)'/)?.[1] ||
395-
chunk.match(/agent="([^"]+)"/)?.[1] ||
396-
'System';
397-
const actionRaw =
398-
chunk.match(/action='([^']+)'/)?.[1] ||
399-
chunk.match(/action="([^"]+)"/)?.[1] ||
400-
'';
401-
if (!actionRaw) continue;
392+
const agent = stepMatch[2] || 'System';
393+
const actionRaw = stepMatch[4] || '';
394+
if (!actionRaw.trim()) continue;
402395

403396
const cleanAction = actionRaw
404397
.replace(/\*\*/g, '')

0 commit comments

Comments
 (0)