Record sidecar command ID in the event log - #562
Open
schurchleycci wants to merge 3 commits into
Open
Conversation
Event gains a command_id field populated on per-command pass/fail events. Recorder.SetCommandID stores the pending ID; record() attaches it to the next LevelDone or LevelError Status call and clears it, so each exec stamps exactly its own terminal event. Final events (run-wide summaries) are left unstamped. Legacy logs without the field read fine via Outcome(). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Threads *eventlog.Recorder through newExecFn, runValidate, and runSplitCommands. newExecFn calls rec.SetCommandID after each remote exec so the Recorder stamps the next pass/fail event with the ID. Also passes localWorkDir explicitly to newExecFn instead of using os.Getwd(), which has no git remote on the sidecar and caused the TestOpenAPIExecPassesEnvVars test to fail in CI. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ands Both functions already receive *eventlog.Recorder, which exposes Status as a method. Passing statusFn separately as rec.Status was redundant. All internal calls now use rec.Status directly. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
schurchleycci
force-pushed
the
fact-451-record-sidecar-command-id-in-event-log-v2
branch
from
September 4, 2026 20:37
ecaffb1 to
9e028cd
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
command_idtoEvent— populated on the per-command pass/fail event for commands that ran on a sidecar, linking to the command's output viaGET /api/v3/sidecar/commands/{id}/outputRecorder.SetCommandID(id)— called bynewExecFnafter each remote exec;record()attaches the pending ID to the nextLevelDone/LevelErrorStatus call and clears it, so each exec stamps exactly its own terminal event and never a run-wide summary*eventlog.RecorderthroughnewExecFn,runValidate, andrunSplitCommands; clears the workspace probe's ID afterWorkspaceExistsso it cannot leak onto a real command's eventstatusFnparameter fromrunValidateandrunSplitCommands— both already receive*eventlog.Recorder, which exposesStatusdirectlyTest plan
Final🤖 Generated with Claude Code