Skip to content

A tiny friend in your Mac's notch and on your iPhone that keeps an eye on your AI coding agents: Claude Code, Codex, Cursor, Gemini CLI, Antigravity and more. Approve from the notch or your Lock Screen.

fix: complete Antigravity question notifications

Ohualtexae05c037bd2c
diff --cc NotchBuddy/Resources/Localizable.xcstrings
index 1170e931,a3131a0f..0f2d3a1d
--- a/NotchBuddy/Resources/Localizable.xcstrings
+++ b/NotchBuddy/Resources/Localizable.xcstrings
@@@ -37304,6 -38864,6 +38864,70 @@@
}
}
},
++ "step.needs-input" : {
++ "localizations" : {
++ "ar" : {
++ "stringUnit" : {
++ "state" : "translated",
++ "value" : "يحتاج إلى إدخال"
++ }
++ },
++ "bn" : {
++ "stringUnit" : {
++ "state" : "translated",
++ "value" : "ইনপুট প্রয়োজন"
++ }
++ },
++ "en" : {
++ "stringUnit" : {
++ "state" : "translated",
++ "value" : "Needs input"
++ }
++ },
++ "es" : {
++ "stringUnit" : {
++ "state" : "translated",
++ "value" : "Necesita una respuesta"
++ }
++ },
++ "fr" : {
++ "stringUnit" : {
++ "state" : "translated",
++ "value" : "Réponse attendue"
++ }
++ },
++ "hi" : {
++ "stringUnit" : {
++ "state" : "translated",
++ "value" : "इनपुट चाहिए"
++ }
++ },
++ "id" : {
++ "stringUnit" : {
++ "state" : "translated",
++ "value" : "Perlu masukan"
++ }
++ },
++ "pt-BR" : {
++ "stringUnit" : {
++ "state" : "translated",
++ "value" : "Aguardando resposta"
++ }
++ },
++ "ru" : {
++ "stringUnit" : {
++ "state" : "translated",
++ "value" : "Нужен ответ"
++ }
++ },
++ "zh-Hans" : {
++ "stringUnit" : {
++ "state" : "translated",
++ "value" : "需要输入"
++ }
++ }
++ }
++ },
"step.notebook" : {
"localizations" : {
"ar" : {
diff --cc NotchBuddy/Sources/App/HookServer.swift
index 42e17f29,b27ed921..842098c6
--- a/NotchBuddy/Sources/App/HookServer.swift
+++ b/NotchBuddy/Sources/App/HookServer.swift
@@@ -1155,10 -1156,8 +1161,11 @@@ final class HookServer: @unchecked Send
"apply_patch": String(localized: "step.edits", defaultValue: "Edits"),
"update_plan": String(localized: "step.tasks", defaultValue: "Tasks"),
"spawn_agent": String(localized: "step.agent", defaultValue: "Agent"),
+ // Antigravity tools
+ "ask_question": String(localized: "step.needs-input", defaultValue: "Needs input"),
]
-- var label = labels[tool] ?? tool
++ let labelTool = tool == "ask_question" || tool.hasSuffix(":ask_question") ? "ask_question" : tool
++ var label = labels[labelTool] ?? tool
// Codex MCP tools arrive as mcp__server__tool — show "server · tool"
if tool.hasPrefix("mcp__") {
@@@ -1182,16 -1181,9 +1189,17 @@@
}
}
}
+ return label
}
+ // ask_question: extract the question string
+ if (tool == "ask_question" || tool.hasSuffix(":ask_question")),
+ let questions = input["questions"] as? [[String: Any]],
+ let firstQ = questions.first?["question"] as? String,
+ !firstQ.trimmingCharacters(in: .whitespaces).isEmpty {
+ return "\(label) · \(oneLine(firstQ))"
+ }
+
if let cmd = input["command"] as? String {
return "\(label) · \(oneLine(cmd))"
} else if let path = input["path"] as? String {
diff --cc windows/src/i18n/strings.json
index 5773935d,8f4a06fa..d40ba126
--- a/windows/src/i18n/strings.json
+++ b/windows/src/i18n/strings.json
@@@ -2829,6 -3082,6 +3082,17 @@@
"ru": "Нужен Mac с Apple silicon",
"id": "Perlu Apple silicon"
},
++ "Needs input": {
++ "zh-Hans": "需要输入",
++ "hi": "इनपुट चाहिए",
++ "es": "Necesita una respuesta",
++ "ar": "يحتاج إلى إدخال",
++ "fr": "Réponse attendue",
++ "bn": "ইনপুট প্রয়োজন",
++ "pt-BR": "Aguardando resposta",
++ "ru": "Нужен ответ",
++ "id": "Perlu masukan"
++ },
"New conversation": {
"zh-Hans": "新建对话",
"hi": "नई बातचीत",
diff --cc windows/src/island/hooks.ts
index 5be064fa,ad01493d..b39ecc21
--- a/windows/src/island/hooks.ts
+++ b/windows/src/island/hooks.ts
@@@ -117,7 -116,7 +117,8 @@@ const TOOL_LABELS: Record<string, strin
};
function stepLabel(tool: string, input: Record<string, unknown>): string {
-- const label = TOOL_LABELS[tool] ? t(TOOL_LABELS[tool]) : tool;
++ const labelTool = tool === "ask_question" || tool.endsWith(":ask_question") ? "ask_question" : tool;
++ const label = TOOL_LABELS[labelTool] ? t(TOOL_LABELS[labelTool]) : tool;
const str = (k: string) => (typeof input[k] === "string" ? (input[k] as string) : null);
const cmd = str("command");
if (cmd) return `${label} · ${cmd.slice(0, 40)}`;
diff --cc windows/tests/hooks.test.mjs
index ead0f482,6e965ef0..45ec5ce0
--- a/windows/tests/hooks.test.mjs
+++ b/windows/tests/hooks.test.mjs
@@@ -7,6 -7,6 +7,8 @@@ import assert from "node:assert/strict"
import { calls, emit, sent } from "./tauri.mjs";
import { registerHookHandlers } from "../src/island/hooks.ts";
import { DEFAULT_SETTINGS, State } from "../src/core/state.ts";
++import { Sound } from "../src/core/sound.ts";
++import { setLanguage } from "../src/i18n/i18n.ts";
const CLAUDE = "integration_claude";
@@@ -25,6 -25,6 +27,7 @@@ const task = (id = CLAUDE) => State.tas
const seconds = (n) => mock.timers.tick(n * 1000);
beforeEach(() => {
++ setLanguage("en");
mock.timers.enable({ apis: ["setTimeout"] });
asked = [];
calls.length = 0;
@@@ -695,27 -695,3 +698,56 @@@ test("a declined permission request lea
assert.deepEqual(sent("approval_decline"), [{ requestId: "r1" }, { requestId: "r2" }]);
assert.equal(task().state, "idle");
});
+
- test("Antigravity ask_question PreToolUse triggers question state and island alert", () => {
- hook({
- hook_event_name: "PreToolUse",
- coucou_agent: "antigravity",
- tool_name: "ask_question",
- tool_input: {
- questions: [{ question: "Which deployment strategy should we use?" }],
- },
++for (const tool_name of ["ask_question", "default_api:ask_question"]) {
++ test(`Antigravity ${tool_name} alerts and plays a sound until the question is answered`, (context) => {
++ const sound = context.mock.method(Sound, "play", () => {});
++ hook({
++ hook_event_name: "PreToolUse",
++ coucou_agent: "antigravity",
++ tool_name,
++ tool_input: { questions: [{ question: "Which deployment strategy should we use?" }] },
++ });
++ const active = task("agent_antigravity");
++ assert.equal(active.state, "question");
++ assert.equal(active.steps.at(-1), "Needs input · Which deployment strategy should we use?");
++ assert.deepEqual(asked, ["alert:overview"]);
++ assert.deepEqual(sound.mock.calls.map((call) => call.arguments), [["question"]]);
++ assert.equal(State.pendingApproval, null, "the answer stays in Antigravity");
++ assert.deepEqual(sent("approval_ack"), []);
++
++ hook({ hook_event_name: "PostToolUse", coucou_agent: "antigravity", tool_name });
++ assert.equal(active.state, "working");
++ assert.equal(sound.mock.callCount(), 1);
+ });
- const t = task("agent_antigravity");
- assert.ok(t);
- assert.equal(t.state, "question");
- assert.ok(t.steps.at(-1).includes("Which deployment strategy"));
- assert.ok(asked.includes("alert:overview"));
++}
+
- // PostToolUse puts the pill back to working
- hook({
- hook_event_name: "PostToolUse",
- coucou_agent: "antigravity",
- tool_name: "ask_question",
- });
- assert.equal(t.state, "working");
++test("Antigravity namespaced questions use the selected interface language", () => {
++ setLanguage("fr");
++ try {
++ hook({
++ hook_event_name: "PreToolUse",
++ coucou_agent: "antigravity",
++ tool_name: "default_api:ask_question",
++ tool_input: { questions: [{ question: "Quelle stratégie ?" }] },
++ });
++ assert.equal(task("agent_antigravity").steps.at(-1), "Réponse attendue · Quelle stratégie ?");
++ } finally {
++ setLanguage("en");
++ }
++});
++
++test("Antigravity questions without usable text still alert with a translated label", () => {
++ for (const questions of [undefined, [], [null], [{ question: 3 }], [{ question: " " }]]) {
++ hook({
++ hook_event_name: "PreToolUse",
++ coucou_agent: "antigravity",
++ tool_name: "default_api:ask_question",
++ tool_input: { questions },
++ });
++ assert.equal(task("agent_antigravity").state, "question");
++ assert.equal(task("agent_antigravity").steps.at(-1), "Needs input");
++ }
++ assert.equal(asked.length, 5);
++ assert.ok(asked.every((request) => request === "alert:overview"));
+});