dotfiles
bugabingas dorkfiles
owned by bugabinga
fix(agent): check hasUI before setStatus
21fff5e32789686d94e67672167bcf09660fca2a
Oliver Jan Krylow <oliver@bugabinga.net> ·
unsigned
Browse filesCompare with HEAD
Changed files (1)
pi/agent/extensions/devil/index.ts
Modified237 237 ? `\n\n**Focus:** Challenge specifically from ${stakeholder} perspective.` 241 - ctx.ui?.
setStatus(
"devil",
`🗡️ Devil: ${idea.slice(0, 40)}... (${maxRounds}r)`);
242 + ctx.ui.
setStatus(
"devil",
`🗡️ Devil: ${idea.slice(0, 40)}... (${maxRounds}r)`);
244 246 const rounds_data
: string[]
= [];
272 274 rounds_data.
push(
`### Round ${i}\n\n**Challenge:**\n${devilOutput}\n\n**Your Response:**\n${proposerOutput}`);
275 - ctx.ui?.
setStatus(
"devil",
`🗡️ Devil: Round ${i}/${maxRounds} - ${roundBlockingCount} blocking`);
278 + ctx.ui.
setStatus(
"devil",
`🗡️ Devil: Round ${i}/${maxRounds} - ${roundBlockingCount} blocking`);
278 282 const resolvedCount
= (proposerOutput.
match(
/\*\*status\*\*:\s*resolved|status:\s*resolved/gi)
|| []).
length;
326 330 :
`${synthesisOutput}${blockingNote}\n\n*Debate: ${rounds_data.length} rounds | Blocking: ${blockingIssuesFound}*`;
329 - ctx.ui?.
setStatus(
"devil",
undefined);
334 + ctx.ui.
setStatus(
"devil",
undefined);
332 338 content: [{ type:
"text", text: outputText }],
335 341 }
catch (error) {
336 342 const message
= error
instanceof Error ? error.message
: String(error);
338 - ctx.ui?.
setStatus(
"devil",
undefined);
345 + ctx.ui.
setStatus(
"devil",
undefined);
340 348 content: [{ type:
"text", text:
`## Debate Failed\n\nError: ${message}` }],
341 349 details: { error: message },