Skip to content

fix(cli): resolve latest/last on MCP show/status/apply/diagnose/cancel/resume - #897

Merged
Birfy merged 1 commit into
mainfrom
fix/896-mcp-latest-run-alias
Nov 8, 2026
Merged

Birfy merged 1 commit into
mainfrom
fix/896-mcp-latest-run-alias

Conversation

@Birfy

@Birfy Birfy commented Nov 8, 2026

Copy link
Copy Markdown
Collaborator

Closes #896

#892 taught the CLI to accept latest/last, but show_payload / status_payload / apply_payload and the MCP tools that call them (or runstore directly) still looked up a directory named latest. A host asked to "show the latest run" got no run 'latest'.

  • agentdescent/cli.py: extract resolve_run_id and use it from the payload helpers (and the CLI wrapper).
  • agentdescent/diagnose.py: report the resolved run id after show_payload.
  • agentdescent/mcp.py: resolve on cancel/resume; document latest/last on the tool descriptions.
  • tests/test_latest_run_alias.py: payload + MCP coverage, including the empty-store wording.
  • changelog.d/896-mcp-latest-run-alias.md.

Tests: pytest tests/test_latest_run_alias.py tests/test_changelog_fragments.py tests/test_mcp.py tests/test_diagnose.py pass locally.

…l/resume

Closes #896

#892 taught the CLI to accept latest/last, but show_payload/status_payload/
apply_payload and the MCP tools called them (or runstore) directly, so a
host asking to show the newest run still got "no run 'latest'". Resolve
the alias in the shared helper so CLI, payloads and MCP tools match.
@Birfy

Birfy commented Nov 8, 2026

Copy link
Copy Markdown
Collaborator Author

Verdict: PASS
Tip SHA: 0872b4c

Ran: pytest -q tests/test_latest_run_alias.py tests/test_changelog_fragments.py tests/test_mcp.py tests/test_diagnose.py at the tip → passed. risk_gate.py from main → T2 (118 changed lines / 5 files).
Not run: full suite (CI covers 3.9–3.13).

Correctness. #892 swapped latest/last only in CLI main() before the command ran. show_payload / status_payload / apply_payload (and MCP Tools.show/status/apply/diagnose, which call them) still looked up a directory named latest; MCP cancel/resume hit runstore the same way. resolve_run_id is now the shared helper: a real directory named latest still wins, an empty store keeps the #892 wording, and diagnose_payload reports the resolved id from show_payload. Tool descriptions mention the alias so hosts know they can pass it.

Tests / docs. Extended tests/test_latest_run_alias.py for payload helpers and MCP tools (including empty-store errors). Changelog fragment 896-mcp-latest-run-alias.md.

Risk. T2 (package code: cli.py, mcp.py, diagnose.py + tests + changelog). AGENT_PAUSE=false; will squash-merge when required CI is green.

@Birfy
Birfy enabled auto-merge (squash) November 8, 2026 20:12
@Birfy
Birfy merged commit 01ca6ec into main Nov 8, 2026
9 checks passed
@Birfy
Birfy deleted the fix/896-mcp-latest-run-alias branch November 8, 2026 20:38
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.

MCP show/status/apply/diagnose/cancel/resume: latest/last is not resolved (CLI-only leftover from #892)

1 participant