mirror of
https://github.com/httprunner/httprunner.git
synced 2026-09-05 23:51:25 +08:00
feat: implement UI automation test history isolation
- Add ResetHistory option to PlanningOptions and ActionOptions - Implement task completion detection with isTaskFinished() method - Add executeActions() method to separate action execution logic - Modify ConversationHistory.Clear() to completely clear all messages including system message - Refactor StartToGoal() to automatically reset history on first attempt - Add WithResetHistory() option function for consistent API - Consolidate test files into driver_ext_ai_test.go with comprehensive test coverage
This commit is contained in:
+9
-4
@@ -62,10 +62,15 @@ func (h *ConversationHistory) Append(msg *schema.Message) {
|
||||
}
|
||||
|
||||
func (h *ConversationHistory) Clear() {
|
||||
// Keep only the system message
|
||||
systemMsg := (*h)[0]
|
||||
*h = ConversationHistory{systemMsg}
|
||||
log.Info().Msg("conversation history cleared")
|
||||
// Check if history is empty
|
||||
if len(*h) == 0 {
|
||||
log.Info().Msg("conversation history is already empty")
|
||||
return
|
||||
}
|
||||
|
||||
// Clear everything including system message
|
||||
*h = ConversationHistory{}
|
||||
log.Info().Msg("conversation history cleared completely")
|
||||
}
|
||||
|
||||
func logRequest(messages ConversationHistory) {
|
||||
|
||||
Reference in New Issue
Block a user