Linger is An Open-Source Personal Agent That Runs Fully on Your PC. We aim to break Big Tech’s grip on AI by bringing powerful local AI to everyday computers through efficient model–harness co-design, so everyone can run their own.
fix(teamhub): say missing_content covers a canvas already left empty
muterC90e380d8fdb6
diff --git a/apps/teamhub/internal/voicelive/canvas.go b/apps/teamhub/internal/voicelive/canvas.goindex 121a6df7..0b3ac920 100644--- a/apps/teamhub/internal/voicelive/canvas.go+++ b/apps/teamhub/internal/voicelive/canvas.go@@ -55,7 +55,7 @@ var EditEmailCanvasTool = Tool{"canvas_changed means the canvas is not as you last saw it (the user may have edited it): its result has the latest text and revision_id; redo the change on that text, keeping the user's own edits, and call again with that revision_id. " +"When it is changed, tell the user in one short sentence what you changed. " + emailCanvasDelivery +"canvas_has_media means images sit among the text, which a body rewrite would lose: recipients and subject still change here; change the body with start_task instead, naming the document_id. canvas_locked: change it with start_task instead, naming the document_id. invalid_recipients means an address is not an email address: ask the user for it. " +- "missing_content means the subject or body you gave is empty: ask the user what it should say. body_too_long means the body is too long: shorten it. nothing_to_change means you gave none of to, cc, subject or body.",+ "missing_content means the email's subject or body is empty, also when the canvas already had it empty and this call left it out: ask the user what it should say. body_too_long means the body is too long: shorten it. nothing_to_change means you gave none of to, cc, subject or body.",Parameters: objectSchema([]string{"document_id", "revision_id"}, map[string]any{"document_id": stringProperty("The canvas, from open_email_canvas"),"revision_id": stringProperty("The revision_id the last result gave for this canvas"),diff --git a/apps/teamhub/internal/voicelive/canvas_test.go b/apps/teamhub/internal/voicelive/canvas_test.goindex 900a0e9c..413add8c 100644--- a/apps/teamhub/internal/voicelive/canvas_test.go+++ b/apps/teamhub/internal/voicelive/canvas_test.go@@ -71,4 +71,11 @@ func TestEditedEmailCanvasKeepsWhatTheChangeLeavesOut(t *testing.T) {if _, _, problem := EditedEmailCanvas(fields, body, EditEmailCanvasArguments{Body: &empty}); problem != "missing_content" {t.Fatalf("empty body: %q", problem)}+ // The check covers the email after the change, so a canvas opened with+ // no subject is still missing content when only a recipient changes.+ untitled := map[string]string{"to": "[email protected]", "subject": ""}+ to := "[email protected]"+ if _, _, problem := EditedEmailCanvas(untitled, body, EditEmailCanvasArguments{To: &to}); problem != "missing_content" {+ t.Fatalf("recipient change on an untitled canvas: %q", problem)+ }}