Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

Building a human-in-the-loop browser workflow for PhotoCraft AI

Description and use

The PhotoCraft AI workflow now checks both CLI exit codes and output to avoid retrying on timeouts, uses a unique database constraint to prevent duplicates, and handles browser state persistence separately.

Problem

Timeouts in browser automation can falsely indicate a failed action, leading to unnecessary retries and potential duplicate side effects.

Outcome

The workflow now distinguishes between client-side timeouts and actual failures, preventing unnecessary retries and duplicate actions while allowing human review before publication.

Workflow

  • Commit the "submitting" state before clicking the final button to mark an external attempt.
  • Check both the CLI exit code and the captured output for error markers before retrying.
  • Persist browser state separately and reimport it to restore markers after a restart.
  • Use a database uniqueness constraint to avoid duplicate local records.
  • Reconcile ambiguous outcomes by inspecting the page before deciding on a retry.
  • Ensure human review occurs before publishing final fields.
  • Maintain tests to verify that reimporting, restarts, timeouts, and restricted opportunities behave correctly.

Evidence

During a local browser-automation test on macOS, a CLI click returned a timeout. The shell process still returned exit code 0. Inspection of the resulting browser state showed that the click's intended effect had occurred.

Source

Commit submitting before clicking the final button. If the process crashes, the next run sees an unfinished external attempt rather than a fresh task.

Source

For the CLI version used in this test, an execution wrapper checks both: if proc.returncode or "### Error" in result: raise WorkflowError...

Source

Another local test closed and reopened Chrome with the same persistent Profile. localStorage survived, but the test cookie did not. The cause has not been isolated.

Source

  • Record date: 2026-10-27T16:26:25.298Z