From eb195a0be92009fcab2bf90e9b23d0d8ccab76d2 Mon Sep 17 00:00:00 2001 From: Bryan Helmkamp Date: Mon, 2 Mar 2026 18:26:54 -0500 Subject: [PATCH] Skip envelope-colliding keys when merging flattened event fields WorkflowRunStarted and GitCheckpoint have a `run_id` field that collides with the envelope's top-level `run_id`. Filter out `timestamp`, `run_id`, and `event` from event fields to avoid duplicate keys in the JSONL output. Co-Authored-By: Claude Opus 4.6 (1M context) --- crates/arc-workflows/src/cli/run.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/crates/arc-workflows/src/cli/run.rs b/crates/arc-workflows/src/cli/run.rs index 65a889bb3..d50afc0d1 100644 --- a/crates/arc-workflows/src/cli/run.rs +++ b/crates/arc-workflows/src/cli/run.rs @@ -222,7 +222,11 @@ pub async fn run_command(args: RunArgs, styles: &'static Styles) -> anyhow::Resu "event".to_string(), serde_json::Value::String(event_name), ); - envelope.extend(event_fields); + for (k, v) in event_fields { + if k != "timestamp" && k != "run_id" && k != "event" { + envelope.insert(k, v); + } + } let envelope = serde_json::Value::Object(envelope); // Append to progress.jsonl if let Ok(line) = serde_json::to_string(&envelope) {