Official

chat

Built-in chat UI (JavaScript UI plugin).

The app opens the listing; nothing installs until an agent in your Plugins workspace has read the files and you enable the plugin. In a terminal: dvg install convergence/chat@0.2.3

Permissions in 0.2.3

  • Control chats chats.controlHighCreates chats, sends prompts and cancels runs.Send prompts, answer agent questions, and create, change, fork, revert, stop and group chats
  • Run other plugins' commands commands.runHighRuns commands of other plugins.Run the sidebar's New chat command from the title bar
  • Read chats chats.readMediumReads your transcripts and chat lists.Show workspaces, tasks, chats and transcripts, and follow them as agents work
  • Read files fs.readMediumReads files in the listed places.Suggest workspace files for @ mentionsPlaces: the open workspace
  • Show panels ui.slotsAlways grantedShows views in the listed parts of the window.Draw the chat grid, the title bar, and the Session panel with its rail buttonSlots: centertitlerailright

Files

options.test.ts6.8 KB
// A chat's settings belong to its agent: switching agents never leaves the
// last agent's model in the picker, even when the new one's fail to load,
// and a draft whose agent is gone says so.
import assert from "node:assert/strict";
import test from "node:test";
import * as Effect from "effect/Effect";
import { HostCallFailed } from "convergence/effect";
import type { AgentInfo } from "convergence";
import { loadOptions } from "./data.ts";
import { renderComposer } from "./views/composer.ts";
import { harness, chat, nodes } from "./ui-for-tests.test.ts";

test("a new agent's failed options leave none, not the last agent's", async () => {
  const h = harness((method) =>
    method === "host/chats.options" ? Effect.fail(new HostCallFailed({ method, code: -32603, message: "no catalog" })) : undefined,
  );
  h.controller.state.chats.c = chat({ id: "c", agentId: "codex" });
  const composer = h.controller.composer("c");
  composer.agentId = "codex";
  composer.options = [
    { id: "model", name: "Model", kind: "select", category: "model", value: "gpt", choices: [{ value: "gpt", name: "GPT" }] },
  ];
  h.controller.state.chats.c = chat({ id: "c", agentId: "opencode" });
  await Effect.runPromise(loadOptions(h.controller, "c"));
  assert.deepEqual(composer.options, []);
  assert.equal(composer.agentId, "opencode");
  assert.ok(h.notices.some((notice) => notice.includes("no catalog")), "the failure is said");
});

test("switching to an agent shows its own last options at once, never another agent's", async () => {
  const model = (value: string) => [{ id: "model", name: "Model", kind: "select" as const, category: "model" as const, value, choices: [] }];
  let release!: () => void;
  const late = new Promise<void>((resolve) => (release = resolve));
  const h = harness((method, params) => {
    if (method !== "host/chats.options") return undefined;
    const { chatId } = params as { chatId: string };
    if (chatId === "a") return Effect.succeed({ options: model("gpt") });
    if (chatId === "b") return Effect.succeed({ options: model("sonnet") });
    return Effect.promise(() => late).pipe(Effect.as({ options: model("gpt-fresh") }));
  });
  h.controller.state.chats.a = chat({ id: "a", agentId: "codex" });
  h.controller.state.chats.b = chat({ id: "b", agentId: "claude" });
  await Effect.runPromise(loadOptions(h.controller, "a"));
  await Effect.runPromise(loadOptions(h.controller, "b"));

  // A Claude draft switches to Codex: Codex's last answer shows while the host reads it.
  h.controller.state.chats.c = chat({ id: "c", agentId: "claude" });
  const composer = h.controller.composer("c");
  composer.agentId = "claude";
  composer.options = model("sonnet");
  h.controller.state.chats.c = chat({ id: "c", agentId: "codex" });
  const loading = Effect.runPromise(loadOptions(h.controller, "c"));
  assert.equal(composer.options[0]?.value, "gpt", "Codex's own list, not Claude's");
  release();
  await loading;
  assert.equal(composer.options[0]?.value, "gpt-fresh", "the host's answer replaces it");

  // An agent that never answered shows none, not the last agent's.
  h.controller.state.chats.c = chat({ id: "c", agentId: "opencode" });
  void Effect.runPromise(loadOptions(h.controller, "c"));
  assert.deepEqual(composer.options, []);
});

test("a draft whose agent was turned off asks for another", () => {
  const empty: Record<string, unknown> = {
    "host/chats.options": { options: [] },
    "host/chats.commands": { commands: [] },
    "host/chats.skills": { skills: [] },
  };
  const h = harness((method) => (method in empty ? Effect.succeed(empty[method]) : undefined));
  const draft = chat({ id: "d", agentId: "gone" });
  h.controller.state.chats.d = draft;
  h.controller.state.agentList = [{ id: "codex", name: "Codex", capabilities: {} } as AgentInfo];
  const picker = nodes(renderComposer(h.v, draft)).find((node) => node.id === "agent-d");
  assert.equal(picker?.placeholder, "Choose an agent");
});

test("an agent's options that arrive after a switch to another are dropped", async () => {
  let release!: () => void;
  const late = new Promise<void>((resolve) => (release = resolve));
  const h = harness((method, params) =>
    method === "host/chats.options" && (params as { chatId: string }).chatId === "c"
      ? Effect.promise(() => late).pipe(
          Effect.as({ options: [{ id: "model", name: "Model", kind: "select", category: "model", value: "old", choices: [] }] }),
        )
      : undefined,
  );
  h.controller.state.chats.c = chat({ id: "c", agentId: "codex" });
  const first = Effect.runPromise(loadOptions(h.controller, "c"));
  // The user picks another agent before Codex answered.
  h.controller.state.chats.c = chat({ id: "c", agentId: "opencode" });
  h.controller.composer("c").agentId = "opencode";
  h.controller.composer("c").loading = true;
  release();
  await first;
  assert.deepEqual(h.controller.composer("c").options, [], "Codex's model is not OpenCode's");
  assert.equal(h.controller.composer("c").loading, true, "OpenCode's own read is still on its way");
});

test("loading options is drawn at once and ends with the answer", async () => {
  let release!: () => void;
  const late = new Promise<void>((resolve) => (release = resolve));
  const h = harness((method) =>
    method === "host/chats.options"
      ? Effect.promise(() => late).pipe(
          Effect.as({ options: [{ id: "model", name: "Model", kind: "select", category: "model", value: "a1", choices: [] }] }),
        )
      : undefined,
  );
  h.controller.state.chats.c = chat({ id: "c", agentId: "codex" });
  const composer = h.controller.composer("c");
  const shown: [boolean, number][] = [];
  h.controller.view.update = () => void shown.push([composer.loading, composer.options.length]);
  const loading = Effect.runPromise(loadOptions(h.controller, "c"));
  assert.deepEqual(shown, [[true, 0]], "the loading state is drawn without a wait of the plugin's own");
  release();
  await loading;
  assert.deepEqual(shown.at(-1), [false, 1]);
});

test("commands the agent is slow to list never hold the composer loading", async () => {
  let release!: () => void;
  const late = new Promise<void>((resolve) => (release = resolve));
  const h = harness((method) => {
    if (method === "host/chats.options") return Effect.succeed({ options: [] });
    if (method === "host/chats.commands")
      return Effect.promise(() => late).pipe(Effect.as({ commands: [{ name: "init", description: "" }] }));
    return undefined;
  });
  h.controller.state.chats.c = chat({ id: "c", agentId: "codex" });
  const composer = h.controller.composer("c");
  await Effect.runPromise(loadOptions(h.controller, "c"));
  assert.equal(composer.loading, false, "Send is not blocked while commands wait for the agent");
  assert.deepEqual(composer.commands, []);
  release();
  await new Promise((resolve) => setTimeout(resolve, 20));
  assert.equal(composer.commands.length, 1, "commands apply when they arrive");
});

Versions

VersionPublishedPlugin APISizePermissionsStatus
0.2.5latestNov 21, 2026>=2 <4174.6 KB5 permissionsListed
0.2.4Oct 25, 2026>=2 <4174.2 KB5 permissionsListed
0.2.3Oct 24, 2026>=2 <4165.4 KB5 permissionsListed
0.2.2Oct 23, 2026>=2 <4165 KB5 permissionsListed
0.2.1Oct 6, 2026>=2 <3111.8 KB5 permissionsListed
0.2.0Oct 5, 2026>=2 <3105.1 KB5 permissionsListed

Reviews and comments

0 threads · 0 reviews

No comments yet.