Public: anyone can read this; the crew can change it.

Talk's agent list makes room: `asks` comes off it, answered by the forge itself #16289

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

talk/asks-off → main 0 commits 1 thread · 1 unresolved

  • Merged. talk/asks-off was merged into main as 084a6fd.

Review

Sign in to review this change.
3 files changed +37 −10
src/http/mcp/catalog.ts +11 −8
@@ -22,9 +22,9 @@ export const DEFAULT_TOOLS: readonly string[] = [
2222 * plus what a person steering the forge by talking reads and does. Its harness calls only tools
2323 * `tools/list` named, so a tool left out here is one Talk cannot use at all. The rule: the reads a
2424 * question about the work needs (issues, pulls and their commits, threads and checks, search,
25 * files, runs and logs, asks, health, releases, people, and who the person is and what they may
25 * files, runs and logs, health, releases, people, and who the person is and what they may
2626 * do, `whoami_can`), and the everyday writes on that work (comment, close or reopen, assign,
27 * labels, edit, review, merge, asks, the plan on an issue, a word to or a stop of a crew run, a
27 * labels, edit, review, merge, the plan on an issue, a word to or a stop of a crew run, a
2828 * branch, a file and a pull for an app built in Talk, a new app). Each write is held as any write
2929 * of this token is: after the agent has read text someone else wrote, a write the person's own
3030 * words do not ask for comes back `needs_confirm`, and the asked-first list
@@ -33,16 +33,19 @@ export const DEFAULT_TOOLS: readonly string[] = [
3333 * itself (accounts, subscriptions, backups, cutting or rolling back a release, child forges, flags,
3434 * boards, raw data), which an admin does on its own page; `find_tool` still names them. Also left
3535 * out, so the list stays well inside one page of `tools/list` (about 17 KB of `TOOLS_PAGE_BYTES`'
36 * 20,000): `explore`, `forge_view` and `feed` (`apps`, `person`, `now`, `asks` and `health` answer
37 * the same), `asked` (`issues`), `agents` (`now`), and the planning knobs a page sets
38 * (`milestones`, `wait_for`, `hold`). Filtered by `visible` as every list is, so a tool this person
39 * or token may not use is never shown.
36 * 20,000): `explore`, `forge_view` and `feed` (`apps`, `person`, `now` and `health` answer
37 * the same), `asked` (`issues`), `agents` (`now`), `asks`, `asks_act` and the asks filters (a
38 * question about what waits on the person is answered by the forge itself from the same rows,
39 * `actions/talk_decisions.ts`, each item a link to the page where it is decided; the inbox they
outdated

now is crewNow (crew runs), not a list of what waits on the person. This claim is false, and asks_act stays listed with no source of item ids. Fix the comment and give asks_act its ids, or drop asks_act too.

40 * belong to is going, #16229), and the planning knobs a page sets (`milestones`, `wait_for`,
41 * `hold`). Filtered by `visible` as every list is, so a tool this person or token may not use is
42 * never shown.
4043 */
4144 export const TALK_TOOLS: readonly string[] = [
4245 ...DEFAULT_TOOLS,
4346 "issue", "issues", "pull", "pulls", "commits", "threads", "search", "read_file", "repo", "run_log",
44 "preview", "asks", "assigned", "health", "releases", "person", "whoami_can",
45 "close", "assign", "labels", "edit", "review", "merge", "asks_act", "keep_plan", "steer", "stop",
47 "preview", "assigned", "health", "releases", "person", "whoami_can",
48 "close", "assign", "labels", "edit", "review", "merge", "keep_plan", "steer", "stop",
4649 "write_file", "branches", "open_pull", "new_app",
4750 ];
4851
test/mcp-talk-tools.test.ts −2
@@ -242,8 +242,6 @@ describe("every write Talk's agent is newly listed is held after it reads someon
242242 // A real write of each (no dry run, no read-only form), on a hostile issue's repository. A write
243243 // tool added to TALK_TOOLS without a row here fails the first test: add its row.
244244 const WRITES: Readonly<Record<string, Record<string, unknown>>> = {
245 asks: { filter: "clear" },
246 asks_act: { action: "dismiss", items: ["x"], dryRun: false },
247245 assign: { repo: "alice/hostile", number: 1, kind: "issue", assignee: "mallory" },
248246 branches: { repo: "alice/hostile", name: "evil", action: "create" },
249247 close: { repo: "alice/hostile", number: 1 },
test/talk-decisions.test.ts +26
@@ -22,6 +22,9 @@ import { serveTalk, terminalAnswer } from "../src/tui/ssh-talk.ts";
2222 import type { SshSession } from "../src/ssh/channels.ts";
2323 import { pendingAmong, storeFile } from "../src/core/conversation_files.ts";
2424 import { quietLogs } from "./helpers/globals.ts";
25 import { TALK_TOOLS } from "../src/http/mcp/catalog.ts";
26 import { serve } from "../src/http/server.ts";
27 import { createSession } from "../src/core/sessions.ts";
2528
2629 quietLogs();
2730
@@ -95,6 +98,29 @@ describe("talk answers what needs me", () => {
9598 expect(await answer(bob, "what needs me")).toBe("Nothing is waiting on you.");
9699 });
97100
101 test("Talk's agent has no asks tool to call: a decision is made from the answer's links, each a page the person opens", async () => {
102 // The forge answers this itself (the agent's binary does not exist here); the agent is not
103 // listed a tool that would need the inbox's ids.
104 expect(TALK_TOOLS).not.toContain("asks");
105 expect(TALK_TOOLS).not.toContain("asks_act");
106 const held = openIssue(app, alice, repo, { title: "Decide me", body: "" });
107 if (!held.ok) throw new Error("issue");
108 setAssignee(app.db, held.value.id, alice.id);
109 const text = await answer(alice, "what needs me?");
110 const links = [...text.matchAll(/\]\((\/[^)\s]*)\)/g)].map((m) => m[1]!);
111 expect(links.length).toBeGreaterThan(0);
112 const servers = await serve(app);
113 try {
114 const cookie = `forge_session=${createSession(app.db, alice.id).token}`;
115 for (const link of links) {
116 const res = await fetch(`${servers.url}${link}`, { headers: { cookie }, redirect: "manual" });
117 expect(`${link} → ${res.status}`).toBe(`${link} → 200`);
118 }
119 } finally {
120 servers.stop();
121 }
122 });
123
98124 test("the older row, which scores higher in its tier, is listed first", async () => {
99125 const lone = await createRepo(app, alice, { name: "second", visibility: "public" });
100126 if (!lone.ok) throw new Error("repo");

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs