Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .agents/skills/verify/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ A failed scenario check stops the scenario. Each scenario line after it prints `
1. The isolated `config.yml` sets `tools.commands: false`, `startup.setupWizard: false`, `startup.checkUpdate: false`, and `marketplace.autoUpdate: "off"`. An interactive omp in a fresh home stops at the setup wizard unless `startup.setupWizard` is `false`.
2. It reads `omp --version`. omp 19.2.0 or later runs the checks below. An older omp runs the checks of "omp before 19.2.0".
3. It starts omp with the model `omp-smoke/talk-ui` in a pseudo-terminal of 240 columns and 50 rows (`Bun.spawn` with `terminal`, `TERM=xterm-256color`). The script writes key bytes and waits for screen text that shows after a mark. It takes the mark before it writes the key. It removes the ANSI codes, and it reads a carriage return or a cursor move as a line break. omp repaints by diff, so a search from an older mark could find a stale frame. Each wait fails after 30 s. The TUI omp is ready when its footer shows `omp smoke fake model`.
4. After the TUI omp is ready, it starts the peer as `omp --mode rpc` with the model `talk-peer`. When two omp processes started at the same time in the fresh state folder, the peer exited 1 in one run, so the script starts them one after the other. A prompt with the marker `SMOKE-LIST` or `SMOKE-CARD` makes the peer model call `talk` once, and the script reads the tool result from the next request. A prompt with the marker `SMOKE-HANDOVER`, which the script types in the TUI omp, makes the TUI model call `talk` with `action: "handover"` once, and the script reads the tool result from the request that follows the flow. The fake model answers the handover side turn of the TUI omp (the request whose new user text holds the handover template) with a two-line draft: the draft of the expected tool-started handover after its call went out, else the draft of `/talk handover`. It answers every other turn with `ok`.
4. Start the RPC peer after the TUI footer appears. Starting both processes together once caused the peer to exit 1 in a fresh state folder. The `SMOKE-LIST` and `SMOKE-CARD` prompts make the peer call `talk`. The `SMOKE-HANDOVER` prompt makes the TUI model call `talk` with `action: "handover"`. Its side turn receives the draft for that case. An operator-started handover receives the `/talk handover` draft instead. Other turns receive `ok`.

Expected output of the `talk-ui` mode with omp 19.2.0 or later, in order:

Expand Down Expand Up @@ -202,7 +202,7 @@ exit 0
| `ui-card` | Peer: `send` with `instance` set to the TUI instance id and a message of four lines (prompt `SMOKE-CARD`) | The result reads `Delivered:`. The TUI screen shows the card header ``talk message from `<name>` · `<peer folder>` · <HH:MM>``, where `<peer folder>` is the work folder of the run. It shows the first three lines and `… 1 more lines`, and not the fourth line. omp's default card does not draw `… 1 more lines`. |
| `ui-handover` | Type `/talk handover <full peer session id>`, then Enter. The side turn gives the draft. Type `edited ` at the start of the draft, then `ctrl+s`. | The review shows the draft, and then the edited first line. The confirm view names the peer instance id without the provenance of `ui-tool-handover` and shows `Kind: handover`, and the script types the code as in `ui-compose-send`. RPC `get_entries` of the peer then holds a talk entry with `details.kind` `handover` whose content holds the whole edited text. |
| `ui-tool-handover` | Type `SMOKE-HANDOVER: hand the work over to the peer.`, then Enter. The TUI model calls `talk` with `action: "handover"` and `instance` set to the peer instance id. The side turn gives the draft `talk-ui smoke agent draft: continue the tool check.` and `Agent risks: none.` at once. In the review, with the keys of omp's editor: `super+a` (select all, the kitty sequence `ESC [97;9u`), then a bracketed paste (`ESC [200~` … `ESC [201~`) of `talk-ui smoke pasted summary.` and `Pasted next step.`. Then, each in its own write after the check of the key before it: `ctrl+a`, `ctrl+k` (cut to the line end), the typed text `Typed: `, and `ctrl+y` (yank). Then `ctrl+s`, and the code as in `ui-compose-send`. | Before the review shows the draft, the screen shows the waiting line ``talk: agent handover to <peer instance id> (`<name>`) · ⎋ cancels``, even when the side turn ends at once. The review shows the pasted last line. omp repaints the whole edited row, so after each editing key a complete frame must show the last row, trimmed, as exactly: `Pasted next step.` after `ctrl+a`; only the caret `▏` after `ctrl+k`, so the cut removed the text; `Typed: ▏` after the typing, so the typed text stands alone; and `Typed: Pasted next step.▏` after `ctrl+y`, so the yank restored the cut text. Before the script types the code, the confirm line reads `Send to <peer instance id> (a handover that the agent started): type <code>`, and the confirm view shows `Kind: handover`; the confirm lines of the flows that the user started never show this provenance. RPC `get_entries` of the peer then holds exactly one talk entry that the answer before the step did not hold: `details.kind` is `handover`, and the content is the head line that starts with `**Handover from ` and ends with `: the sender asks this session to continue its work.`, the trust line, and exactly the edited text `talk-ui smoke pasted summary.` and `Typed: Pasted next step.`. It holds neither `talk: agent handover to` nor `a handover that the agent started`. An answer of the peer comes after the entry, so the wake started a turn. The tool result in the next request of the TUI model is the whole allowed text of its outcome and nothing else: `Handover: ` and the `Delivered:`, `Queued:`, or `Submitted:` text of `OUTCOME_TEXT` in `cli/talk/tool/tool.ts`, then `Message id: <id>` and ``Instance: <peer instance id> (`<peer name>`)``. The message id is the one of the peer entry, and the name is the one of the own row of the peer list. So no excerpt of the draft can hide in the result. The TUI turn then ends with `ok`, and no later output shows `talk: agent handover to`: omp draws a status notice of an extension only after the tool call ends, so talk names the agent only in its own views. |
| `ui-tool-handover-cancel` | Type the same prompt again. The TUI model calls `handover` with `to` set to the full peer session id; the side turn gives the draft `talk-ui smoke draft that escape cancels.` and `Cancel risks: none.`. Then `escape` in the review. When the TUI turn has ended and the late-notice check has passed, the TUI omp composes `talk-ui smoke: sentinel after the cancelled handover` to the peer as in `ui-compose-send`. | The waiting line shows before the review, as in `ui-tool-handover`, and the review shows the draft. The tool result is exactly `talk: the handover was cancelled. Nothing was sent.`. The TUI turn ends with `ok`, and for 0.5 s after it no output shows `talk: agent handover to`. The sentinel arrives. The `get_entries` answer that holds it continues the answer before the step, as in the `talk` mode: every earlier entry is there with the same `parentId`, and the parent chain from the leaf holds the sentinel and the earlier leaf. The sentinel is its only new talk entry, and no entry holds a line of the draft. |
| `ui-tool-handover-cancel` | Repeat `SMOKE-HANDOVER` with `to` set to the peer's full session ID. Cancel one review with bare Escape. In another review, write encoded Escape (`ESC [27u`) and `z` together. In the last review, prepend Ctrl+S to that write. After **each encoded case**, type and submit that case's fresh focus-probe prompt in the restored composer. Finally compose `talk-ui smoke: sentinel after the cancelled handover` to the peer. | Each waiting line precedes its draft. Each call returns exactly `talk: the handover was cancelled. Nothing was sent.` Each turn ends with `ok` and shows no late handover notice for 500 ms. Inspect the prompt the fixture model received: only the open-review probe starts with `z`. The peer history continues with only the sentinel as a new talk entry. No draft arrives. |
| `extensions-loaded`, `isolated`, `real-state` | The whole run; the warnings include the screen text of the TUI omp and the standard error of the peer | As in the `hooks` mode |
| `sessions` | Both omp processes | The TUI omp exits 0 after `ctrl+d`. The peer exits 0 after its stdin ends. |
| `registry` | The TUI omp and the peer, after the peer starts and before the `ui-ready` list; the final scan of the TUI omp before `ctrl+d`, and of the peer after the TUI omp exits | As in the `talk` mode, for the TUI omp and the peer |
Expand Down
78 changes: 63 additions & 15 deletions .agents/skills/verify/scripts/omp-smoke.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2940,6 +2940,8 @@ const OLD_OMP_CHECKS = [
type UiCheck = (typeof UI_CHECKS)[number] | (typeof OLD_OMP_CHECKS)[number];

const ESC = "\u001b";
/** A complete Escape press. A trailing bare ESC waits for the terminal decoder's timeout. */
const ENCODED_ESCAPE_KEY = `${ESC}[27u`;
/** The final characters of the cursor moves CUP, HVP, CUD, CNL, CPL, CHA, and VPA. */
const CURSOR_MOVE_FINALS = "HfBEFGd";
/** The second characters of the ESC sequences that run to a string terminator: DCS, SOS, PM, APC, and OSC. */
Expand Down Expand Up @@ -3708,19 +3710,64 @@ async function talkUiMode(): Promise<{ lines: string[]; registry: string | null
// its answer must continue the answer before the step, and it must be the only new talk entry.
step = "ui-tool-handover-cancel";
const kept = checkedEntries(await rpc.send({ type: "get_entries" }));
const cancelled = await startAgentHandover(
{ action: "handover", to: sessionId },
TOOL_CANCEL_DRAFT,
peerInstance,
);
const escaped = screen.mark();
screen.write(ESC);
const cancelResult = await cancelled.result;
if (cancelResult.trim() !== HANDOVER_CANCELLED_TEXT)
failStep(
`the handover result after escape is not ${JSON.stringify(HANDOVER_CANCELLED_TEXT)}: ${JSON.stringify(cancelResult)}`,
// A plain cancellation closes the review synchronously. A settled review keeps focus through this input batch.
const focusKey = "z";
const cancellations = [
{ keys: ESC, draft: TOOL_CANCEL_DRAFT, label: "Escape", composerPrefix: undefined },
{
keys: ENCODED_ESCAPE_KEY + focusKey,
draft: "talk-ui smoke draft cancelled from an open review.",
label: "encoded Escape in the open review",
composerPrefix: focusKey,
},
{
keys: CTRL_S_KEY + ENCODED_ESCAPE_KEY + focusKey,
draft: "talk-ui smoke draft cancelled during the focus change.",
label: "buffered Ctrl+S and Escape",
composerPrefix: "",
},
];
for (const { keys, draft, label, composerPrefix } of cancellations) {
const cancelled = await startAgentHandover(
{ action: "handover", to: sessionId },
draft,
peerInstance,
);
await expectNoLateNotice(escaped);
const escaped = screen.mark();
screen.write(keys);
const cancelResult = await cancelled.result;
if (cancelResult.trim() !== HANDOVER_CANCELLED_TEXT)
failStep(
`the handover result after ${label} is not ${JSON.stringify(HANDOVER_CANCELLED_TEXT)}: ${JSON.stringify(cancelResult)}`,
);
await expectNoLateNotice(escaped);
if (composerPrefix !== undefined) {
// Ask the fixture provider what the restored composer actually submitted, not what a redraw echoed.
const focusProbe = `Smoke focus check after ${label}.`;
const typed = screen.mark();
screen.write(focusProbe);
await screen.waitFor(focusProbe, typed, "typed focus probe");
const from = run.requests.length;
const submitted = screen.mark();
screen.write(ENTER_KEY);
let actual: string | undefined;
await waitFor(`submitted focus probe after ${label}`, async () => {
for (let i = from; i < run.requests.length; i++) {
const request = run.requests[i];
if (request?.["model"] !== UI_MODEL_ID) continue;
const line = newUserText(request)?.split("\n").find((part) => part.endsWith(focusProbe));
if (line !== undefined) {
actual = line;
return true;
}
}
return false;
});
await screen.waitFor(/\bok\b/, submitted, "answer to the focus probe");
if (actual !== composerPrefix + focusProbe)
failStep(`the composer did not submit the expected focus probe after ${label}`);
}
}
await composeToPeer(peerInstance, CANCEL_SENTINEL_TEXT);
await peerTalkEntry(
"talk entry with the sentinel",
Expand All @@ -3738,9 +3785,10 @@ async function talkUiMode(): Promise<{ lines: string[]; registry: string | null
`the peer session holds the new talk entries ${added.map((entry) => String(entry["id"])).join(", ")}, expected only the sentinel`,
);
expectContinues(kept, later, talkMessageId(sentinel) ?? "");
for (const line of TOOL_CANCEL_DRAFT.split("\n"))
if (mentionsMessage(later.entries, undefined, line))
failStep(`the peer session holds the draft line ${JSON.stringify(line)}`);
for (const { draft } of cancellations)
for (const line of draft.split("\n"))
if (mentionsMessage(later.entries, undefined, line))
failStep(`the peer session holds the draft line ${JSON.stringify(line)}`);
pass();
};

Expand Down
Loading
Loading