Repository navigation
fix(hosts): the handoff report can adopt an earlier live run and name its run_id (#1101) - #1105
Conversation
|
Label state declaration (Lead), before the write:
|
The mtime/size snapshot cannot tell a live earlier run apart from this launch's new one: runstore rewrites a running run's status.json every round, so a reused store's older run looked fresh and the report carried its run_id. Take the launch epoch with the snapshot and accept a changed file only when its started is numeric and no older than that epoch; a file absent from the snapshot still counts, so a fresh or caller-owned run dir is unchanged.
|
Review request — one ask, at Head equals the sha above; base Checks at this tip: Tier: Out of scope for this PR, so a round need not be spent on them: the two-wrapper |
Birfy
left a comment
There was a problem hiding this comment.
Review (Birfy)
Tip SHA: 021d2e0
Ran:
- AGENTDESCENT_LONG_RUN_SMOKE=1 pytest -q tests/test_dsh_superagent_run.py at this tip → 6 passed
- The new live_earlier test copied onto unmodified main f5cc52e (wrapper unchanged) → 1 failed,
found: Truefor the ticking earlier run where the page promisesfound: false, matching the claimed red - After #1110 landed on main (3a526ae), this patch still applies cleanly; the combined wrapper (argv handoff + launch-epoch filter) has 8 passed under the same flag
- bash -n scripts/dsh-superagent-run.sh → clean
- python -m tools.changelog_fragments check → pass
- .github/scripts/risk_gate.py --pr 1105 → T2
- CI at this tip → required checks green (build, test 3.9–3.13); deploy skipped; risk tier report-only SUCCESS; reviewed tip (report only) cancelled, not a required check
Not run: - mkdocs build --strict — docs/dsh-super-agent.md changed; the CI
buildjob is green at this tip - Full offline suite locally — the CI test matrix is the line
- Ark real-model run — no model path changed
Findings: - none
Verdict: PASS
|
Review (Birfy) Tip SHA: 021d2e0
|
Fixes #1101
What changed
Before: a handoff into a reused store reported an earlier run that was still
going.
scripts/dsh-superagent-run.shsnapshotted eachstatus.jsonbymtime+size, and runstore rewrites a running run's file every round
(
runstore.py:445-455), so the earlier file moved in the window exactly likethis launch's new one. The report then carried the earlier
run_id,roundandrun_dir, and the page's §6 read-back polled a run this handoff did not start.Measured at base
f5cc52ef: row B (old-runlive, this launch writesnew-runat +1.2 s) →found=True run_id='old-run' round=3; row B with a childthat writes nothing →
found=True run_id='old-run'where the page promisesfound: false.After: the snapshot carries the launch epoch (
time.time()at snapshot time),and the poll accepts a changed file only when its
startedis numeric and noolder than that epoch. A file absent from the snapshot still counts, so a fresh
run directory and a caller-owned run directory behave as before. At the tip the
same rows give: A
new-run, Bnew-run, B-silentfound=False, Cnew-run.scripts/dsh-superagent-run.sh— one field in the snapshot JSON, onecomparison (plus a four-line
started_atreader) in the poll. No new flag, noextra wait: the poll still runs under the same
WAITdeadline.docs/dsh-super-agent.md:165-172— the reused-store paragraph now says thewrapper reports a file that appears after the launch or changes with a
startedno older than it, and that a file whosestartedpredates the launchis never reported.
tests/test_dsh_superagent_run.py— one gated row after the reused-store row:an earlier live run rewriting its
status.jsonevery 200 ms, a child thatwrites nothing (report
found: false) and a child that writesnew-runat+1.2 s (report names
new-run, and the read-back follows it).changelog.d/1101-handoff-run-epoch.md— oneFixedfragment.Non-goals, per the issue: the two-wrapper
waiting.jsonhandshake, #1096's exitcode and
waitingstate, the session-name scheme, and a--run-idflag.Verification at the tip
Tip SHA: 021d2e0
Branch
agent/1101-handoff-run-epochcarries one commit on basef5cc52efe41750633ac37876fc2d2894a8a6f9f3, rebased from the earlier09492927base; the patch is byte-identical to the pre-rebase one(
git diff 09492927 989b3e76 | sha256sum=git diff f5cc52ef 021d2e09 | sha256sum=21867cea…), and no file this PR touches moved on main.Red at base
f5cc52ef(clean tree, only the new test row added):AGENTDESCENT_LONG_RUN_SMOKE=1 pytest -q tests/test_dsh_superagent_run.py -k live_earlier→1 failed, 5 deselected,assert report["found"] is FalsewithAssertionError: {'command': 'sleep 1', 'driver': 'tmux', 'found': True, …}/assert True is False. The same shape's report at that base namesrun_id='old-run' round=3 run_dir='old-run', for both the ticking earlier runand the silent-child row.
Ran, at this tip:
pytest -q tests/test_dsh_superagent_run.pywithAGENTDESCENT_LONG_RUN_SMOKE=1→ 6 passedpytest -q tests/test_dsh_superagent_run.pywithout the flag → 2 passed,4 skipped (the gated group, as CI runs it)
new-runboth, Bnew-runatthe tip and
old-run round=3at base, B-silentfound=Falseat the tip andold-run round=3at basepytest -q -n 8(full offline suite) → 7492 passed, 59 skipped, 20failed in 616.88s; the 20 are the host-only legs this box cannot run (no
Docker daemon: 12
test_sandbox_container; host toolchains: 6test_era_srbench, 2test_genesis_example), the same three modules thatare red here on
main, and none in a file this PR touchespytest -q tests/test_docs_links.py tests/test_site_navigation.py tests/test_repo_hygiene.py→ 26 passedpython -m tools.gen_api_docs --check→docs/api.md is up to datepython -m tools.changelog_fragments check→47 changelog fragment(s) OKbash -n scripts/dsh-superagent-run.sh→ clean; the only remaining sleep inthe wrapper is the existing
time.sleep(0.2)poll tick, under the sameWAITdeadlineNot run:
mkdocs build --strict— mkdocs is not installed in this clone's venv;CI's
buildjob is the lineSize: 4 files,
+122/−6against basef5cc52ef. T2 by.github/agent/risk-rules.json(scripts/**is a T2 path).Claim-Id: #1101