dotfiles
bugabingas dorkfiles
owned by bugabinga
fix(agent): use setStatus for progress feedback
32a29eb26c8d75c4e1ba563f90a340637f5e031a
Oliver Jan Krylow <oliver@bugabinga.net> ·
unsigned
Browse filesCompare with HEAD
Simpler approach than widget. Shows status bar while debate runs.
Changed files (1)
pi/agent/extensions/devil/index.ts
Modified237 237 ? `\n\n**Focus:** Challenge specifically from ${stakeholder} perspective.` 241 - ctx.ui?.
setWidget(
"devil", [
242 - "🗡️ Devil's Advocate",
243 - `Idea: ${idea.slice(0, 50)}${idea.length > 50 ? "..." : ""}`,
244 - `Rounds: ${maxRounds} | Model: ${model.id}`,
245 - "Status: Starting...",
241 + ctx.ui?.
setStatus(
"devil",
`🗡️ Devil: ${idea.slice(0, 40)}... (${maxRounds}r)`);
249 244 const rounds_data
: string[]
= [];
277 272 rounds_data.
push(
`### Round ${i}\n\n**Challenge:**\n${devilOutput}\n\n**Your Response:**\n${proposerOutput}`);
280 - ctx.ui?.
setWidget(
"devil", [
281 - "🗡️ Devil's Advocate",
282 - `Round ${i}/${maxRounds}: Challenge raised`,
283 - `Blocking issues: ${roundBlockingCount}`,
284 - "Awaiting synthesis...",
275 + ctx.ui?.
setStatus(
"devil",
`🗡️ Devil: Round ${i}/${maxRounds} - ${roundBlockingCount} blocking`);
288 278 const resolvedCount
= (proposerOutput.
match(
/\*\*status\*\*:\s*resolved|status:\s*resolved/gi)
|| []).
length;
335 325 ? `## Full Debate\n\n${rounds_data.join("\n\n---\n\n")}\n\n---\n\n## Summary\n\n${synthesisOutput}${blockingNote}\n\n**Debate:** ${rounds_data.length} rounds | **Blocking issues:** ${blockingIssuesFound}` 336 326 : `${synthesisOutput}${blockingNote}\n\n*Debate: ${rounds_data.length} rounds | Blocking: ${blockingIssuesFound}*`;
339 - ctx.ui?.
setWidget(
"devil",
undefined);
329 + ctx.ui?.
setStatus(
"devil",
undefined);
342 332 content: [{ type:
"text", text: outputText }],
345 335 }
catch (error) {
346 336 const message
= error
instanceof Error ? error.message
: String(error);
348 - ctx.ui?.
setWidget(
"devil",
undefined);
338 + ctx.ui?.
setStatus(
"devil",
undefined);
350 340 content: [{ type:
"text", text:
`## Debate Failed\n\nError: ${message}` }],
351 341 details: { error: message },