Skip to content

Open-source AI browser agent for Chrome and Firefox (monorepo) 🧠

Fix Ask-to-Act handoff lifecycle

16Mikub7a02e19d04d
diff --git a/src/chrome/src/agent/agent.js b/src/chrome/src/agent/agent.js
index 5d8eada9c..675c20240 100644
--- a/src/chrome/src/agent/agent.js
+++ b/src/chrome/src/agent/agent.js
@@ -19966,11 +19966,13 @@ Rules: no prose intro, no conclusion, no "this screenshot shows...", no layout d
|| typeof finalResponse !== 'string'
|| finalResponse.trim().length < 8
|| this._checkAbort(tabId)
- || isSelectionSourceGrounding(runOptions?.sourceGrounding)) {
+ || isSelectionSourceGrounding(runOptions?.sourceGrounding)
+ || this.selectionGroundingScopes.has(tabId)) {
return;
}
try {
const provider = this._activeProvider(tabId);
+ const costState = this.currentCostState.get(tabId) || null;
const { tabUrl, tabTitle } = await this._getTabUrlTitle(tabId);
const messages = buildAskModeHandoffMessages(userMessage, finalResponse, tabUrl, tabTitle);
const response = await this._withContentActionDeadline(
@@ -19983,7 +19985,7 @@ Rules: no prose intro, no conclusion, no "this screenshot shows...", no layout d
maxTokens: 24,
signal,
},
- this.currentCostState.get(tabId) || null,
+ costState,
{ tabId, generationName: 'ask_mode_handoff' },
),
'ask_mode_handoff',
@@ -40108,7 +40110,7 @@ Rules: no prose intro, no conclusion, no "this screenshot shows...", no layout d
}
try {
const result = await this._processMessageInner(tabId, userMessage, onUpdate, mode, attachments, runOptions);
- await this._maybeEmitAskModeHandoff(tabId, mode, userMessage, result, onUpdate, runOptions);
+ void this._maybeEmitAskModeHandoff(tabId, mode, userMessage, result, onUpdate, runOptions);
return result;
} finally {
this.currentCostState.delete(tabId);
@@ -41579,7 +41581,6 @@ Rules: no prose intro, no conclusion, no "this screenshot shows...", no layout d
}
throw error;
} finally {
- this.currentCostState.delete(tabId);
await askStreamingTraceWrite;
if (runId) await trace.recordTurnEnd(
runId,
@@ -41645,7 +41646,7 @@ Rules: no prose intro, no conclusion, no "this screenshot shows...", no layout d
}
try {
const result = await this._processMessageStreamInner(tabId, userMessage, onUpdate, mode, runOptions);
- await this._maybeEmitAskModeHandoff(tabId, mode, userMessage, result, onUpdate, runOptions);
+ void this._maybeEmitAskModeHandoff(tabId, mode, userMessage, result, onUpdate, runOptions);
return result;
} finally {
this.currentCostState.delete(tabId);
diff --git a/src/chrome/src/ui/locales/ar.js b/src/chrome/src/ui/locales/ar.js
index dc0d2c13c..e0a744410 100644
--- a/src/chrome/src/ui/locales/ar.js
+++ b/src/chrome/src/ui/locales/ar.js
@@ -174,8 +174,8 @@ export default {
'sp.mode.ask': 'سؤال',
'sp.mode.ask.title': 'اطرح أسئلة عن الصفحة — دون إجراء أي تغييرات',
- 'sp.mode.act_handoff_button': 'Switch to Act & retry',
- 'sp.mode.act_handoff_hint': 'This needs Act mode to complete. Click to switch and resend your request.',
+ 'sp.mode.act_handoff_button': 'التبديل إلى التنفيذ وإعادة المحاولة',
+ 'sp.mode.act_handoff_hint': 'يتطلب هذا وضع التنفيذ لإكماله. انقر للتبديل وإعادة إرسال طلبك.',
'sp.mode.act': 'تنفيذ',
'sp.mode.act.title': 'دع WebBrain ينقر ويكتب ويتنقّل نيابةً عنك',
'sp.mode.act.warning': 'وضع التنفيذ: استخدمه على مسؤوليتك.',
diff --git a/src/chrome/src/ui/locales/bn.js b/src/chrome/src/ui/locales/bn.js
index a749100fb..c22da8cf0 100644
--- a/src/chrome/src/ui/locales/bn.js
+++ b/src/chrome/src/ui/locales/bn.js
@@ -142,8 +142,8 @@ export default {
'sp.mode.ask': "জিজ্ঞাসা করুন",
'sp.mode.ask.title': "পৃষ্ঠা সম্পর্কে প্রশ্ন জিজ্ঞাসা করুন — কোন পরিবর্তন করা হয়নি",
- 'sp.mode.act_handoff_button': 'Switch to Act & retry',
- 'sp.mode.act_handoff_hint': 'This needs Act mode to complete. Click to switch and resend your request.',
+ 'sp.mode.act_handoff_button': 'অ্যাক্ট মোডে বদলে আবার চেষ্টা করুন',
+ 'sp.mode.act_handoff_hint': 'এটি সম্পূর্ণ করতে অ্যাক্ট মোড প্রয়োজন। মোড বদলাতে এবং আপনার অনুরোধটি আবার পাঠাতে ক্লিক করুন।',
'sp.mode.act': "আইন",
'sp.mode.act.title': "আপনার জন্য WebBrain ক্লিক করুন, টাইপ করুন এবং নেভিগেট করুন",
'sp.mode.act.warning': "অ্যাক্ট মোড: আপনার নিজের ঝুঁকিতে ব্যবহার করুন।",
diff --git a/src/chrome/src/ui/locales/de.js b/src/chrome/src/ui/locales/de.js
index 4c68de7b2..8479c00fa 100644
--- a/src/chrome/src/ui/locales/de.js
+++ b/src/chrome/src/ui/locales/de.js
@@ -139,8 +139,8 @@ export default {
"sp.input.selection_placeholder": "Frage zum ausgewählten Text...",
'sp.mode.ask': 'Fragen',
'sp.mode.ask.title': 'Fragen zur Seite stellen — keine Änderungen',
- 'sp.mode.act_handoff_button': 'Switch to Act & retry',
- 'sp.mode.act_handoff_hint': 'This needs Act mode to complete. Click to switch and resend your request.',
+ 'sp.mode.act_handoff_button': 'Zu Act wechseln und erneut versuchen',
+ 'sp.mode.act_handoff_hint': 'Zum Abschließen wird der Act-Modus benötigt. Klicken Sie, um zu wechseln und Ihre Anfrage erneut zu senden.',
'sp.mode.act': 'Handeln',
'sp.mode.act.title': 'Lassen Sie WebBrain für Sie klicken, tippen und navigieren',
'sp.mode.act.warning': 'Handeln-Modus: Nutzung auf eigenes Risiko.',
diff --git a/src/chrome/src/ui/locales/es.js b/src/chrome/src/ui/locales/es.js
index 20cb13f9b..ad8b00f59 100644
--- a/src/chrome/src/ui/locales/es.js
+++ b/src/chrome/src/ui/locales/es.js
@@ -174,8 +174,8 @@ export default {
'sp.mode.ask': 'Preguntar',
'sp.mode.ask.title': 'Haz preguntas sobre la página — sin hacer cambios',
- 'sp.mode.act_handoff_button': 'Switch to Act & retry',
- 'sp.mode.act_handoff_hint': 'This needs Act mode to complete. Click to switch and resend your request.',
+ 'sp.mode.act_handoff_button': 'Cambiar a Actuar y reintentar',
+ 'sp.mode.act_handoff_hint': 'Esto requiere el modo Actuar para completarse. Haz clic para cambiar y reenviar tu solicitud.',
'sp.mode.act': 'Actuar',
'sp.mode.act.title': 'Deja que WebBrain haga clic, escriba y navegue por ti',
'sp.mode.act.warning': 'Modo Actuar: Úsalo bajo tu propia responsabilidad.',
diff --git a/src/chrome/src/ui/locales/fa.js b/src/chrome/src/ui/locales/fa.js
index 3252970cc..32d2b4f04 100644
--- a/src/chrome/src/ui/locales/fa.js
+++ b/src/chrome/src/ui/locales/fa.js
@@ -142,8 +142,8 @@ export default {
'sp.mode.ask': "بپرسید",
'sp.mode.ask.title': "درباره صفحه سوال بپرسید — هیچ تغییری ایجاد نشده است",
- 'sp.mode.act_handoff_button': 'Switch to Act & retry',
- 'sp.mode.act_handoff_hint': 'This needs Act mode to complete. Click to switch and resend your request.',
+ 'sp.mode.act_handoff_button': 'تغییر به حالت عمل و تلاش مجدد',
+ 'sp.mode.act_handoff_hint': 'برای تکمیل این کار به حالت عمل نیاز است. برای تغییر حالت و ارسال دوباره درخواست کلیک کنید.',
'sp.mode.act': "عمل کنید",
'sp.mode.act.title': "اجازه دهید WebBrain کلیک کند، تایپ کند و برای شما حرکت کند",
'sp.mode.act.warning': "حالت عمل: با مسئولیت خود استفاده کنید.",
diff --git a/src/chrome/src/ui/locales/fr.js b/src/chrome/src/ui/locales/fr.js
index ae10e371e..bf394c88d 100644
--- a/src/chrome/src/ui/locales/fr.js
+++ b/src/chrome/src/ui/locales/fr.js
@@ -174,8 +174,8 @@ export default {
'sp.mode.ask': 'Demander',
'sp.mode.ask.title': 'Posez des questions sur la page — aucune modification',
- 'sp.mode.act_handoff_button': 'Switch to Act & retry',
- 'sp.mode.act_handoff_hint': 'This needs Act mode to complete. Click to switch and resend your request.',
+ 'sp.mode.act_handoff_button': 'Passer à Agir et réessayer',
+ 'sp.mode.act_handoff_hint': 'Le mode Agir est nécessaire pour terminer cette tâche. Cliquez pour changer de mode et renvoyer votre demande.',
'sp.mode.act': 'Agir',
'sp.mode.act.title': 'Laissez WebBrain cliquer, taper et naviguer à votre place',
'sp.mode.act.warning': 'Mode Agir : utilisez-le à vos propres risques.',
diff --git a/src/chrome/src/ui/locales/he.js b/src/chrome/src/ui/locales/he.js
index a8b3a5646..93b47e93a 100644
--- a/src/chrome/src/ui/locales/he.js
+++ b/src/chrome/src/ui/locales/he.js
@@ -139,8 +139,8 @@ export default {
"sp.input.selection_placeholder": "שאלו על הטקסט שנבחר...",
"sp.mode.ask": "שאל",
"sp.mode.ask.title": "שאל שאלות על הדף - לא בוצעו שינויים",
- "sp.mode.act_handoff_button": 'Switch to Act & retry',
- "sp.mode.act_handoff_hint": 'This needs Act mode to complete. Click to switch and resend your request.',
+ "sp.mode.act_handoff_button": 'עבור לפעולה ונסה שוב',
+ "sp.mode.act_handoff_hint": 'להשלמת הפעולה הזו נדרש מצב פעולה. לחצו כדי לעבור למצב זה ולשלוח מחדש את הבקשה.',
"sp.mode.act": "פעולה",
"sp.mode.act.title": "אפשר ל-WebBrain ללחוץ, להקליד ולנווט עבורך",
"sp.mode.act.warning": "מצב פעולה: השימוש על אחריותך בלבד.",
diff --git a/src/chrome/src/ui/locales/hi.js b/src/chrome/src/ui/locales/hi.js
index 6af2d22af..c2a51eb1b 100644
--- a/src/chrome/src/ui/locales/hi.js
+++ b/src/chrome/src/ui/locales/hi.js
@@ -142,8 +142,8 @@ export default {
'sp.mode.ask': "पूछो",
'sp.mode.ask.title': "पृष्ठ के बारे में प्रश्न पूछें - कोई परिवर्तन नहीं किया गया",
- 'sp.mode.act_handoff_button': 'Switch to Act & retry',
- 'sp.mode.act_handoff_hint': 'This needs Act mode to complete. Click to switch and resend your request.',
+ 'sp.mode.act_handoff_button': 'एक्ट पर स्विच करें और फिर कोशिश करें',
+ 'sp.mode.act_handoff_hint': 'इसे पूरा करने के लिए एक्ट मोड आवश्यक है। मोड बदलने और अपना अनुरोध फिर भेजने के लिए क्लिक करें।',
'sp.mode.act': "अधिनियम",
'sp.mode.act.title': "WebBrain को आपके लिए क्लिक करने, टाइप करने और नेविगेट करने दें",
'sp.mode.act.warning': "अधिनियम मोड: अपने जोखिम पर उपयोग करें।",
diff --git a/src/chrome/src/ui/locales/id.js b/src/chrome/src/ui/locales/id.js
index 3f4d74927..78c6f4d47 100644
--- a/src/chrome/src/ui/locales/id.js
+++ b/src/chrome/src/ui/locales/id.js
@@ -174,8 +174,8 @@ export default {
'sp.mode.ask': 'Tanya',
'sp.mode.ask.title': 'Bertanya tentang halaman — tanpa perubahan',
- 'sp.mode.act_handoff_button': 'Switch to Act & retry',
- 'sp.mode.act_handoff_hint': 'This needs Act mode to complete. Click to switch and resend your request.',
+ 'sp.mode.act_handoff_button': 'Beralih ke Aksi & coba lagi',
+ 'sp.mode.act_handoff_hint': 'Ini memerlukan mode Aksi untuk diselesaikan. Klik untuk beralih dan mengirim ulang permintaan Anda.',
'sp.mode.act': 'Aksi',
'sp.mode.act.title': 'Biarkan WebBrain mengeklik, mengetik, dan menavigasi untukmu',
'sp.mode.act.warning': 'Mode aksi: Gunakan dengan risiko Anda sendiri.',
diff --git a/src/chrome/src/ui/locales/ja.js b/src/chrome/src/ui/locales/ja.js
index 88a669f51..3ca07b5a9 100644
--- a/src/chrome/src/ui/locales/ja.js
+++ b/src/chrome/src/ui/locales/ja.js
@@ -174,8 +174,8 @@ export default {
'sp.mode.ask': '質問',
'sp.mode.ask.title': 'ページについて質問する — 変更は行いません',
- 'sp.mode.act_handoff_button': 'Switch to Act & retry',
- 'sp.mode.act_handoff_hint': 'This needs Act mode to complete. Click to switch and resend your request.',
+ 'sp.mode.act_handoff_button': 'Actに切り替えて再試行',
+ 'sp.mode.act_handoff_hint': '完了するにはActモードが必要です。クリックして切り替え、リクエストを再送信してください。',
'sp.mode.act': '操作',
'sp.mode.act.title': 'WebBrain にクリック・入力・操作を任せる',
'sp.mode.act.warning': '操作モード:自己責任でご利用ください。',
diff --git a/src/chrome/src/ui/locales/ko.js b/src/chrome/src/ui/locales/ko.js
index 4733afe41..c3aeb7250 100644
--- a/src/chrome/src/ui/locales/ko.js
+++ b/src/chrome/src/ui/locales/ko.js
@@ -174,8 +174,8 @@ export default {
'sp.mode.ask': '질문',
'sp.mode.ask.title': '페이지에 대해 질문 — 변경은 하지 않습니다',
- 'sp.mode.act_handoff_button': 'Switch to Act & retry',
- 'sp.mode.act_handoff_hint': 'This needs Act mode to complete. Click to switch and resend your request.',
+ 'sp.mode.act_handoff_button': 'Act로 전환하고 다시 시도',
+ 'sp.mode.act_handoff_hint': '완료하려면 Act 모드가 필요합니다. 클릭하여 전환한 후 요청을 다시 보내세요.',
'sp.mode.act': '실행',
'sp.mode.act.title': 'WebBrain이 클릭, 입력, 이동을 대신합니다',
'sp.mode.act.warning': '실행 모드: 위험을 감수하고 사용하세요.',
diff --git a/src/chrome/src/ui/locales/ms.js b/src/chrome/src/ui/locales/ms.js
index 98b4a3364..e123b6a05 100644
--- a/src/chrome/src/ui/locales/ms.js
+++ b/src/chrome/src/ui/locales/ms.js
@@ -174,8 +174,8 @@ export default {
'sp.mode.ask': 'Tanya',
'sp.mode.ask.title': 'Tanya soalan tentang halaman — tiada perubahan dibuat',
- 'sp.mode.act_handoff_button': 'Switch to Act & retry',
- 'sp.mode.act_handoff_hint': 'This needs Act mode to complete. Click to switch and resend your request.',
+ 'sp.mode.act_handoff_button': 'Tukar ke Act & cuba lagi',
+ 'sp.mode.act_handoff_hint': 'Ini memerlukan mod Act untuk diselesaikan. Klik untuk menukar dan hantar semula permintaan anda.',
'sp.mode.act': 'Lakukan',
'sp.mode.act.title': 'Biarkan WebBrain mengklik, menaip, dan menavigasi untuk anda',
'sp.mode.act.warning': 'Mod Lakukan: Gunakan atas risiko anda sendiri.',
diff --git a/src/chrome/src/ui/locales/nl.js b/src/chrome/src/ui/locales/nl.js
index 5aed232c4..0d2f5a675 100644
--- a/src/chrome/src/ui/locales/nl.js
+++ b/src/chrome/src/ui/locales/nl.js
@@ -139,8 +139,8 @@ export default {
"sp.input.selection_placeholder": "Vraag over de geselecteerde tekst...",
'sp.mode.ask': 'Vragen',
'sp.mode.ask.title': 'Vragen stellen over de pagina — er worden geen wijzigingen aangebracht',
- 'sp.mode.act_handoff_button': 'Switch to Act & retry',
- 'sp.mode.act_handoff_hint': 'This needs Act mode to complete. Click to switch and resend your request.',
+ 'sp.mode.act_handoff_button': 'Overschakelen naar Act en opnieuw proberen',
+ 'sp.mode.act_handoff_hint': 'Hiervoor is de Act-modus nodig. Klik om over te schakelen en je verzoek opnieuw te verzenden.',
'sp.mode.act': 'Handelen',
'sp.mode.act.title': 'Laat WebBrain voor u klikken, typen en navigeren',
'sp.mode.act.warning': 'Handelingsmodus: Gebruik op eigen risico.',
diff --git a/src/chrome/src/ui/locales/pl.js b/src/chrome/src/ui/locales/pl.js
index cc634a0b5..0defe11d8 100644
--- a/src/chrome/src/ui/locales/pl.js
+++ b/src/chrome/src/ui/locales/pl.js
@@ -117,8 +117,8 @@ export default {
"sp.input.selection_placeholder": "Zapytaj o zaznaczony tekst...",
'sp.mode.ask': 'Pytaj',
'sp.mode.ask.title': 'Zadawaj pytania o stronie — bez wprowadzania zmian',
- 'sp.mode.act_handoff_button': 'Switch to Act & retry',
- 'sp.mode.act_handoff_hint': 'This needs Act mode to complete. Click to switch and resend your request.',
+ 'sp.mode.act_handoff_button': 'Przełącz na Act i spróbuj ponownie',
+ 'sp.mode.act_handoff_hint': 'Do ukończenia potrzebny jest tryb Act. Kliknij, aby przełączyć tryb i ponownie wysłać żądanie.',
'sp.mode.act': 'Działaj',
'sp.mode.act.title': 'Pozwól WebBrain klikać, pisać i nawigować za Ciebie',
'sp.mode.act.warning': 'Tryb działania: Używasz na własne ryzyko.',
diff --git a/src/chrome/src/ui/locales/pt.js b/src/chrome/src/ui/locales/pt.js
index 16ed12145..8bf21b5bc 100644
--- a/src/chrome/src/ui/locales/pt.js
+++ b/src/chrome/src/ui/locales/pt.js
@@ -142,8 +142,8 @@ export default {
'sp.mode.ask': "Pergunte",
'sp.mode.ask.title': "Faça perguntas sobre a página – nenhuma alteração feita",
- 'sp.mode.act_handoff_button': 'Switch to Act & retry',
- 'sp.mode.act_handoff_hint': 'This needs Act mode to complete. Click to switch and resend your request.',
+ 'sp.mode.act_handoff_button': 'Mudar para Agir e tentar novamente',
+ 'sp.mode.act_handoff_hint': 'Para concluir, é necessário o modo Agir. Clique para mudar de modo e enviar novamente o pedido.',
'sp.mode.act': "Agir",
'sp.mode.act.title': "Deixe WebBrain clicar, digitar e navegar para você",
'sp.mode.act.warning': "Modo de ação: use por sua própria conta e risco.",
diff --git a/src/chrome/src/ui/locales/ru.js b/src/chrome/src/ui/locales/ru.js
index 5c00bf5a7..75435e169 100644
--- a/src/chrome/src/ui/locales/ru.js
+++ b/src/chrome/src/ui/locales/ru.js
@@ -174,8 +174,8 @@ export default {
'sp.mode.ask': 'Спросить',
'sp.mode.ask.title': 'Задавать вопросы о странице — без изменений',
- 'sp.mode.act_handoff_button': 'Switch to Act & retry',
- 'sp.mode.act_handoff_hint': 'This needs Act mode to complete. Click to switch and resend your request.',
+ 'sp.mode.act_handoff_button': 'Переключиться в режим действий и повторить',
+ 'sp.mode.act_handoff_hint': 'Для завершения нужен режим действий. Нажмите, чтобы переключиться и повторно отправить запрос.',
'sp.mode.act': 'Действовать',
'sp.mode.act.title': 'WebBrain сам нажимает, печатает и переходит по ссылкам',
'sp.mode.act.warning': 'Режим действия: Используйте на свой риск.',
diff --git a/src/chrome/src/ui/locales/th.js b/src/chrome/src/ui/locales/th.js
index 4e42cbff2..7379f583e 100644
--- a/src/chrome/src/ui/locales/th.js
+++ b/src/chrome/src/ui/locales/th.js
@@ -174,8 +174,8 @@ export default {
'sp.mode.ask': 'ถาม',
'sp.mode.ask.title': 'ถามเกี่ยวกับหน้านี้ — ไม่มีการเปลี่ยนแปลง',
- 'sp.mode.act_handoff_button': 'Switch to Act & retry',
- 'sp.mode.act_handoff_hint': 'This needs Act mode to complete. Click to switch and resend your request.',
+ 'sp.mode.act_handoff_button': 'สลับไปโหมด Act และลองอีกครั้ง',
+ 'sp.mode.act_handoff_hint': 'การดำเนินการนี้ต้องใช้โหมด Act คลิกเพื่อสลับโหมดและส่งคำขอของคุณอีกครั้ง',
'sp.mode.act': 'ทำ',
'sp.mode.act.title': 'ให้ WebBrain คลิก พิมพ์ และนำทางแทนคุณ',
'sp.mode.act.warning': 'โหมดทำ: ใช้งานด้วยความเสี่ยงของคุณเอง',
diff --git a/src/chrome/src/ui/locales/tl.js b/src/chrome/src/ui/locales/tl.js
index e5313e01d..f70722ffd 100644
--- a/src/chrome/src/ui/locales/tl.js
+++ b/src/chrome/src/ui/locales/tl.js
@@ -174,8 +174,8 @@ export default {
'sp.mode.ask': 'Tanong',
'sp.mode.ask.title': 'Magtanong tungkol sa pahina — walang ginagawang pagbabago',
- 'sp.mode.act_handoff_button': 'Switch to Act & retry',
- 'sp.mode.act_handoff_hint': 'This needs Act mode to complete. Click to switch and resend your request.',
+ 'sp.mode.act_handoff_button': 'Lumipat sa Act at subukan muli',
+ 'sp.mode.act_handoff_hint': 'Kailangan ng Act mode para makumpleto ito. I-click upang lumipat at ipadala muli ang iyong kahilingan.',
'sp.mode.act': 'Aksyon',
'sp.mode.act.title': 'Hayaan ang WebBrain na mag-click, mag-type, at mag-navigate para sa iyo',
'sp.mode.act.warning': 'Aksyon mode: Gamitin sa sariling panganib.',
diff --git a/src/chrome/src/ui/locales/tr.js b/src/chrome/src/ui/locales/tr.js
index 87e107e70..e573a9c32 100644
--- a/src/chrome/src/ui/locales/tr.js
+++ b/src/chrome/src/ui/locales/tr.js
@@ -210,8 +210,8 @@ export default {
'sp.mode.ask': 'Sor',
'sp.mode.ask.title': 'Sayfa hakkında soru sor — hiçbir değişiklik yapılmaz',
- 'sp.mode.act_handoff_button': 'Switch to Act & retry',
- 'sp.mode.act_handoff_hint': 'This needs Act mode to complete. Click to switch and resend your request.',
+ 'sp.mode.act_handoff_button': "Act'e geç ve yeniden dene",
+ 'sp.mode.act_handoff_hint': 'Bunu tamamlamak için Act modu gerekir. Geçiş yapmak ve isteğinizi yeniden göndermek için tıklayın.',
'sp.mode.act': 'Uygula',
'sp.mode.act.title': 'WebBrain senin yerine tıklasın, yazsın ve gezinsin',
'sp.mode.act.warning': 'Uygula modu: Kendi sorumluluğunda kullan.',
diff --git a/src/chrome/src/ui/locales/uk.js b/src/chrome/src/ui/locales/uk.js
index 4ceecc032..61dc44177 100644
--- a/src/chrome/src/ui/locales/uk.js
+++ b/src/chrome/src/ui/locales/uk.js
@@ -174,8 +174,8 @@ export default {
'sp.mode.ask': 'Запитати',
'sp.mode.ask.title': 'Ставити запитання про сторінку — без жодних змін',
- 'sp.mode.act_handoff_button': 'Switch to Act & retry',
- 'sp.mode.act_handoff_hint': 'This needs Act mode to complete. Click to switch and resend your request.',
+ 'sp.mode.act_handoff_button': 'Перейти в режим дії та повторити',
+ 'sp.mode.act_handoff_hint': 'Для завершення потрібен режим дії. Натисніть, щоб перемкнутися й повторно надіслати запит.',
'sp.mode.act': 'Діяти',
'sp.mode.act.title': 'WebBrain натискає, друкує і переходить за вас',
'sp.mode.act.warning': 'Режим дії: Використовуйте на власний ризик.',
diff --git a/src/chrome/src/ui/locales/vi.js b/src/chrome/src/ui/locales/vi.js
index 0a641a8db..2f1dbe5f5 100644
--- a/src/chrome/src/ui/locales/vi.js
+++ b/src/chrome/src/ui/locales/vi.js
@@ -142,8 +142,8 @@ export default {
'sp.mode.ask': "Hỏi",
'sp.mode.ask.title': "Đặt câu hỏi về trang — không thực hiện thay đổi nào",
- 'sp.mode.act_handoff_button': 'Switch to Act & retry',
- 'sp.mode.act_handoff_hint': 'This needs Act mode to complete. Click to switch and resend your request.',
+ 'sp.mode.act_handoff_button': 'Chuyển sang Act và thử lại',
+ 'sp.mode.act_handoff_hint': 'Cần chế độ Act để hoàn tất. Nhấp để chuyển chế độ và gửi lại yêu cầu.',
'sp.mode.act': "hành động",
'sp.mode.act.title': "Hãy để WebBrain nhấp, nhập và điều hướng cho bạn",
'sp.mode.act.warning': "Chế độ hành động: Sử dụng có nguy cơ của riêng bạn.",
diff --git a/src/chrome/src/ui/locales/zh.js b/src/chrome/src/ui/locales/zh.js
index fb078a2ff..1ad6ebe40 100644
--- a/src/chrome/src/ui/locales/zh.js
+++ b/src/chrome/src/ui/locales/zh.js
@@ -174,8 +174,8 @@ export default {
'sp.mode.ask': '问',
'sp.mode.ask.title': '就页面提问 — 不做任何修改',
- 'sp.mode.act_handoff_button': 'Switch to Act & retry',
- 'sp.mode.act_handoff_hint': 'This needs Act mode to complete. Click to switch and resend your request.',
+ 'sp.mode.act_handoff_button': '切换到执行并重试',
+ 'sp.mode.act_handoff_hint': '完成此操作需要执行模式。点击切换模式并重新发送请求。',
'sp.mode.act': '执行',
'sp.mode.act.title': '让 WebBrain 代你点击、输入和导航',
'sp.mode.act.warning': '执行模式:请自行承担风险。',
diff --git a/src/firefox/src/agent/agent.js b/src/firefox/src/agent/agent.js
index e81aedefa..2712893d5 100644
--- a/src/firefox/src/agent/agent.js
+++ b/src/firefox/src/agent/agent.js
@@ -17750,11 +17750,13 @@ Rules: no prose intro, no conclusion, no "this screenshot shows...", no layout d
|| typeof finalResponse !== 'string'
|| finalResponse.trim().length < 8
|| this._checkAbort(tabId)
- || isSelectionSourceGrounding(runOptions?.sourceGrounding)) {
+ || isSelectionSourceGrounding(runOptions?.sourceGrounding)
+ || this.selectionGroundingScopes.has(tabId)) {
return;
}
try {
const provider = this._activeProvider(tabId);
+ const costState = this.currentCostState.get(tabId) || null;
const { tabUrl, tabTitle } = await this._getTabUrlTitle(tabId);
const messages = buildAskModeHandoffMessages(userMessage, finalResponse, tabUrl, tabTitle);
const response = await this._withContentActionDeadline(
@@ -17767,7 +17769,7 @@ Rules: no prose intro, no conclusion, no "this screenshot shows...", no layout d
maxTokens: 24,
signal,
},
- this.currentCostState.get(tabId) || null,
+ costState,
{ tabId, generationName: 'ask_mode_handoff' },
),
'ask_mode_handoff',
@@ -33292,7 +33294,7 @@ Rules: no prose intro, no conclusion, no "this screenshot shows...", no layout d
}
try {
const result = await this._processMessageInner(tabId, userMessage, onUpdate, mode, attachments, runOptions);
- await this._maybeEmitAskModeHandoff(tabId, mode, userMessage, result, onUpdate, runOptions);
+ void this._maybeEmitAskModeHandoff(tabId, mode, userMessage, result, onUpdate, runOptions);
return result;
} finally {
this.currentCostState.delete(tabId);
@@ -34655,7 +34657,7 @@ Rules: no prose intro, no conclusion, no "this screenshot shows...", no layout d
}
try {
const result = await this._processMessageStreamInner(tabId, userMessage, onUpdate, mode, runOptions);
- await this._maybeEmitAskModeHandoff(tabId, mode, userMessage, result, onUpdate, runOptions);
+ void this._maybeEmitAskModeHandoff(tabId, mode, userMessage, result, onUpdate, runOptions);
return result;
} finally {
this.currentCostState.delete(tabId);
diff --git a/src/firefox/src/ui/locales/ar.js b/src/firefox/src/ui/locales/ar.js
index 04700989e..3d5fa40db 100644
--- a/src/firefox/src/ui/locales/ar.js
+++ b/src/firefox/src/ui/locales/ar.js
@@ -174,8 +174,8 @@ export default {
'sp.mode.ask': 'سؤال',
'sp.mode.ask.title': 'اطرح أسئلة عن الصفحة — دون إجراء أي تغييرات',
- 'sp.mode.act_handoff_button': 'Switch to Act & retry',
- 'sp.mode.act_handoff_hint': 'This needs Act mode to complete. Click to switch and resend your request.',
+ 'sp.mode.act_handoff_button': 'التبديل إلى التنفيذ وإعادة المحاولة',
+ 'sp.mode.act_handoff_hint': 'يتطلب هذا وضع التنفيذ لإكماله. انقر للتبديل وإعادة إرسال طلبك.',
'sp.mode.act': 'تنفيذ',
'sp.mode.act.title': 'دع WebBrain ينقر ويكتب ويتنقّل نيابةً عنك',
'sp.mode.act.warning': 'وضع التنفيذ: استخدمه على مسؤوليتك.',
diff --git a/src/firefox/src/ui/locales/bn.js b/src/firefox/src/ui/locales/bn.js
index 78b9b4767..85841cc36 100644
--- a/src/firefox/src/ui/locales/bn.js
+++ b/src/firefox/src/ui/locales/bn.js
@@ -142,8 +142,8 @@ export default {
'sp.mode.ask': "জিজ্ঞাসা করুন",
'sp.mode.ask.title': "পৃষ্ঠা সম্পর্কে প্রশ্ন জিজ্ঞাসা করুন — কোন পরিবর্তন করা হয়নি",
- 'sp.mode.act_handoff_button': 'Switch to Act & retry',
- 'sp.mode.act_handoff_hint': 'This needs Act mode to complete. Click to switch and resend your request.',
+ 'sp.mode.act_handoff_button': 'অ্যাক্ট মোডে বদলে আবার চেষ্টা করুন',
+ 'sp.mode.act_handoff_hint': 'এটি সম্পূর্ণ করতে অ্যাক্ট মোড প্রয়োজন। মোড বদলাতে এবং আপনার অনুরোধটি আবার পাঠাতে ক্লিক করুন।',
'sp.mode.act': "আইন",
'sp.mode.act.title': "আপনার জন্য WebBrain ক্লিক করুন, টাইপ করুন এবং নেভিগেট করুন",
'sp.mode.act.warning': "অ্যাক্ট মোড: আপনার নিজের ঝুঁকিতে ব্যবহার করুন।",
diff --git a/src/firefox/src/ui/locales/de.js b/src/firefox/src/ui/locales/de.js
index 0dad59a04..4dcc8ae83 100644
--- a/src/firefox/src/ui/locales/de.js
+++ b/src/firefox/src/ui/locales/de.js
@@ -139,8 +139,8 @@ export default {
"sp.input.selection_placeholder": "Frage zum ausgewählten Text...",
'sp.mode.ask': 'Fragen',
'sp.mode.ask.title': 'Fragen zur Seite stellen — keine Änderungen',
- 'sp.mode.act_handoff_button': 'Switch to Act & retry',
- 'sp.mode.act_handoff_hint': 'This needs Act mode to complete. Click to switch and resend your request.',
+ 'sp.mode.act_handoff_button': 'Zu Act wechseln und erneut versuchen',
+ 'sp.mode.act_handoff_hint': 'Zum Abschließen wird der Act-Modus benötigt. Klicken Sie, um zu wechseln und Ihre Anfrage erneut zu senden.',
'sp.mode.act': 'Handeln',
'sp.mode.act.title': 'Lassen Sie WebBrain für Sie klicken, tippen und navigieren',
'sp.mode.act.warning': 'Handeln-Modus: Nutzung auf eigenes Risiko.',
diff --git a/src/firefox/src/ui/locales/es.js b/src/firefox/src/ui/locales/es.js
index 432d260ce..57777bb65 100644
--- a/src/firefox/src/ui/locales/es.js
+++ b/src/firefox/src/ui/locales/es.js
@@ -174,8 +174,8 @@ export default {
'sp.mode.ask': 'Preguntar',
'sp.mode.ask.title': 'Haz preguntas sobre la página — sin hacer cambios',
- 'sp.mode.act_handoff_button': 'Switch to Act & retry',
- 'sp.mode.act_handoff_hint': 'This needs Act mode to complete. Click to switch and resend your request.',
+ 'sp.mode.act_handoff_button': 'Cambiar a Actuar y reintentar',
+ 'sp.mode.act_handoff_hint': 'Esto requiere el modo Actuar para completarse. Haz clic para cambiar y reenviar tu solicitud.',
'sp.mode.act': 'Actuar',
'sp.mode.act.title': 'Deja que WebBrain haga clic, escriba y navegue por ti',
'sp.mode.act.warning': 'Modo Actuar: Úsalo bajo tu propia responsabilidad.',
diff --git a/src/firefox/src/ui/locales/fa.js b/src/firefox/src/ui/locales/fa.js
index fc18c2cb0..b567673be 100644
--- a/src/firefox/src/ui/locales/fa.js
+++ b/src/firefox/src/ui/locales/fa.js
@@ -142,8 +142,8 @@ export default {
'sp.mode.ask': "بپرسید",
'sp.mode.ask.title': "درباره صفحه سوال بپرسید — هیچ تغییری ایجاد نشده است",
- 'sp.mode.act_handoff_button': 'Switch to Act & retry',
- 'sp.mode.act_handoff_hint': 'This needs Act mode to complete. Click to switch and resend your request.',
+ 'sp.mode.act_handoff_button': 'تغییر به حالت عمل و تلاش مجدد',
+ 'sp.mode.act_handoff_hint': 'برای تکمیل این کار به حالت عمل نیاز است. برای تغییر حالت و ارسال دوباره درخواست کلیک کنید.',
'sp.mode.act': "عمل کنید",
'sp.mode.act.title': "اجازه دهید WebBrain کلیک کند، تایپ کند و برای شما حرکت کند",
'sp.mode.act.warning': "حالت عمل: با مسئولیت خود استفاده کنید.",
diff --git a/src/firefox/src/ui/locales/fr.js b/src/firefox/src/ui/locales/fr.js
index 20887ab9e..fa9ff6e0b 100644
--- a/src/firefox/src/ui/locales/fr.js
+++ b/src/firefox/src/ui/locales/fr.js
@@ -174,8 +174,8 @@ export default {
'sp.mode.ask': 'Demander',
'sp.mode.ask.title': 'Posez des questions sur la page — aucune modification',
- 'sp.mode.act_handoff_button': 'Switch to Act & retry',
- 'sp.mode.act_handoff_hint': 'This needs Act mode to complete. Click to switch and resend your request.',
+ 'sp.mode.act_handoff_button': 'Passer à Agir et réessayer',
+ 'sp.mode.act_handoff_hint': 'Le mode Agir est nécessaire pour terminer cette tâche. Cliquez pour changer de mode et renvoyer votre demande.',
'sp.mode.act': 'Agir',
'sp.mode.act.title': 'Laissez WebBrain cliquer, taper et naviguer à votre place',
'sp.mode.act.warning': 'Mode Agir : utilisez-le à vos propres risques.',
diff --git a/src/firefox/src/ui/locales/he.js b/src/firefox/src/ui/locales/he.js
index 9a8bb875f..fad4918d5 100644
--- a/src/firefox/src/ui/locales/he.js
+++ b/src/firefox/src/ui/locales/he.js
@@ -139,8 +139,8 @@ export default {
"sp.input.selection_placeholder": "שאלו על הטקסט שנבחר...",
"sp.mode.ask": "שאל",
"sp.mode.ask.title": "שאל שאלות על הדף - לא בוצעו שינויים",
- "sp.mode.act_handoff_button": 'Switch to Act & retry',
- "sp.mode.act_handoff_hint": 'This needs Act mode to complete. Click to switch and resend your request.',
+ "sp.mode.act_handoff_button": 'עבור לפעולה ונסה שוב',
+ "sp.mode.act_handoff_hint": 'להשלמת הפעולה הזו נדרש מצב פעולה. לחצו כדי לעבור למצב זה ולשלוח מחדש את הבקשה.',
"sp.mode.act": "פעולה",
"sp.mode.act.title": "אפשר ל-WebBrain ללחוץ, להקליד ולנווט עבורך",
"sp.mode.act.warning": "מצב פעולה: השימוש על אחריותך בלבד.",
diff --git a/src/firefox/src/ui/locales/hi.js b/src/firefox/src/ui/locales/hi.js
index f6a3d5286..e82194ec2 100644
--- a/src/firefox/src/ui/locales/hi.js
+++ b/src/firefox/src/ui/locales/hi.js
@@ -142,8 +142,8 @@ export default {
'sp.mode.ask': "पूछो",
'sp.mode.ask.title': "पृष्ठ के बारे में प्रश्न पूछें - कोई परिवर्तन नहीं किया गया",
- 'sp.mode.act_handoff_button': 'Switch to Act & retry',
- 'sp.mode.act_handoff_hint': 'This needs Act mode to complete. Click to switch and resend your request.',
+ 'sp.mode.act_handoff_button': 'एक्ट पर स्विच करें और फिर कोशिश करें',
+ 'sp.mode.act_handoff_hint': 'इसे पूरा करने के लिए एक्ट मोड आवश्यक है। मोड बदलने और अपना अनुरोध फिर भेजने के लिए क्लिक करें।',
'sp.mode.act': "अधिनियम",
'sp.mode.act.title': "WebBrain को आपके लिए क्लिक करने, टाइप करने और नेविगेट करने दें",
'sp.mode.act.warning': "अधिनियम मोड: अपने जोखिम पर उपयोग करें।",
diff --git a/src/firefox/src/ui/locales/id.js b/src/firefox/src/ui/locales/id.js
index 953a38eb9..ffbd917c1 100644
--- a/src/firefox/src/ui/locales/id.js
+++ b/src/firefox/src/ui/locales/id.js
@@ -174,8 +174,8 @@ export default {
'sp.mode.ask': 'Tanya',
'sp.mode.ask.title': 'Bertanya tentang halaman — tanpa perubahan',
- 'sp.mode.act_handoff_button': 'Switch to Act & retry',
- 'sp.mode.act_handoff_hint': 'This needs Act mode to complete. Click to switch and resend your request.',
+ 'sp.mode.act_handoff_button': 'Beralih ke Aksi & coba lagi',
+ 'sp.mode.act_handoff_hint': 'Ini memerlukan mode Aksi untuk diselesaikan. Klik untuk beralih dan mengirim ulang permintaan Anda.',
'sp.mode.act': 'Aksi',
'sp.mode.act.title': 'Biarkan WebBrain mengeklik, mengetik, dan menavigasi untukmu',
'sp.mode.act.warning': 'Mode aksi: Gunakan dengan risiko Anda sendiri.',
diff --git a/src/firefox/src/ui/locales/ja.js b/src/firefox/src/ui/locales/ja.js
index aedde9e4f..bd0068edf 100644
--- a/src/firefox/src/ui/locales/ja.js
+++ b/src/firefox/src/ui/locales/ja.js
@@ -174,8 +174,8 @@ export default {
'sp.mode.ask': '質問',
'sp.mode.ask.title': 'ページについて質問する — 変更は行いません',
- 'sp.mode.act_handoff_button': 'Switch to Act & retry',
- 'sp.mode.act_handoff_hint': 'This needs Act mode to complete. Click to switch and resend your request.',
+ 'sp.mode.act_handoff_button': 'Actに切り替えて再試行',
+ 'sp.mode.act_handoff_hint': '完了するにはActモードが必要です。クリックして切り替え、リクエストを再送信してください。',
'sp.mode.act': '操作',
'sp.mode.act.title': 'WebBrain にクリック・入力・操作を任せる',
'sp.mode.act.warning': '操作モード:自己責任でご利用ください。',
diff --git a/src/firefox/src/ui/locales/ko.js b/src/firefox/src/ui/locales/ko.js
index 88a4dd41e..2fd7fe4c2 100644
--- a/src/firefox/src/ui/locales/ko.js
+++ b/src/firefox/src/ui/locales/ko.js
@@ -174,8 +174,8 @@ export default {
'sp.mode.ask': '질문',
'sp.mode.ask.title': '페이지에 대해 질문 — 변경은 하지 않습니다',
- 'sp.mode.act_handoff_button': 'Switch to Act & retry',
- 'sp.mode.act_handoff_hint': 'This needs Act mode to complete. Click to switch and resend your request.',
+ 'sp.mode.act_handoff_button': 'Act로 전환하고 다시 시도',
+ 'sp.mode.act_handoff_hint': '완료하려면 Act 모드가 필요합니다. 클릭하여 전환한 후 요청을 다시 보내세요.',
'sp.mode.act': '실행',
'sp.mode.act.title': 'WebBrain이 클릭, 입력, 이동을 대신합니다',
'sp.mode.act.warning': '실행 모드: 위험을 감수하고 사용하세요.',
diff --git a/src/firefox/src/ui/locales/ms.js b/src/firefox/src/ui/locales/ms.js
index 56496cf15..3e4e1140c 100644
--- a/src/firefox/src/ui/locales/ms.js
+++ b/src/firefox/src/ui/locales/ms.js
@@ -174,8 +174,8 @@ export default {
'sp.mode.ask': 'Tanya',
'sp.mode.ask.title': 'Tanya soalan tentang halaman — tiada perubahan dibuat',
- 'sp.mode.act_handoff_button': 'Switch to Act & retry',
- 'sp.mode.act_handoff_hint': 'This needs Act mode to complete. Click to switch and resend your request.',
+ 'sp.mode.act_handoff_button': 'Tukar ke Act & cuba lagi',
+ 'sp.mode.act_handoff_hint': 'Ini memerlukan mod Act untuk diselesaikan. Klik untuk menukar dan hantar semula permintaan anda.',
'sp.mode.act': 'Lakukan',
'sp.mode.act.title': 'Biarkan WebBrain mengklik, menaip, dan menavigasi untuk anda',
'sp.mode.act.warning': 'Mod Lakukan: Gunakan atas risiko anda sendiri.',
diff --git a/src/firefox/src/ui/locales/nl.js b/src/firefox/src/ui/locales/nl.js
index 9adbb77b0..b6ad25820 100644
--- a/src/firefox/src/ui/locales/nl.js
+++ b/src/firefox/src/ui/locales/nl.js
@@ -139,8 +139,8 @@ export default {
"sp.input.selection_placeholder": "Vraag over de geselecteerde tekst...",
'sp.mode.ask': 'Vragen',
'sp.mode.ask.title': 'Vragen stellen over de pagina — er worden geen wijzigingen aangebracht',
- 'sp.mode.act_handoff_button': 'Switch to Act & retry',
- 'sp.mode.act_handoff_hint': 'This needs Act mode to complete. Click to switch and resend your request.',
+ 'sp.mode.act_handoff_button': 'Overschakelen naar Act en opnieuw proberen',
+ 'sp.mode.act_handoff_hint': 'Hiervoor is de Act-modus nodig. Klik om over te schakelen en je verzoek opnieuw te verzenden.',
'sp.mode.act': 'Handelen',
'sp.mode.act.title': 'Laat WebBrain voor u klikken, typen en navigeren',
'sp.mode.act.warning': 'Handelingsmodus: Gebruik op eigen risico.',
diff --git a/src/firefox/src/ui/locales/pl.js b/src/firefox/src/ui/locales/pl.js
index 9f10f5747..607f29382 100644
--- a/src/firefox/src/ui/locales/pl.js
+++ b/src/firefox/src/ui/locales/pl.js
@@ -117,8 +117,8 @@ export default {
"sp.input.selection_placeholder": "Zapytaj o zaznaczony tekst...",
'sp.mode.ask': 'Pytaj',
'sp.mode.ask.title': 'Zadawaj pytania o stronie — bez wprowadzania zmian',
- 'sp.mode.act_handoff_button': 'Switch to Act & retry',
- 'sp.mode.act_handoff_hint': 'This needs Act mode to complete. Click to switch and resend your request.',
+ 'sp.mode.act_handoff_button': 'Przełącz na Act i spróbuj ponownie',
+ 'sp.mode.act_handoff_hint': 'Do ukończenia potrzebny jest tryb Act. Kliknij, aby przełączyć tryb i ponownie wysłać żądanie.',
'sp.mode.act': 'Działaj',
'sp.mode.act.title': 'Pozwól WebBrain klikać, pisać i nawigować za Ciebie',
'sp.mode.act.warning': 'Tryb działania: Używasz na własne ryzyko.',
diff --git a/src/firefox/src/ui/locales/pt.js b/src/firefox/src/ui/locales/pt.js
index 629df4aa7..202e28745 100644
--- a/src/firefox/src/ui/locales/pt.js
+++ b/src/firefox/src/ui/locales/pt.js
@@ -142,8 +142,8 @@ export default {
'sp.mode.ask': "Pergunte",
'sp.mode.ask.title': "Faça perguntas sobre a página – nenhuma alteração feita",
- 'sp.mode.act_handoff_button': 'Switch to Act & retry',
- 'sp.mode.act_handoff_hint': 'This needs Act mode to complete. Click to switch and resend your request.',
+ 'sp.mode.act_handoff_button': 'Mudar para Agir e tentar novamente',
+ 'sp.mode.act_handoff_hint': 'Para concluir, é necessário o modo Agir. Clique para mudar de modo e enviar novamente o pedido.',
'sp.mode.act': "Agir",
'sp.mode.act.title': "Deixe WebBrain clicar, digitar e navegar para você",
'sp.mode.act.warning': "Modo de ação: use por sua própria conta e risco.",
diff --git a/src/firefox/src/ui/locales/ru.js b/src/firefox/src/ui/locales/ru.js
index e93a1da0d..f3a5e1dfd 100644
--- a/src/firefox/src/ui/locales/ru.js
+++ b/src/firefox/src/ui/locales/ru.js
@@ -174,8 +174,8 @@ export default {
'sp.mode.ask': 'Спросить',
'sp.mode.ask.title': 'Задавать вопросы о странице — без изменений',
- 'sp.mode.act_handoff_button': 'Switch to Act & retry',
- 'sp.mode.act_handoff_hint': 'This needs Act mode to complete. Click to switch and resend your request.',
+ 'sp.mode.act_handoff_button': 'Переключиться в режим действий и повторить',
+ 'sp.mode.act_handoff_hint': 'Для завершения нужен режим действий. Нажмите, чтобы переключиться и повторно отправить запрос.',
'sp.mode.act': 'Действовать',
'sp.mode.act.title': 'WebBrain сам нажимает, печатает и переходит по ссылкам',
'sp.mode.act.warning': 'Режим действия: Используйте на свой риск.',
diff --git a/src/firefox/src/ui/locales/th.js b/src/firefox/src/ui/locales/th.js
index fa89f5b4d..411173efa 100644
--- a/src/firefox/src/ui/locales/th.js
+++ b/src/firefox/src/ui/locales/th.js
@@ -174,8 +174,8 @@ export default {
'sp.mode.ask': 'ถาม',
'sp.mode.ask.title': 'ถามเกี่ยวกับหน้านี้ — ไม่มีการเปลี่ยนแปลง',
- 'sp.mode.act_handoff_button': 'Switch to Act & retry',
- 'sp.mode.act_handoff_hint': 'This needs Act mode to complete. Click to switch and resend your request.',
+ 'sp.mode.act_handoff_button': 'สลับไปโหมด Act และลองอีกครั้ง',
+ 'sp.mode.act_handoff_hint': 'การดำเนินการนี้ต้องใช้โหมด Act คลิกเพื่อสลับโหมดและส่งคำขอของคุณอีกครั้ง',
'sp.mode.act': 'ทำ',
'sp.mode.act.title': 'ให้ WebBrain คลิก พิมพ์ และนำทางแทนคุณ',
'sp.mode.act.warning': 'โหมดทำ: ใช้งานด้วยความเสี่ยงของคุณเอง',
diff --git a/src/firefox/src/ui/locales/tl.js b/src/firefox/src/ui/locales/tl.js
index d0e904dd3..ed6eff52d 100644
--- a/src/firefox/src/ui/locales/tl.js
+++ b/src/firefox/src/ui/locales/tl.js
@@ -174,8 +174,8 @@ export default {
'sp.mode.ask': 'Tanong',
'sp.mode.ask.title': 'Magtanong tungkol sa pahina — walang ginagawang pagbabago',
- 'sp.mode.act_handoff_button': 'Switch to Act & retry',
- 'sp.mode.act_handoff_hint': 'This needs Act mode to complete. Click to switch and resend your request.',
+ 'sp.mode.act_handoff_button': 'Lumipat sa Act at subukan muli',
+ 'sp.mode.act_handoff_hint': 'Kailangan ng Act mode para makumpleto ito. I-click upang lumipat at ipadala muli ang iyong kahilingan.',
'sp.mode.act': 'Aksyon',
'sp.mode.act.title': 'Hayaan ang WebBrain na mag-click, mag-type, at mag-navigate para sa iyo',
'sp.mode.act.warning': 'Aksyon mode: Gamitin sa sariling panganib.',
diff --git a/src/firefox/src/ui/locales/tr.js b/src/firefox/src/ui/locales/tr.js
index 4f77f48a7..bb7399fbd 100644
--- a/src/firefox/src/ui/locales/tr.js
+++ b/src/firefox/src/ui/locales/tr.js
@@ -210,8 +210,8 @@ export default {
'sp.mode.ask': 'Sor',
'sp.mode.ask.title': 'Sayfa hakkında soru sor — hiçbir değişiklik yapılmaz',
- 'sp.mode.act_handoff_button': 'Switch to Act & retry',
- 'sp.mode.act_handoff_hint': 'This needs Act mode to complete. Click to switch and resend your request.',
+ 'sp.mode.act_handoff_button': "Act'e geç ve yeniden dene",
+ 'sp.mode.act_handoff_hint': 'Bunu tamamlamak için Act modu gerekir. Geçiş yapmak ve isteğinizi yeniden göndermek için tıklayın.',
'sp.mode.act': 'Uygula',
'sp.mode.act.title': 'WebBrain senin yerine tıklasın, yazsın ve gezinsin',
'sp.mode.act.warning': 'Uygula modu: Kendi sorumluluğunda kullan.',
diff --git a/src/firefox/src/ui/locales/uk.js b/src/firefox/src/ui/locales/uk.js
index b00468688..19f68c82f 100644
--- a/src/firefox/src/ui/locales/uk.js
+++ b/src/firefox/src/ui/locales/uk.js
@@ -174,8 +174,8 @@ export default {
'sp.mode.ask': 'Запитати',
'sp.mode.ask.title': 'Ставити запитання про сторінку — без жодних змін',
- 'sp.mode.act_handoff_button': 'Switch to Act & retry',
- 'sp.mode.act_handoff_hint': 'This needs Act mode to complete. Click to switch and resend your request.',
+ 'sp.mode.act_handoff_button': 'Перейти в режим дії та повторити',
+ 'sp.mode.act_handoff_hint': 'Для завершення потрібен режим дії. Натисніть, щоб перемкнутися й повторно надіслати запит.',
'sp.mode.act': 'Діяти',
'sp.mode.act.title': 'WebBrain натискає, друкує і переходить за вас',
'sp.mode.act.warning': 'Режим дії: Використовуйте на власний ризик.',
diff --git a/src/firefox/src/ui/locales/vi.js b/src/firefox/src/ui/locales/vi.js
index d060161c5..813f35c33 100644
--- a/src/firefox/src/ui/locales/vi.js
+++ b/src/firefox/src/ui/locales/vi.js
@@ -142,8 +142,8 @@ export default {
'sp.mode.ask': "Hỏi",
'sp.mode.ask.title': "Đặt câu hỏi về trang — không thực hiện thay đổi nào",
- 'sp.mode.act_handoff_button': 'Switch to Act & retry',
- 'sp.mode.act_handoff_hint': 'This needs Act mode to complete. Click to switch and resend your request.',
+ 'sp.mode.act_handoff_button': 'Chuyển sang Act và thử lại',
+ 'sp.mode.act_handoff_hint': 'Cần chế độ Act để hoàn tất. Nhấp để chuyển chế độ và gửi lại yêu cầu.',
'sp.mode.act': "hành động",
'sp.mode.act.title': "Hãy để WebBrain nhấp, nhập và điều hướng cho bạn",
'sp.mode.act.warning': "Chế độ hành động: Sử dụng có nguy cơ của riêng bạn.",
diff --git a/src/firefox/src/ui/locales/zh.js b/src/firefox/src/ui/locales/zh.js
index 7643c4b74..b6314f7cc 100644
--- a/src/firefox/src/ui/locales/zh.js
+++ b/src/firefox/src/ui/locales/zh.js
@@ -174,8 +174,8 @@ export default {
'sp.mode.ask': '问',
'sp.mode.ask.title': '就页面提问 — 不做任何修改',
- 'sp.mode.act_handoff_button': 'Switch to Act & retry',
- 'sp.mode.act_handoff_hint': 'This needs Act mode to complete. Click to switch and resend your request.',
+ 'sp.mode.act_handoff_button': '切换到执行并重试',
+ 'sp.mode.act_handoff_hint': '完成此操作需要执行模式。点击切换模式并重新发送请求。',
'sp.mode.act': '执行',
'sp.mode.act.title': '让 WebBrain 代你点击、输入和导航',
'sp.mode.act.warning': '执行模式:请自行承担风险。',
diff --git a/test/run.js b/test/run.js
index bc77e271d..e385f27a8 100644
--- a/test/run.js
+++ b/test/run.js
@@ -11997,6 +11997,7 @@ test('Ask mode handoff classification is strict, silent, and mode guarded', asyn
const agent = new AgentClass({ getActive: () => provider, getVisionProvider: async () => null });
const updates = [];
const deadlineCalls = [];
+ const costState = { spentUsd: 0 };
let calls = 0;
agent._getTabUrlTitle = async () => ({
tabUrl: 'https://example.com/page',
@@ -12009,6 +12010,9 @@ test('Ask mode handoff classification is strict, silent, and mode guarded', asyn
};
agent._chatWithCostAllowance = async (_provider, messages, options, _costState, metadata) => {
calls += 1;
+ if (_costState) {
+ assert.equal(_costState, costState, `${browserLabel}: handoff classifier must use the active cost state`);
+ }
assert.equal(metadata?.generationName, 'ask_mode_handoff', `${browserLabel}: wrong classifier generation`);
assert.equal(options.maxTokens, 24, `${browserLabel}: handoff classifier budget should stay small`);
assert.ok(options.signal, `${browserLabel}: handoff classifier must receive an abort signal`);
@@ -12016,10 +12020,11 @@ test('Ask mode handoff classification is strict, silent, and mode guarded', asyn
assert.match(messages[1]?.content || '', /<assistant_answer>/, `${browserLabel}: answer was not included in classifier input`);
return { content: response, usage: {} };
};
- return { agent, updates, deadlineCalls, get calls() { return calls; } };
+ return { agent, updates, costState, deadlineCalls, get calls() { return calls; } };
};
const successful = createAgent();
+ successful.agent.currentCostState.set(53000, successful.costState);
const finalResponse = 'Ask mode cannot click the button. Switch to Act mode to complete this request.';
await successful.agent._maybeEmitAskModeHandoff(
53000, 'ask', 'Click the button', finalResponse,
@@ -12057,6 +12062,13 @@ test('Ask mode handoff classification is strict, silent, and mode guarded', asyn
await aborted.agent._maybeEmitAskModeHandoff(53004, 'ask', 'Click the button', finalResponse, () => {}, {});
assert.equal(aborted.calls, 0, `${browserLabel}: cancelled run invoked classifier`);
+ const inheritedSelection = createAgent();
+ inheritedSelection.agent.selectionGroundingScopes.set(53008, { anchorIndex: 1 });
+ await inheritedSelection.agent._maybeEmitAskModeHandoff(
+ 53008, 'ask', 'Click the button', finalResponse, () => {}, {},
+ );
+ assert.equal(inheritedSelection.calls, 0, `${browserLabel}: inherited selection scope invoked classifier`);
+
for (const response of ['not JSON', '{"mode_handoff":"maybe"}']) {
const invalid = createAgent(response);
const invalidUpdates = [];
@@ -12090,6 +12102,24 @@ test('Ask mode handoff classification is strict, silent, and mode guarded', asyn
}
});
+test('Ask mode handoff classification is detached from completion', () => {
+ for (const [browserLabel, source] of [
+ ['chrome', fs.readFileSync(path.join(ROOT, 'src/chrome/src/agent/agent.js'), 'utf8')],
+ ['firefox', fs.readFileSync(path.join(ROOT, 'src/firefox/src/agent/agent.js'), 'utf8')],
+ ]) {
+ assert.match(
+ source,
+ /const result = await this\._processMessageInner\([\s\S]*?\n\s+void this\._maybeEmitAskModeHandoff\(/,
+ `${browserLabel}: non-streaming completion must not await handoff classification`,
+ );
+ assert.match(
+ source,
+ /const result = await this\._processMessageStreamInner\([\s\S]*?\n\s+void this\._maybeEmitAskModeHandoff\(/,
+ `${browserLabel}: streaming completion must not await handoff classification`,
+ );
+ }
+});
+
// trace event model — shared kind catalog and envelope validation
// ────────────────────────────────────────────────────────────────────────