Skip to main content

Enable unit preview in TaskReview app

By default, TaskReview app UI always shows a generic results view (i.e. unit content submitted by worker in the format saved by AgentState, such as data/data/runs/...../agent_data.json content).

Additionally, you can enable custom display of unit content (e.g. to show task same way as a worker saw it). To do so, you will need to create a separate "review" version of your app. Then TaskReview app UI will show "review" version to reviewer inside an iframe, while "regular" version will be shown to worker.

  1. Create review_app subdirectory within your app, next to the main app subdirectory. Its content should include:

  2. Specify in your Hydra YAML, under mephisto.blueprint section:

task_source_review: ${task_dir}/webapp/build/
  1. Add a separate build command for the "review" bundle
"build:review": "webpack --mode development"

Example: package.json

  1. Build this "review" bundle by running npm run build:review from directory with package.json.

  2. This reviewapp.jsx must satisfy 3 requirements, to interface with TaskReview:

    • Render "review" task version only upon receiving messages with Task data:
    • Send messages with displayed "review" page height (to resize containing iframe and avoid scrollbars)
    • Rendered component must always return reference to appRef, like so: <div ref={appRef}>