Skip to content

Harden detached-run daemon startup, submission failures, and optimizer child-pipeline loading#28

Draft
Copilot wants to merge 13 commits into
masterfrom
copilot/fix-code-comments
Draft

Harden detached-run daemon startup, submission failures, and optimizer child-pipeline loading#28
Copilot wants to merge 13 commits into
masterfrom
copilot/fix-code-comments

Conversation

Copy link
Copy Markdown

Copilot AI commented May 23, 2026

This addresses the unresolved PR review comments on detached runs, graph optimization, and the async verification script. The changes tighten failure handling around daemon startup/submission, prevent optimizer-edited pipeline loads from hanging indefinitely, and make the verification flow self-contained.

  • Detached daemon lifecycle

    • Add a startup lock around daemon creation/metadata updates so concurrent agentflow run -d invocations do not race each other.
    • Write daemon metadata atomically to avoid partially written state.
    • Emit a clear timeout diagnostic from _wait_for_daemon() with the target base URL and next-step guidance.
  • Detached submission error handling

    • Catch transport failures when posting detached runs to the daemon.
    • Handle invalid/non-JSON daemon responses explicitly instead of surfacing raw exceptions.
    • Include the daemon base URL in user-facing errors for faster diagnosis.
  • Graph optimizer child-pipeline loading

    • Add a conservative timeout when executing optimizer-edited pipeline.py.
    • Convert timeouts into actionable validation errors that include captured stdout/stderr when available.
  • Async verification script

    • Set an explicit local git identity for the temporary seed repo commit so the verification script does not depend on global git config.
  • Focused coverage

    • Add targeted tests for daemon timeout messaging, startup locking, detached submission failure paths, optimizer child-pipeline timeouts, and the verification script’s git identity setup.
try:
    result = subprocess.run(
        [sys.executable, str(path)],
        capture_output=True,
        text=True,
        cwd=str(path.parent),
        timeout=CHILD_PIPELINE_LOAD_TIMEOUT_SECONDS,
    )
except subprocess.TimeoutExpired as exc:
    raise ValueError(
        f"pipeline script `{path}` timed out after "
        f"{CHILD_PIPELINE_LOAD_TIMEOUT_SECONDS:.1f}s."
    ) from exc

Copilot AI changed the title [WIP] Fix code issues based on review comments Harden detached-run daemon startup, submission failures, and optimizer child-pipeline loading May 23, 2026
Copilot AI requested a review from trackoor May 23, 2026 01:02
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.

3 participants