Skip to content

feat: Add workflow replay command and YAML config viewer#70

Merged
jrob5756 merged 18 commits intomainfrom
feature/replay-workflow-run
Apr 2, 2026
Merged

feat: Add workflow replay command and YAML config viewer#70
jrob5756 merged 18 commits intomainfrom
feature/replay-workflow-run

Conversation

@jrob5756
Copy link
Copy Markdown
Collaborator

Summary

Adds two new features to the Conductor dashboard:

1. conductor replay command

Replay recorded workflow runs from JSON/JSONL event log files with a web dashboard.

conductor replay <log-file> [--web-port PORT]
conductor replay /tmp/conductor/conductor-my-workflow.events.jsonl
  • Auto-detects JSON array (dashboard download) and JSONL (EventLogSubscriber) formats
  • Timeline slider for scrubbing through workflow history
  • Play/pause with 1×/5×/10×/20×/50× speed controls
  • Event timestamps used for durations (not wall clock)
  • Lightweight ReplayDashboard server reuses the existing React frontend

2. YAML config viewer

A "YAML" button in the dashboard header opens a centered modal displaying the workflow configuration with:

  • Syntax highlighting (keys, values, comments, booleans)
  • Collapsible sections with indentation-based folding (▶/▼ toggles)
  • Works in both live and replay modes (YAML flows through the event pipeline via workflow_started)

Implementation details

  • ReplayDashboard class in src/conductor/web/replay.py — minimal FastAPI server
  • Frontend detects replay mode via GET /api/replay/info (404 in live mode)
  • useReplay hook drives auto-play with delays derived from real event timestamps
  • workflow_started event now includes yaml_source field
  • 18 new tests (13 server + 5 CLI), all 334 tests passing

Files changed

  • src/conductor/web/replay.py — new ReplayDashboard server
  • src/conductor/cli/app.py — new replay command
  • src/conductor/engine/workflow.py — emit yaml_source in workflow_started
  • src/conductor/web/frontend/src/ — store, hooks, and components for replay + YAML viewer
  • tests/ — new test files for replay server and CLI command

jrob5756 and others added 13 commits March 31, 2026 10:11
Add a new `conductor replay <log-file>` CLI command that launches the
web dashboard in replay mode with a timeline slider for scrubbing
through recorded workflow history.

Backend:
- ReplayDashboard server loads JSON array or JSONL event logs
- /api/replay/info endpoint enables frontend replay mode detection
- Auto-detects file format (dashboard download vs EventLogSubscriber)

Frontend:
- ReplayBar component with play/pause, scrub slider, and 1x/2x/4x/8x
  speed controls
- useReplay hook drives auto-play with timing derived from real event
  timestamps
- App.tsx conditionally renders replay vs live mode

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
In replay mode, elapsed timers (workflow duration, per-agent, per-script)
now compute from event timestamps rather than Date.now(), so durations
match the original workflow execution.

Live mode is unchanged — the replayMode guard ensures Date.now() timers
only run when replayMode is false (the default).

Also restores src/lib/utils.ts and src/lib/constants.ts that were
inadvertently gitignored by the top-level lib/ pattern.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Include raw YAML text in the workflow_started event via a yaml_source
field. The frontend stores it and shows a "YAML" button in the header
that opens a slide-over panel. Works in both live and replay modes
since the YAML flows through the event pipeline.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Panel is now 80% width centered modal. YAML keys are highlighted in
blue, booleans/numbers in amber, strings in green, and comments in
emerald.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Padding on the scroll container gets clipped; moving it to the pre
element ensures consistent spacing around the YAML content.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add indentation-based code folding to the YAML viewer. Lines with
more-indented children get a ▶/▼ toggle in the gutter. Collapsed
sections show a ··· badge. Click to expand/collapse.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Replace hardcoded "Dashboard v1.0" with the actual conductor-cli
version from the workflow_started event. Shows "v0.1.5" etc.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@jrob5756 jrob5756 force-pushed the feature/replay-workflow-run branch from 05c3878 to 318d999 Compare March 31, 2026 14:13
jrob5756 and others added 5 commits March 31, 2026 12:18
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Some tests pass workflow_path as a string instead of Path. Wrap with
Path() and catch ValueError in addition to OSError.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
In CI environments with narrow or unset terminal widths, Rich truncates
option names in Typer help output (e.g. '--web-port' becomes '--web…'),
causing the test_custom_port_option assertion to fail.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The COLUMNS env var was set after importing conductor.cli.app, which
creates Rich Console objects at module level during import. On CI (no
TTY), the Console cached a narrow default width, causing --web-port to
be truncated from replay help output.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Rich may insert ANSI escape codes within option names differently
across platforms. Strip them before checking for --web-port to make
the test robust on CI (Linux, no TTY).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@jrob5756 jrob5756 merged commit bf5f984 into main Apr 2, 2026
7 checks passed
@jrob5756 jrob5756 deleted the feature/replay-workflow-run branch April 2, 2026 13:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant