You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(cli): accept latest/last as a run id on show, watch, diagnose and friends - #893
status, watch, show, apply, cancel, resume and diagnose now take latest (or last, any case) in place of a run id and resolve it to the newest run in the store, so agentdescent demo && agentdescent show latest works without copying the timestamped id.
A real run directory literally named latest/last still wins.
An empty store raises a clear no runs under … yet error (also via --json), instead of no run 'latest'.
Resolution happens in cli.main only; runstore.py is untouched.
show/watch/diagnose help mentions latest.
Tests: tests/test_latest_run_alias.py (newest wins, real dir wins, empty store, other ids untouched); -k "cli or help or docs or json" suite passes locally.
Tip SHA: 2c51e76
Ran: tests/test_latest_run_alias.py (4 passed); -k "cli or help or json or runstore" plus tests/test_docs_links.py on the tip — all pass except tests/test_plugin_host_cli.py::test_present_host_passes, which fails identically on main in this environment (a gateway key ARK_API_KEY is set on the review box), so unrelated. risk_gate.py → T2 (83 lines / 3 files).
Not run: full suite; CI matrix 3.9–3.13 still in progress at review time.
Correctness
_resolve_latest_run is gated to the seven run-id commands by fn identity, so no other run_id-shaped argument (e.g. on bench/algorithms) is rewritten. Good.
runstore.list_runs returns newest first via reverse-sorted dir names, and run ids are timestamp-prefixed, so runs[0] is the newest. Unreadable/status-less dirs are skipped there too, so latest can't land on a half-created dir.
Resolution sits inside the try, after parsing and after json_errors is reset, which is the right place.
Design fit: keeping it in cli.main and leaving runstore untouched keeps the MCP/library API exact-id only, which is the safer default. Case-insensitive match is fine since generated ids are never those words.
Tests/docs: cover newest-wins, real-dir-wins, empty store, and untouched other ids; help text updated on show/watch/diagnose; changelog fragment present.
Nits (non-blocking): status/apply/cancel/resume help could mention latest too for discoverability; with a default store and a run being created concurrently, latest is naturally racy, which is acceptable for an interactive alias.
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
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.
Closes #892
status,watch,show,apply,cancel,resumeanddiagnosenow takelatest(orlast, any case) in place of a run id and resolve it to the newest run in the store, soagentdescent demo && agentdescent show latestworks without copying the timestamped id.latest/laststill wins.no runs under … yeterror (also via--json), instead ofno run 'latest'.cli.mainonly;runstore.pyis untouched.show/watch/diagnosehelp mentionslatest.Tests:
tests/test_latest_run_alias.py(newest wins, real dir wins, empty store, other ids untouched);-k "cli or help or docs or json"suite passes locally.