Skip to content

fix(embedded-agent): honor provider pick, survive reload, persist agent pins (v0.4.1)#53

Merged
kurtstohrer merged 2 commits into
mainfrom
fix/embedded-agent-reliability
Jun 23, 2026
Merged

fix(embedded-agent): honor provider pick, survive reload, persist agent pins (v0.4.1)#53
kurtstohrer merged 2 commits into
mainfrom
fix/embedded-agent-reliability

Conversation

@kurtstohrer

Copy link
Copy Markdown
Owner

Summary

Reliability fixes for embedded agent mode, cut as v0.4.1.

Fixed

  • The selected provider actually applies the task. Built-in personas hard-coded claude-local, so every apply/seed run spawned claude regardless of the provider chosen in Settings → Providers — surfacing as spawn claude ENOENT when claude wasn't installed (e.g. Copilot was selected). Built-in personas now inherit the global active provider; an explicit per-persona pin in .annotask/agents.json still wins (resolveProviderForTaskType).
  • Per-agent provider/model pins persist. Setting a persona's model in Settings → Agents was silently wiped whenever the provider's live model catalog couldn't be enumerated (Copilot's interactive-only picker), and a saved value displayed empty. The field now keeps + shows the saved value; a stale id from a different provider is cleared on provider change instead, never on catalog-fetch failure.
  • Reloading the page no longer destroys an in-flight apply. The spawn server keeps a task-bearing run alive across a client disconnect (detach grace) and finalizes the task on the child's own exit (clean → review, interrupted/failed → pending). The client no longer reverts the task on pagehide and warns before an accidental reload. A stale orphan-finalize can't clobber a newer run for the same task.
  • Auto-run reliability. The headless driver logs when its single-run guard blocks a drain (was silent) and bounds each run so a hung provider can't wedge the queue.
  • Conversation rendering. Full GFM (lists/headings/blockquotes/links/tables), min-width: 0 so wide output doesn't scroll the panel, inline-code wrapping, agent-question banner contrast, and links open in a new tab with rel="noopener".

Changed

  • Seed prompt carries the task inline — a compact Task grounding block (file/line/component + per-type context, via the shared task-summary) so the agent applies directly instead of reflexively calling annotask_get_task. Heavy fields (screenshot, rendered HTML, interaction history) stay behind MCP.

Verification

  • Typecheck clean; full suite 1004 passed. New server tests cover the detach-grace + exit-aware finalize.
  • Live smokes on the vue-vite playground with real CLIs:
    • Reload survival (HTTP): apply run + disconnect → CLI kept running → task landed review; force-kill → pending.
    • Provider routing (Playwright, all four CLIs found+logged-in): selecting copilot/codex/opencode/claude each spawned that CLI (not claude-local), no ENOENT.
    • Agent-pin persistence (Playwright): copilot + custom model saved, displayed, and survived a full reload (no wipe).

Notes

  • npm publish runs locally (npm MFA/OTP), not via the release workflow.
  • Follow-up (not in this PR): show "Inherit (active provider)" for unpinned built-in personas in the Agents panel; optional live-streaming reattach view on reload.

🤖 Generated with Claude Code

…nt pins, inline task grounding

- Provider routing: built-in personas now inherit the global Settings -> Providers
  pick instead of the hardcoded claude-local; explicit per-persona pins
  (.annotask/agents.json) still win. Fixes apply runs spawning `claude` (and the
  resulting `spawn claude ENOENT`) when another CLI — e.g. copilot — was selected.
- Agent settings persistence: stop wiping a saved per-persona model when the live
  model catalog can't be enumerated (Copilot's case), and display the saved value;
  a stale cross-provider model is cleared on provider change instead.
- Reload survival: the spawn server keeps an applying CLI alive across a client
  disconnect (detach-grace) and finalizes the task on the child's own exit
  (clean exit -> review, interrupted/failed -> pending); the client no longer
  reverts the task to pending on pagehide and warns before an accidental reload.
  A stale orphan-finalize timer can no longer clobber a newer run for the task.
- Autostart hardening: the headless auto-run driver warns when its single-run
  guard blocks a drain, and bounds each run so a hung send() can't wedge the FIFO.
- Conversation styling: full GFM rendering (lists/headings/blockquotes/links/
  tables), flex min-width so wide output doesn't scroll the whole panel, inline-
  code word-break, and a contrast fix on the agent-question banner; markdown
  links open in a new tab with rel=noopener.
- Seed prompt inlines a compact task-grounding block (file/line/component + per-
  type context, via the shared buildTaskSummary) so the agent applies directly
  instead of reflexively calling annotask_get_task; heavy fields (screenshot,
  rendered HTML, interaction history) stay behind MCP.
@kurtstohrer kurtstohrer merged commit d9bfb15 into main Jun 23, 2026
3 checks passed
@kurtstohrer kurtstohrer deleted the fix/embedded-agent-reliability branch June 23, 2026 17:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant