# What should a multi-model coding orchestrator log when a workflow fails?

> A practical logging design for reconstructing routing decisions, model and tool failures, known costs, cancellation uncertainty, and repository state.

Canonical URL: https://www.devobs.io/articles/what-should-a-multi-model-coding-orchestrator-log-when-a-workflow-fails/
By: Maya Chen
Published: 2026-10-31T10:30:25.097Z
Updated: 2026-10-31T10:30:25.097Z
Section: Architecture

Log a correlated execution trace that explains which workflow was selected, what each model and tool invocation did, where execution stopped, what usage and cost are known, and whether repository changes were applied. Finish with a workflow-level summary that makes missing evidence explicit. Do not rely on a final exception message alone.

GitHub’s September 4, 2026 report presents HydraFusion as a research preview and says its runtime records each workflow leg’s **role, outcome, cost, latency, and diagnostics**. The report describes three execution patterns: a single solver, a cascade with possible escalation, and a draft–critique–revision workflow. These provide useful examples of the execution paths a failure trace should distinguish. [GitHub’s HydraFusion report](https://github.blog/ai-and-ml/github-copilot/project-hydrafusion-frontier-quality-via-multi-model-orchestration/)

The fields below are a proposed design for an orchestrator you control—not claims about HydraFusion’s implementation or user-accessible telemetry.

## Correlate the run, its legs, and individual attempts

Use structured events with identifiers that let an investigator move from a failed workflow to a particular invocation.

| Scope | Recommended fields | Purpose |
| --- | --- | --- |
| Workflow | `workflow_run_id`, `trace_id` | Join events belonging to one execution |
| Logical leg | `leg_id`, `parent_leg_id`, `role` | Reconstruct drafting, review, revision, and escalation relationships |
| Invocation attempt | `invocation_id`, `attempt`, `retry_of_invocation_id` | Distinguish retries from separate workflow stages |
| Event | `event_type`, `timestamp`, coordinator-assigned sequence, `schema_version` | Interpret events and reconstruct the coordinator’s observed order |

Record the repository base revision, opaque workspace identifier, and orchestration configuration version in the run-start record. Reference that context from subsequent events rather than duplicating it everywhere.

Give each invocation attempt a unique identifier and its own start and outcome records. Preserve parent and retry links instead of inferring causal relationships from timestamps alone. Treat the coordinator’s sequence as its observation order, not proof of causal order across workers. A retry should not overwrite the failure that triggered it.

## Record routing decisions before model execution

A useful trace should explain why the selected execution path existed before explaining why it failed.

Record:

- The selected workflow pattern and routing-policy version.
- The workflow-definition version and selected model bindings.
- The configured fallback path.
- Preflight validation results, including unavailable models or invalid bindings.
- A bounded decision code, such as `initial_route` or `gate_escalation`, rather than a free-form model rationale.

GitHub identifies validation of workflow definitions, model bindings, fallback behavior, and model availability before execution as a HydraFusion operating principle. For the proposed design, log those checks separately from failures after execution begins. [GitHub’s validated-routing principle](https://github.blog/ai-and-ml/github-copilot/project-hydrafusion-frontier-quality-via-multi-model-orchestration/)

For every model invocation attempt, capture the provider, requested model identifier, resolved model or version when exposed, provider request identifier when available, start and end times, elapsed time, outcome, and diagnostic references. Keep a requested alias separate from a resolved version. If the provider does not expose a version, record it as unknown rather than inferring it from the alias.

## Separate execution outcomes from acceptance decisions

Do not flatten every unsuccessful event into `model_failed`. Use a structured outcome record containing the originating stage, execution status, error category when applicable, sanitized message, diagnostic reference, and retry or fallback decision.

Recommended error or termination categories include:

- Provider or transport error.
- Tool execution failure.
- Permission denial.
- Validation rejection.
- Deadline exceeded.
- Cancellation.
- Orchestration configuration error.

Keep execution status separate from acceptance status. A validator that executes successfully and rejects a candidate should have a different record from a validator that crashes. Likewise, preserve an escalation decision as a routing event rather than automatically classifying it as an infrastructure error.

For gates and tools, record identity and version where available, invocation identifier, execution outcome, and a bounded diagnostic-artifact reference. Add acceptance decisions for gates, exit status for test processes, and permission outcomes where applicable. Capture the configured workspace access mode and tool restrictions for review legs.

GitHub describes HydraFusion’s review steps as running in isolated, tool-less contexts, while solver steps use a shared workspace and a permission-aware agent loop. That distinction is a useful reason to make execution context explicit in the proposed trace. [GitHub’s isolated-review principle](https://github.blog/ai-and-ml/github-copilot/project-hydrafusion-frontier-quality-via-multi-model-orchestration/)

Preserve the first observed failure, but do not automatically label it the root cause. Reserve a separate root-cause field for a conclusion established through investigation.

## Treat cancellation as a sequence, not a boolean

Record workflow and leg deadlines, configured execution limits, timeout events, cancellation-request time, requester, acknowledgement, and the last confirmed invocation state.

Represent these as distinct observations:

- Cancellation requested.
- Cancellation acknowledged by the receiving component.
- Invocation observed to have stopped.
- Invocation outcome still unknown.

At coordinator termination, list invocations without a confirmed outcome. Record which component supplied each acknowledgement or stop observation; do not treat an acknowledgement from an intermediary as confirmation that downstream execution stopped.

GitHub calls for explicit timeout and cancellation behavior on every HydraFusion leg. The recommendation here is to preserve evidence of those boundaries rather than interpreting a cancellation request as proof that all work ended. [GitHub’s bounded-execution principle](https://github.blog/ai-and-ml/github-copilot/project-hydrafusion-frontier-quality-via-multi-model-orchestration/)

Record whether another attempt was allowed and which retry or fallback followed. Distinguish “the configured limit was reached” from “execution was confirmed stopped” and “the coordinator lost visibility.”

## Account for unsuccessful work without inventing totals

Retain usage and cost records for every invoked attempt, including failed drafts, critics, revisions, escalations, retries, and fallbacks. GitHub names accounting across every workflow leg as a HydraFusion operating principle. [GitHub’s complete-accounting principle](https://github.blog/ai-and-ml/github-copilot/project-hydrafusion-frontier-quality-via-multi-model-orchestration/)

For each attempt, record available token categories, provider and model identifiers, currency, pricing basis, and whether the cost is estimated or reconciled. Preserve the provenance of usage measurements and link subsequent accounting updates to the original invocation. Keep totals separated by currency unless an explicit conversion basis is recorded.

**Unknown usage is not zero usage.** If an invocation has no final usage record, leave the amount unknown and mark the workflow total incomplete. Keep the sum of accounted costs separate from any fully reconciled total, and preserve the distinction between estimated and reconciled amounts.

Also keep workflow wall-clock duration separate from the sum of leg durations. Do not label summed invocation time as workflow elapsed time, especially in a design that permits overlapping work.

## Log patch disposition separately from workspace state

The repository-safety record should answer two questions: was the candidate patch applied, and what workspace state was actually observed afterward?

Recommended fields include:

- Candidate patch identifier or digest, when a candidate exists.
- Validation outcome and associated diagnostic reference.
- Whether application was attempted.
- Application status: `not_attempted`, `applied`, `failed`, or `unknown`.
- Post-failure workspace observation and the time of that observation.
- Any unresolved application or workspace state.

GitHub states that HydraFusion applies no patch when a workflow is cancelled or fails validation. The same report says solver steps use a shared workspace. Do not interpret the patch-application rule as a guarantee that every tool side effect is rolled back. [GitHub’s fail-safe application and shared-workspace design](https://github.blog/ai-and-ml/github-copilot/project-hydrafusion-frontier-quality-via-multi-model-orchestration/)

In the proposed design, `patch_application: not_attempted` and `workspace_state: unknown` are valid together. Likewise, a failed application should not be recorded as an unchanged workspace without a supporting observation. Record what was checked, against which base revision, and when.

## Emit a terminal summary with explicit completeness

Make the workflow summary the first record an operator reads. Include:

- Coordinator termination status and terminating stage.
- Failed and unresolved legs or invocations.
- First observed failure and last confirmed stage.
- Total elapsed time.
- Accounted usage and cost, with accounting completeness.
- Patch disposition and observed workspace state.
- Trace and diagnostic references.
- Trace completeness and missing evidence.

Define trace completeness against expected records—for example, whether every started invocation has an observed outcome. Keep that separate from accounting completeness: allow a trace to record all execution outcomes while still marking usage as unresolved.

Do not interpret a missing terminal event as success. If the runtime cannot emit a summary, use a supervisor or reconciliation process to report the incomplete run. Label that report as an external observation rather than fabricating a normal workflow completion. Preserve outstanding invocation states even after the coordinator has terminated.

## Keep routine logs focused on metadata

For this design, exclude credentials, authorization headers, raw prompts, source code, intermediate drafts, and hidden model reasoning from routine logs by default. Use sanitized diagnostics and structured decision codes instead.

When additional diagnostic content is necessary, sanitize it before storage, place it in an access-controlled, retention-limited artifact, and log an opaque reference. Restricted artifact storage should not become an exception for retaining credentials. Apply sanitization to error messages and tool output as well; do not make the diagnostic field an unrestricted payload dump.

The final acceptance test is practical: can an operator identify the selected route, locate the failed or unresolved invocation, understand the recovery decision, see the limits of the cost total, and determine what is known about repository changes? If an answer is missing, the summary should say **unknown** and identify the evidence gap—not silently imply success, zero cost, or an untouched workspace.

## Source references

- <https://github.blog/ai-and-ml/github-copilot/project-hydrafusion-frontier-quality-via-multi-model-orchestration/>
