swarm: /clear starts an agent's next turn on a fresh session
This commit is contained in:
parent
7b62f2c22a
commit
fb9d4b5040
1 changed files with 155 additions and 22 deletions
|
|
@ -4,6 +4,7 @@ import assert from "node:assert/strict";
|
|||
import { test } from "node:test";
|
||||
import {
|
||||
completion,
|
||||
controlRoute,
|
||||
enterSends,
|
||||
matchCommands,
|
||||
menuQuery,
|
||||
|
|
@ -98,3 +99,17 @@ test("Enter sends once the selected command is already typed in full", () => {
|
|||
assert.equal(enterSends("/comp", cmd("compact")), false);
|
||||
assert.equal(enterSends("/", cmd("compact")), false);
|
||||
});
|
||||
|
||||
test("exactly /clear, with the backend's command of that name, is a new session", () => {
|
||||
const list = [cmd("compact"), cmd("clear")];
|
||||
assert.equal(controlRoute("/clear", list), "new-session");
|
||||
assert.equal(controlRoute("/clear ", list), "new-session");
|
||||
assert.equal(controlRoute("/clear it", list), null);
|
||||
assert.equal(controlRoute("/compact", list), null);
|
||||
assert.equal(controlRoute("clear", list), null);
|
||||
});
|
||||
|
||||
test("without the backend's /clear command, or with a skill of that name, it is text", () => {
|
||||
assert.equal(controlRoute("/clear", []), null);
|
||||
assert.equal(controlRoute("/clear", [cmd("clear", "skill")]), null);
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue