core/cli: multiline \"\"\" input and /edit via EDITOR

Add triple-quote block messages in the REPL and /edit to compose a turn
in $EDITOR (temp file). Empty multiline or empty edit cancels.
This commit is contained in:
2026-07-15 13:29:00 +08:00
parent 3a0d9ac3cc
commit ec5e6ab0f4
9 changed files with 344 additions and 32 deletions
+14
View File
@@ -134,6 +134,20 @@ async def test_quit(state: ReplState) -> None:
assert await handle_slash(state, "/quit") is False
async def test_edit_sets_pending(
state: ReplState,
monkeypatch: pytest.MonkeyPatch,
capsys: pytest.CaptureFixture[str],
) -> None:
monkeypatch.setattr(
"plyngent.cli.editor.edit_text_in_editor",
lambda *a, **k: "composed message",
)
assert await handle_slash(state, "/edit") is True
assert state.pending_user_text == "composed message"
assert "characters ready" in capsys.readouterr().out
async def test_new_and_sessions(state: ReplState, capsys: pytest.CaptureFixture[str]) -> None:
first = state.session_id
assert await handle_slash(state, "/new other") is True