Fix truncation issues in piplan, SQLite storage, and history compression; add PIPlanMaxChars configuration

This commit is contained in:
whlaoding
2026-03-15 00:32:14 +08:00
parent ea88e1dc18
commit 38d6875ab8
8 changed files with 683 additions and 66 deletions

View File

@@ -225,6 +225,9 @@ func runMessageChannel(ctx context.Context, cfg config.Config, engine *agent.Orc
func(ctx context.Context, chatID, userID string, files []llm.InputFile) ([]string, error) {
return engine.UploadAndCacheFiles(ctx, chatID, userID, files)
},
func(ctx context.Context, chatID string, limit int) ([]memory.Message, error) {
return engine.GetHistory(chatID, limit)
},
)
default:
return fmt.Errorf("unsupported message channel: %s", cfg.MessageChannel)
@@ -280,6 +283,14 @@ func buildWebUIStreamForwarder(callback webui.StreamEventCallback, exposeReasoni
Content: event.Content,
Step: event.Step,
})
case agent.StreamEventTypeWorkspaceStart, agent.StreamEventTypeWorkspaceDelta, agent.StreamEventTypeWorkspaceEnd:
return callback(webui.StreamEvent{
Type: webui.StreamEventType(event.Type),
Content: event.Content,
Step: event.Step,
ToolName: event.ToolName,
WorkspaceTitle: event.WorkspaceTitle,
})
default:
return nil
}