Skip to content

Feature: Optional workflow name field for log file naming #34

Description

@maddes8cht

Problem

Currently, log files are named openloop-run-<timestamp>.log (e.g., openloop-run-20260723-143022.log). When running multiple workflows or the same workflow multiple times, it is difficult to identify which logs belong to which project or workflow run without opening each file.

Solution

Add an optional name field to the workflow JSON that is embedded in the log filename. This allows grouping logs by project or workflow run.

Log Filename Format

openloop-run-{name}-{timestamp}.log

Examples:

  • openloop-run-myapp-coverage-20260723-143022.log
  • openloop-run-api-tests-20260723-150000.log

If name is empty/not set, the filename falls back to the current format (openloop-run-<timestamp>.log).

Scope — Single Feature

This is one logical feature: the name field is stored in the workflow JSON, displayed/edited in the GUI, and used in the log filename. All three parts are interdependent.

Detailed Design

1. Data Model — WorkflowConfig (core/engine.py)

Add an optional name field:

@dataclass
class WorkflowConfig:
    ...
    name: Optional[str] = None
  • Not added to Config — a workflow name is a workflow property, not an OpenLoop installation setting.
  • Serialized to/from the workflow JSON file.

2. Hierarchical Scope

The name field belongs only in the workflow JSON, not in openloop.json (Config). This enforces a clean separation:

Config (openloop.json) Workflow JSON
System-wide settings Flow-specific settings
agents_dir, workflows_dir, opencode_binary, log_dir, default_max_loops, default_timeout loop_agents, preparation_agents, finalization_agents, end_state_condition, max_loops, workdir, init_script, opencode_defaults, name

3. GUI — Settings > Environment (ui/app.py)

Add a "Name:" field in the Environment section (below Init Script):

┌──────────────────────────────┐
│ Environment                  │
│                              │
│ Workdir: [______________] [Browse] │
│ Init Script: [_________] [Browse] │
│ Name:   [_________________]       │  ← new
└──────────────────────────────┘
  • Optional text input
  • Saved to workflow JSON via _get_workflow_data()
  • Loaded from workflow JSON via _load_workflow_into_ui()

4. Engine — Log File Naming (core/engine.py:_init_log())

Pass the workflow name when executing, then modify the filename:

ts = datetime.now().strftime("%Y%m%d-%H%M%S")
if self._workflow_name:
    filename = f"openloop-run-{self._workflow_name}-{ts}.log"
else:
    filename = f"openloop-run-{ts}.log"
self._log_path = log_dir / filename

The engine needs to accept the name from the workflow data, either via:

  • A new _workflow_name field set in execute_workflow_data() before calling _init_log(), or
  • Reading it from WorkflowConfig.name in execute_workflow_data().

5. CLI

No CLI changes needed. The name comes from the workflow JSON and _run_cli() already passes the full data dict to execute_workflow_data().

6. Not in State

The workflow name is intentionally not added as a state field. Agents have no need to read the workflow name. If a use case arises later, it can be added to payload at that time.

Implementation Plan

  • Add name: Optional[str] = None to WorkflowConfig dataclass (core/engine.py)
  • Add name to from_dict() / to_dict() serialization (core/engine.py)
  • Add Name field to GUI Settings Environment section (ui/app.py)
  • Add load/save logic in _get_workflow_data() / _load_workflow_into_ui() (ui/app.py)
  • Accept name in engine and use it in _init_log() filename (core/engine.py)
  • Ensure empty name falls back to current filename format
  • Update docs/cli.md and README.md if applicable (likely no doc changes needed)
  • Tests: 137 unit tests must remain green

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions