Commit graph

22 commits

Author SHA1 Message Date
Andrew Beal
fa92e15b8c feat: add plan approval UI with user review workflow
Add PlanApprovalService and PlanApprovalView to enable user review
and approval of AI-generated execution plans before execution begins.
Users can approve, reject, or suggest changes to plans through a new
input mode and dedicated view.
2026-07-06 16:11:30 +01:00
Andrew Beal
28c8ccb44b feat: add quick actions system with provider-aware model settings
Introduce QuickActionsService and QuickAgent for lightweight, single-shot AI
operations. Add a dedicated quickActionModel setting alongside a new top-level
provider setting, with validation ensuring all models match the selected provider
and provider-specific defaults. Refactor FileSystemService to offer both TFile
and path-based overloads (readFile/readFilePath, writeToFile/writeToFilePath,
patchFile/patchFileAtPath). Replace window/document globals with activeWindow/
activeDocument throughout InputService and VaultkeeperAISettingTab for Obsidian
mobile compatibility.
Update linting packages to latest.
2026-04-20 20:20:22 +01:00
Andrew Beal
3bc2b34aa2 feat: add web viewer content retrieval tool for AI agents
Add new get_web_viewer_content tool that allows AI agents to retrieve
text content or screenshots from open web views. Refactor AIToolResponse
to use AIToolResponsePayload class for structured responses with attachment
support. Update tool service to handle binary file attachments consistently
across read_vault_files and new web viewer tool.
2026-04-08 21:00:23 +01:00
Andrew Beal
d18f5ef655 refactor: replace Replan with granular orchestration tools
Replace the single Replan tool with three targeted alternatives:
ReviseStep, RevisePlan, and SkipStep. This gives the orchestration
agent more precise control over plan recovery — revising only the
current step, replacing all remaining steps, or skipping a step
entirely — rather than triggering a full replan each time.

Also give the orchestration agent read access to vault files so it
can resolve execution failures without routing back to the planning
agent, and update the execution agent prompt to stop it from
attempting self-recovery (gap resolution is now the orchestrator's
responsibility).
2026-02-19 20:48:59 +00:00
Andrew Beal
9d4a4452c5 Rename 'AIfunction' to 'AITool' globally. 2026-01-30 22:35:54 +00:00
Andrew Beal
9cef35baec refactor: improve agent prompt clarity and workflow control
Clarify execution vs orchestration responsibilities, eliminate conditional step patterns in planning, add explicit plan completion signal, and strengthen guidance on atomic unconditional actions with outcome-based routing.
2026-01-28 23:48:49 +00:00
Andrew Beal
cefc408b2e Add context passing between execution steps and enhance orchestration
- Add context_for_next_step parameter to CompleteStep for passing execution history
- Add context parameter to CompleteTask for preserving task completion state
- Update OrchestrationResult to handle context propagation between steps
- Add debug color differentiation for agent types (Main, Execution, Orchestration, Planning)
- Reorganize SearchTypes from Helpers to Types directory
- Add justification requirement for execution deviations
- Support reasonable deviations in orchestration plan validation
- Refactor dependency service with TryResolve utility
- Add whitespace cleanup to Semaphore class
2026-01-28 21:23:47 +00:00
Andrew Beal
ab9ee08281 refactor: implement multi-agent orchestration architecture
Restructure the AI workflow from a single-agent model to a specialized
multi-agent system with distinct roles:

- Add AgentType enum (Main, Orchestration, Planning, Execution) to define
  agent specializations
- Replace AIControllerService and AIFunctionService with modular agent
  classes in Services/AIServices/:
  - MainAgent: Handles user interaction and delegates to orchestration
  - OrchestrationAgent: Coordinates plan execution and step-by-step workflow
  - PlanningAgent: Creates and revises execution plans
  - ExecutionAgent: Executes individual plan steps
  - AIController: Base class providing common agent loop functionality
- Create specialized prompts (OrchestrationPrompt, ExecutionPrompt) for
  agent-specific behavior
- Add OrchestrationResult type to communicate workflow control decisions
  (continue, abort, replan)
- Introduce agent-specific function scoping:
  - ExecuteWorkflow for main agent
  - CompleteTask for execution agent
  - CompleteStep/Replan/CancelPlan for orchestration agent
  - SubmitPlan/AskUserQuestionPlanning for planning agent
- Update BaseAIClass to use agentType property instead of isPlanningAgent
  boolean for model selection
- Simplify ExecutionPlan and ExecutionStep types by removing execution
  state tracking (moved to agent coordination)
- Remove PlanningEnabledAppendix and ExecutionStatus enum (superseded by
  agent architecture)
- Add comprehensive integration tests for agent workflows

This architecture provides better separation of concerns, clearer agent
responsibilities, and more robust plan execution with explicit orchestration
control flow.
2026-01-27 20:29:20 +00:00
Andrew Beal
19cd82ad7d feat: split ask_user_question into separate planning and execution functions
Add distinct AskUserQuestionPlanning and AskUserQuestionExecution functions to enable user consultation during both planning and execution phases. Update system prompt to clarify when to seek user input vs. replan. Fix plan area rendering timing and improve execution flow handling.
2026-01-07 20:00:40 +00:00
Andrew Beal
7e71861a4d refactor: improve plan execution with stricter scope and error handling
- Add currentProvider getter to AI classes for provider access
- Enhance planning prompt to discourage over-engineering and scope creep
- Return Unknown enum instead of throwing for invalid AI functions
- Add completion reminders to execution steps
- Fix ChatPlanArea height calculation timing
- Update tests to handle Unknown function gracefully
2026-01-06 20:49:02 +00:00
Andrew Beal
0fb17e7b3a feat: add planning model selection and rate limit countdown UI
Introduce separate planning model setting to allow using different models for planning vs execution. Add visual countdown display when rate limits are hit, with improved retry delay parsing across providers (Claude, OpenAI, Gemini). Refactor settings tab into Views directory and enhance mobile layout for input controls.
2026-01-05 21:49:51 +00:00
Andrew Beal
fbb2d8275d feat: add CompletePlan function to explicitly mark plan execution as complete
Add new CompletePlan function with schema and validation to allow agents to explicitly signal when all execution steps are done. Update system prompt to include completion confirmation step. Refactor execution loop to recursively prompt for completion if incomplete, with MAX_EXECUTION_DEPTH limit replacing MAX_PLANNING_ITERATIONS. Remove automatic incomplete execution handling in favor of explicit agent-driven completion.
2026-01-04 22:47:22 +00:00
Andrew Beal
e22cd8698a refactor: implement planning mode with user questions and cross-provider function call improvements
- Add planning mode toggle and AskUserQuestion function for interactive planning
- Fix Gemini cross-provider function call detection using toolId presence
- Update OpenAI naming service to handle new response format
- Improve system prompts by removing complexity gate, streamlining to action-first principle
- Add InputDisplay component and question mode to ChatInput
- Refactor execution plan error messages to show all incomplete steps
- Update tests to reflect cross-provider function call format changes
2026-01-04 18:52:44 +00:00
Andrew Beal
275f548914 refactor: streamline planning UX and strengthen complexity gate
Restructure system prompt to enforce mandatory complexity evaluation before action. Replace verbose multi-step planning framework with concise gate-based decision model. Add UI for execution plan visibility. Improve planning/execution separation by blocking execution tools during planning phase. Remove cancellation indicator component. Fix conversation deletion bug preventing saves after delete. Strengthen type safety for AIFunction names. Simplify function summary format for planning agent. Update test mocks for new callback signatures.
2026-01-03 11:15:32 +00:00
Andrew Beal
18d0741ec9 refactor: improve function call/response parsing and filtering
- Move parseFunctionCall/parseFunctionResponse to ResponseHelper
- Enhance orphaned call/response filtering with detailed debug logs
- Add toolId to conversation content for better tracking
- Fix planning workflow execution mechanics and step numbering
- Remove unused planning agent appendix and detailedAppendixForPlanningAgent
- Add conversation save callbacks throughout AI controller loops
- Improve multi-agent function handling to avoid exceptions
- Update all tests to include toolId fields for proper filtering
2025-12-31 22:56:22 +00:00
Andrew Beal
2c7e5b41b6 Add provider-specific retry delay extraction for rate limits
Implement extractRetryDelay methods in Claude, Gemini, and OpenAI classes to parse provider-specific retry delay headers/responses. Update StreamingService to use these delays when available, falling back to exponential backoff. Enhance ApiError to include response headers and body for retry delay extraction.
2025-12-31 14:19:42 +00:00
Andrew Beal
1b20533da9 refactor: return structured next step data instead of embedding in message
Previously the next step description was embedded in the completion message string.
Now return it as a separate structured object with step number, description,
instruction, and optional context for better programmatic access.
2025-12-30 22:42:23 +00:00
Andrew Beal
2de8109a74 refactor: restructure AI prompt and agent architecture for multi-agent planning support
- Move prompts from AIClasses to AIPrompts directory
- Replace centralized IPrompt injection with direct property setters on IAIClass
- Remove allowDestructiveActions parameter from streamRequest methods
- Add toolDefinitions, systemPrompt, and userInstruction properties to IAIClass
- Refactor AIFunctionDefinitions to static methods with agent-specific tool sets
- Add planning agent function definitions (CreatePlan, Replan, CompleteStep, SubmitPlan)
- Create AIControllerService to handle agent orchestration
- Add execution plan related copy strings and replacement utility
- Update all AI providers (Claude, Gemini, OpenAI) to use new architecture
2025-12-30 19:07:00 +00:00
Andrew Beal
e4f56e3877 refactor: improve type safety in file service and error handling
- Change listFiles() to synchronous method returning cached IDs
- Add type predicate to ApiError.isApiError() for better type narrowing
- Remove redundant ApiError union type in retry error handling
2025-12-19 12:36:28 +00:00
Andrew Beal
d36815c214 feat: add Gemini thought signature support and OpenAI Responses API migration
Implement thought signature tracking for Gemini function calls to support Gemini 3 requirements. Migrate OpenAI integration from Chat Completions to Responses API with proper input/output item handling. Add cross-provider compatibility via legacy text format fallback for conversations without thought signatures or tool IDs. Improve chat auto-scroll behavior and conversation validation. Add and update AI class and conversation tests.
2025-12-10 21:27:58 +00:00
Andrew Beal
33440d17bf refactor: standardize error handling and logging across codebase
Replace console.error/log with Exception.log helper, improve OpenAI error handling with retryable errors, add type-safe model validation, and add new AI models (Claude Opus 4.5, Gemini 3 Pro Preview, GPT-5.1)
2025-12-06 14:09:46 +00:00
Andrew Beal
18372ce01b refactor: improve error handling with structured API errors and retry logic
Replace console.error calls with Exception.log, implement typed API errors with automatic retry for transient failures (rate limits, server errors), add error state tracking to conversation content, and enhance system prompt with action-first operating principle, update unit tests
2025-11-19 20:30:53 +00:00