Interface ProgressReporter

All Known Implementing Classes:
OrchestratorAgent

public interface ProgressReporter
SubAgent need reference for OrchestratorAgent. Since this maven sub-module (workshop-core) does not have dependency for workshop-orchestrator (where OrchestratorAgent is), we cannot directly import ai.tabforge.workshop.orchestrator.OrchestratorAgent into SubAgent (needed for updateProgress() and escalate() call), but workshop-orchestrator depends on workshop-core (so, OrchestratorAgent can implement this interface) - solution is that SubAgent has reference to this intterface, and thus access to OrchestratorAgent.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    escalate(String reviewId, Finding finding)
    If agent finds critical finding during file procession, and before continuing with the next file, it will notify the orchestrator of the escalation, and stop the work.
    void
    updateProgress(String reviewId, String currentFile)
     
  • Method Details

    • updateProgress

      void updateProgress(String reviewId, String currentFile)
    • escalate

      void escalate(String reviewId, Finding finding)

      If agent finds critical finding during file procession, and before continuing with the next file, it will notify the orchestrator of the escalation, and stop the work. The agent notifies orchestrator this by calling this method (the orchestrator implements this interface), and, in fact, the orchestrator should stop the agent, by using CountDownLatch mechanism.

      By calling this method, the agent sends the reviewId, as well as information about his finding for the file it processes ( Severity - CRITICAL, INFO, WARNING, then lineNumber, ...) Knowing rewiewId and Finding, this method then sends the Finding on deciding what to do - let's call the mechanism that decides what to do next - the Escalation Handler

      This method will be called by the

      invalid reference
      SubAgent#execute()
      . Since the implementation of this method typically uses java.util.concurrent.CountDownLatch await(), this means SubAgent#execute() will wait (being blocked), it will remain in this state until another thread - in our case,
      invalid reference
      OrchestratorAgent#resumeAfterEscalation()
      - calls countDown()

      Parameters:
      reviewId -
      finding -