mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-10-15 16:42:15 +00:00
952fccf8df
Completes the first-session elicitation fix thata3f8b18bfstarted at the tool layer. The second observed failure mode ("Are there any alerts I should look at?" on Ollama qwen3:8b) had the model calling pulse_question BEFORE any tool call, so no tool error copy and no tool description can reach it — the resolve-before-asking prompt policy (945ed2198) needs runtime teeth for small local models. The agentic loop now refuses an interactive pulse_question issued before the run has attempted any real tool call: the model gets an error tool result steering it to read-only enumeration (pulse_summarize {"action":"fleet"} and the alert tools need no parameters), no question card or clarify event reaches the stream, sibling tool calls from the same provider turn keep processing instead of tripping the interactive-set skip path, any queued tool attempt satisfies the gate for the rest of the run, and it fails open after 2 refusals so an unanswerable prompt cannot livelock. Non-interactive profiles keep their existing separate block. The system prompt discloses the gate; question-flow tests now open with a look turn the way real runs must; a corpus scenario pins the stream promise (a natural first question produces an answer, never a clarification card). Live-verified on a real Ollama qwen3:8b scratch instance (real local agent, not mock): both natural openers stream tool-backed answers with zero question events. Full ./internal/ai/... suite green. ai-runtime contract updated in-commit.