myclaude -r: unify resume picker with xiaohe client sessions

Bare -r/--resume now opens a numbered picker merging jsonl (source of
truth) with the xiaohe hosted-session index, deduped by cli_session_id
and sorted by real content activity (not jsonl mtime, which the xiaohe
projection re-touches). -l gains a Src column (xiaohe/cli); -r <id> and
-c stay passthrough. Adds read-only xiaohe_sessions data layer + tests.
This commit is contained in:
Zhengshou Lai
2026-08-15 13:42:53 +08:00
parent d6a0f455b0
commit 88170bdf57
5 changed files with 634 additions and 2 deletions
+17 -1
View File
@@ -37,6 +37,22 @@ class TestMyclaudeEntrypoint:
assert "myclaude" in result.output
def test_passthrough(self, tmp_path: Path) -> None:
"""``--resume <id>`` still passes through to the native CLI."""
runner = CliRunner()
with (
patch("myagents.launcher.shutil.which", return_value="/usr/bin/claude"),
patch("myagents.launcher.subprocess.run") as mock_run,
):
mock_run.return_value = MagicMock(returncode=0)
result = runner.invoke(
claude_cli, ["--cwd", str(tmp_path), "--resume", "abc123"]
)
assert result.exit_code == 0
args = mock_run.call_args[0][0]
assert args[-2:] == ["--resume", "abc123"]
def test_bare_resume_opens_picker(self, tmp_path: Path) -> None:
"""Bare ``--resume`` opens the unified picker instead of the CLI."""
runner = CliRunner()
with (
patch("myagents.launcher.shutil.which", return_value="/usr/bin/claude"),
@@ -45,7 +61,7 @@ class TestMyclaudeEntrypoint:
mock_run.return_value = MagicMock(returncode=0)
result = runner.invoke(claude_cli, ["--cwd", str(tmp_path), "--resume"])
assert result.exit_code == 0
assert "--resume" in mock_run.call_args[0][0]
mock_run.assert_not_called()
class TestMykimiEntrypoint: