Queue mid-turn messages for the next tool call; remove all tests

This commit is contained in:
Ian Gulliver
2026-10-15 18:33:18 -07:00
parent 4f94d73b58
commit 514a2580f7
68 changed files with 364 additions and 6851 deletions
+1 -1
View File
@@ -600,7 +600,7 @@ export interface paths {
};
get?: never;
put?: never;
/** @description Starts a new turn with this message. The session must be idle. */
/** @description Starts a new turn with this message when the session is idle. While a task session's turn is running, the message is queued and reaches the agent after its next tool call, or as the next turn. */
post: operations["sendMessage"];
delete?: never;
options?: never;
+1 -1
View File
@@ -15,7 +15,7 @@ const leadSource: ChatSource = {
streamTopic: "lead.stream",
empty: "",
canSend: () => true,
placeholder: (s) => (s === "running" ? "Message your lead; it gets this when its turn ends" : "Message your lead. Paste or drop images to attach them."),
placeholder: (s) => (s === "running" ? "Message your lead; it reads this after its next tool call, or when its turn ends" : "Message your lead. Paste or drop images to attach them."),
send: async ({ text, images, model, firstModel, sessionId }) => {
await post("/api/me/lead/messages", { body: { text, images, model: sessionId ? model : firstModel } });
},
+4 -3
View File
@@ -89,8 +89,9 @@ const taskSource: ChatSource = {
transcriptTopic: "transcript",
streamTopic: "stream",
empty: "No task selected. Ask your lead, or pick one with ⌘K.",
canSend: (s) => s === "idle",
placeholder: (s) => (s === "idle" ? "Message the agent. Paste or drop images to attach them." : "Wait for the turn to end, or interrupt it"),
canSend: () => true,
placeholder: (s) =>
s === "running" ? "Message the agent; it reads this after its next tool call, or when its turn ends" : "Message the agent. Paste or drop images to attach them.",
send: async ({ key, sessionId, text, images, model, firstModel }) => {
if (sessionId) {
await post("/api/sessions/{sessionId}/messages", { path: { sessionId }, body: { text, images, model } });
@@ -344,7 +345,7 @@ export function mountChat(root: HTMLElement, src: ChatSource, makeHead: (rerende
const el = h(
"div",
{ class: "msg user pending" },
h("div", { class: "who" }, "sending…"),
h("div", { class: "who" }, src.session()?.state === "running" ? "queued…" : "sending…"),
imgs.length > 0 ? h("div", { class: "msg-images" }, ...imgs.map((img) => h("img", { src: img.url, alt: "attached image" }))) : null,
text.trim() ? markdown(text, "text md") : null,
);