fix(manager): stamp event ids with the run identity readers validate - #72
Open
Huang-404-Q wants to merge 1 commit into
Open
Huang-404-Q wants to merge 1 commit into
Huang-404-Q wants to merge 1 commit into
Conversation
The dashboard/API validates every event id against the run id it derived
for the run: the reserved id under --runs-root, or log_dir.parent.name for
a pinned --log-dir. The worker instead stamped ids from the event log's
grandparent path component, which only matches for the default
<runs-root>/<run-id>/lh_harness layout.
With a custom --log-dir (e.g. /x/myrun), the worker stamped ids with an
unrelated path component ("myrun"), so the embedded dashboard rejected
every record with "event_id does not belong to the requested run" and the
event feed stayed empty for a perfectly healthy run. The standalone
snapshot fallback hit the same wall via its "local" default.
Thread the reader-facing id through HarnessConfig.run_id (set from the
CLI's reserved run id) and stamp ids with it; without a configured id the
legacy path-derived stamp remains. The cross-run identity guard keeps
rejecting foreign prefixes unchanged.
prax211
added a commit
to cogniziocompany/LongHorizon-Harness
that referenced
this pull request
Sep 6, 2026
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
prax211
added a commit
to cogniziocompany/LongHorizon-Harness
that referenced
this pull request
Sep 6, 2026
…deployed, doctor clean Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
prax211
added a commit
to cogniziocompany/LongHorizon-Harness
that referenced
this pull request
Sep 6, 2026
…ion and open question Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This branch has not been deployed
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.
What this fixes
With a custom
--log-dir(anything outside<runs-root>/<run-id>/lh_harness), the dashboard's event feed stays empty for a healthy run: every record is silently dropped withevent_id does not belong to the requested run.Why: the worker stamps event ids from the event log's grandparent path component (
manager.py_append_event):but the dashboard/API validates each id against the run id it derives — the reserved id under
--runs-root, orlog_dir.parent.namefor a pinned--log-dir. Those only coincide for the default layout. Concretely,lh-harness run --log-dir /x/myrun --dashboardstamps idsmyrun:000001…while the embedded dashboard reads with the reserved id20260828T000000Z_abcd1234— the strict identity guard (webapi/events.py) then rejects every record, so REST replay, WebSocket deltas, and the snapshot's last-200 events all come back empty. The standaloneweb --log-dirpath hits the same wall through its"local"fallback.The change
HarnessConfiggains an optionalrun_id— the reader-facing run identity._append_eventacceptsrun_event_idand prefers it over the path-derived stamp; every manager call site passesconfig.run_id.Tests
tests/test_event_run_id.py(3 tests):run_idoverrides the path-derived stamp;Red/green verified: the first and third fail on
main(empty feed for a pinned--log-dir), all pass with the fix. Full suite: 408 passed, 1 skipped; ruff clean on the touched files.