mirror of
https://github.com/httprunner/httprunner.git
synced 2026-09-05 15:37:35 +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:
@@ -23,6 +23,7 @@ type PlanningOptions struct {
|
||||
UserInstruction string `json:"user_instruction"` // append to system prompt
|
||||
Message *schema.Message `json:"message"`
|
||||
Size types.Size `json:"size"`
|
||||
ResetHistory bool `json:"reset_history"` // whether to reset conversation history before planning
|
||||
}
|
||||
|
||||
// PlanningResult represents the result of planning
|
||||
@@ -85,6 +86,12 @@ func (p *Planner) Call(ctx context.Context, opts *PlanningOptions) (*PlanningRes
|
||||
return nil, errors.Wrap(err, "validate planning parameters failed")
|
||||
}
|
||||
|
||||
// reset conversation history if requested
|
||||
if opts.ResetHistory {
|
||||
p.history.Clear() // Clear everything including system message for complete isolation
|
||||
log.Info().Msg("conversation history reset for planner")
|
||||
}
|
||||
|
||||
// prepare prompt
|
||||
if len(p.history) == 0 && opts.UserInstruction != "" {
|
||||
// add system message
|
||||
|
||||
Reference in New Issue
Block a user