feat: investigation prompt, plan/execute phases, and arc spinner#92
Merged
feat: investigation prompt, plan/execute phases, and arc spinner#92
Conversation
…estions Replace hardcoded string matching in IncidentConfirmation with a two-tier classifier: fast text matching for common patterns (option index, y/n, exact option text, Enter), falling back to a lightweight LLM call for ambiguous answers. Also preserve question options in ResumeContext and include them in the continuation prompt so the LLM can interpret answers like "1" in regular Question flows.
…essage Add ask_user support during investigation phase so the investigator can ask scoping/clarification questions before running diagnostics. Rework the investigator prompt with structured Phase 1 (scoping) and Phase 2 (diagnosis) guidance. Fix duplicate "post-mortem saved to" message by extracting only the file path from the reporter response instead of emitting the full LLM echo. Demote keyboard key-event log from debug to trace.
…ure command completion - Fix ANSI stripping to handle DEC private mode sequences (e.g. \x1b[?2004h) - Add 150ms debounce window so partial PTY chunks don't trigger false positives - Replace overly broad prompt patterns (^.*[$#%]\s*$) with specific ones
Track operator question-answer pairs in IncidentContext so subsequent agent turns retain the full conversation history. Also fix message ordering in orchestrator resume flows to ensure history includes the latest exchange before continuing.
Add planning entry points (start_planning, resume_planning_question, run_planning_step, start_plan_review), execution entry points (start_execution, resume_execution_command, resume_execution_with_output, resume_execution_question, run_execution_step), modify run_analysis_and_report to chain plan confirmation after report, and add all orchestrator match arms for the new ResumeContext variants.
Replace fragile LLM text parsing with Arc<RwLock<Option<Result>>> slots that tools deposit results into directly, so the pipeline reads the saved file path reliably.
Each PlannerAgent turn creates a fresh agent with no conversation history. Without recording planning Q&A into IncidentContext, the agent would repeat earlier questions. Mirror what resume_investigation_question already does.
The plan review question asked "Would you like to change anything?" forcing users to say "no" to proceed, inconsistent with every other HITL prompt. Reframed to "Are you happy with this plan?" so "yes" means proceed to execution.
Replace the text-based dots spinner with a painted arc spinner drawn using egui's Painter API. This avoids font compatibility issues and provides a smooth, anti-aliased loading indicator.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Test plan
ENGINE_TYPE=mock cargo runand trigger an LLM query (? ...) — verify the rotating arc spinner appears while waitingcargo test— all existing tests passcargo clippy -- -D warnings— no warnings