async def test_run_interactively_whitespace_and_exit(
    tmp_path: Path, monkeypatch: pytest.MonkeyPatch
) -> None:
  """run_interactively should skip blank input, echo once, then exit."""
  # make a session that belongs to dummy agent
  svc = cli.InMemorySessionService()
  sess = await svc.create_session(app_name="dummy", user_id="u")
  artifact_service = cli.InMemoryArtifactService()
  root_agent = types.SimpleNamespace(name="root")

  # fake user input: blank -> 'hello' -> 'exit'
  answers = iter(["  ", "hello", "exit"])
  monkeypatch.setattr("builtins.input", lambda *_a, **_k: next(answers))

  # capture assisted echo
  echoed: list[str] = []
  monkeypatch.setattr(click, "echo", lambda msg: echoed.append(msg))

  await cli.run_interactively(root_agent, artifact_service, sess, svc)

  # verify: assistant echoed once with 'echo:hello'
  assert any("echo:hello" in m for m in echoed)
run_interactively should skip blank input, echo once, then exit.
tests/unittests/cli/utils/test_cli.py