Skip to content

Record sidecar command ID in the event log - #562

Open
schurchleycci wants to merge 3 commits into
mainfrom
fact-451-record-sidecar-command-id-in-event-log-v2
Open

Record sidecar command ID in the event log#562
schurchleycci wants to merge 3 commits into
mainfrom
fact-451-record-sidecar-command-id-in-event-log-v2

Conversation

@schurchleycci

@schurchleycci schurchleycci commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds command_id to Event — populated on the per-command pass/fail event for commands that ran on a sidecar, linking to the command's output via GET /api/v3/sidecar/commands/{id}/output
  • Adds Recorder.SetCommandID(id) — called by newExecFn after each remote exec; record() attaches the pending ID to the next LevelDone/LevelError Status call and clears it, so each exec stamps exactly its own terminal event and never a run-wide summary
  • Threads *eventlog.Recorder through newExecFn, runValidate, and runSplitCommands; clears the workspace probe's ID after WorkspaceExists so it cannot leak onto a real command's event
  • Removes the redundant statusFn parameter from runValidate and runSplitCommands — both already receive *eventlog.Recorder, which exposes Status directly

Test plan

  • New eventlog tests: ID stamps the right event, ID consumed once, ID not placed on Final
  • Full test suite green

🤖 Generated with Claude Code

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>
@linear-code

linear-code Bot commented Sep 4, 2026

Copy link
Copy Markdown

FACT-451

schurchleycci and others added 2 commits September 4, 2026 16:37
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
schurchleycci force-pushed the fact-451-record-sidecar-command-id-in-event-log-v2 branch from ecaffb1 to 9e028cd Compare September 4, 2026 20:37
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.

1 participant