@yuantest/playwright - v1.2.1
    正在准备搜索索引...

    类 HealerAgent

    层级

    • BaseAgent
      • HealerAgent
    索引

    构造函数

    属性

    config: AgentConfig
    llmService: LLMService | null
    log: ChildLogger = ...
    lastTokenUsage?: TokenUsage

    最近一次 callLLM / callLLMWithAgentLoop 调用的 token 用量

    方法

    • 子类声明需要的额外配置 key 列表。 AgentService 会根据此列表传递对应的 extraParams, 避免使用 instanceof / 引用相等判断。

      返回 string[]

    • 获取当前 LLM 配置

      返回 LLMConfig | null

    • 更新 Agent 配置 同时更新 AgentConfig 和 LLMService

      参数

      • config: AgentConfig
      • llmConfig: LLMConfig | null
      • 可选_extraParams: Record<string, unknown>

      返回 void

    • 设置共享的 ToolRegistry 实例

      参数

      • registry: ToolRegistry | null

      返回 void

    • 设置共享的 LLMService 实例

      参数

      • service: LLMService | null

      返回 void

    • 获取 ToolRegistry 实例。 优先使用共享实例,若无则按需创建(兼容独立使用场景)。

      返回 ToolRegistry

    • 基础 LLM 调用方法(单次调用模式) 子类可通过 options 参数覆盖默认的 maxTokens、temperature 等配置

      参数

      • systemPrompt: string
      • userPrompt: string
      • 可选options: CallLLMOptions

      返回 Promise<string>

    • 子类必须提供 Agent 名称,用于 logger 标识

      返回 string

    • 参数

      • testFilePath: string
      • 可选options: { maxRounds?: number; error?: string; stackTrace?: string }

      返回 Promise<AgentHealResult>

    • 运行测试并在失败时尝试修复,包含事务性补丁应用和最终回滚逻辑

      参数

      • testFilePath: string
      • runTestFn: (
            filePath: string,
        ) => Promise<{ passed: boolean; error?: string; stackTrace?: string }>
      • 可选options: { maxRounds?: number }

      返回 Promise<AgentHealResult>