refactor: improve AI event handling and conflict display in chat
- AI fetches events on-demand via callbacks for better efficiency - Add conflict detection with warning display when proposing overlapping events - Improve event search and display in chat interface - Load full chat history for display while limiting AI context
This commit is contained in:
@@ -4,7 +4,7 @@ import { createLogger } from "./logger";
|
||||
* Summarize args for logging to avoid huge log entries.
|
||||
* - Arrays: show length only
|
||||
* - Long strings: truncate
|
||||
* - Objects with conversationHistory/existingEvents: summarize
|
||||
* - Objects with conversationHistory: summarize
|
||||
*/
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
function summarizeArgs(args: any[]): any[] {
|
||||
@@ -31,8 +31,6 @@ function summarizeValue(value: any, depth = 0): any {
|
||||
for (const [key, val] of Object.entries(value)) {
|
||||
if (key === "conversationHistory" && Array.isArray(val)) {
|
||||
summarized[key] = `[${val.length} messages]`;
|
||||
} else if (key === "existingEvents" && Array.isArray(val)) {
|
||||
summarized[key] = `[${val.length} events]`;
|
||||
} else if (key === "proposedChanges" && Array.isArray(val)) {
|
||||
// Log full proposedChanges for debugging AI issues
|
||||
summarized[key] = val.map((p) => summarizeValue(p, depth + 1));
|
||||
|
||||
Reference in New Issue
Block a user