fix: Switch auto-spawn from discuss to refine agent, surface in UI

The auto-spawned agent on initiative creation was using discuss mode
(Q&A) when it should use refine mode (expand content). Now:

- Description seeds root page as tiptap content (split on double newlines)
- Spawns refine agent with the populated page in inputContext
- getActiveRefineAgent broadened to also surface discuss agents (for
  CLI-spawned discuss agents)
- RefineAgentPanel shows mode-appropriate label for discuss vs refine
This commit is contained in:
Lukas May
2026-03-03 14:25:43 +01:00
parent b38a2ec034
commit 9e7c246280
7 changed files with 41 additions and 18 deletions

View File

@@ -123,7 +123,7 @@ export function CreateInitiativeDialog({
<Label htmlFor="initiative-description">
Description{" "}
<span className="text-muted-foreground font-normal">
(optional spawns a discuss agent)
(optional seeds root page and spawns refine agent)
</span>
</Label>
<Textarea

View File

@@ -66,11 +66,12 @@ export function RefineAgentPanel({ initiativeId }: RefineAgentPanelProps) {
// Running
if (state === "running") {
const runningLabel = agent?.mode === 'discuss' ? 'Architect is discussing...' : 'Architect is refining...';
return (
<div className="mb-3 flex items-center gap-2 rounded-lg border border-border bg-card px-3 py-2">
<Loader2 className="h-3.5 w-3.5 animate-spin text-primary" />
<span className="text-sm text-muted-foreground">
Architect is refining...
{runningLabel}
</span>
</div>
);