Open-source AI browser agent for Chrome and Firefox (monorepo) ðŸ§
JavaScript ai-agentai-agentsai-toolsbrowser-aibrowser-automationbrowser-extensionchrome-aichrome-devtoolschrome-extensionchrome-extensionsfirefox-addonfirefox-addonsfirefox-extensionfirefox-extensionsgemmagemma4minimaxoffline-aioffline-llmqwen
Require the follow-up trim option in the selection shortcut check
Claude4ba1f4a6955e
diff --git a/test/run.js b/test/run.jsindex 691c52dc4..cd76d588a 100644--- a/test/run.js+++ b/test/run.js@@ -56152,8 +56152,9 @@ test('selection shortcut is shipped, enabled by default, and keeps browser-speciassert.match(background, /buildSelectionPrompt\(info\.selectionText, 'translate', '', menuItemId\.slice\(CONTEXT_MENU_TRANSLATE_PREFIX\.length\)\)/, `${label}: native language choices should use the safe selection prompt builder`);assert.match(background, /const includePageContext = selectionAction === 'custom' && msg\.includePageContext === true;/, `${label}: only an explicit custom-question choice should enable normal page context`);assert.match(background, /const sourceGrounding = includePageContext\s*\? ''\s*:\s*selectionAction === 'custom'[\s\S]*?SELECTION_CONTEXT_SOURCE_GROUNDING[\s\S]*?: SELECTION_ONLY_SOURCE_GROUNDING;/, `${label}: checked custom questions should be unscoped while unchecked custom questions and presets retain their source policies`);- // A follow-up about a card's answer keeps the whole selection (trim: false).- assert.match(background, /const text = resumesCutOffAnswer[\s\S]*?: includePageContext\s*\? buildFullContextSelectionPrompt\(selectionText, msg\.question(?:, \{ trim: !msg\.priorAnswer \})?\)[\s\S]*?: buildSelectionPrompt\(/, `${label}: checked custom questions should use the full-context selection prompt`);+ // A follow-up about a card's answer keeps its whole text: the prompt is not+ // trimmed when the message carries the card's answer (priorAnswer).+ assert.match(background, /const text = resumesCutOffAnswer[\s\S]*?: includePageContext\s*\? buildFullContextSelectionPrompt\(selectionText, msg\.question, \{ trim: !msg\.priorAnswer \}\)[\s\S]*?: buildSelectionPrompt\(/, `${label}: checked custom questions should use the full-context selection prompt`);assert.match(background, /\.\.\.\(sourceGrounding \? \{[\s\S]*?sourceGrounding,[\s\S]*?selectionAction[\s\S]*?\} : \{\}\)/, `${label}: full-context custom questions should not create a durable selection scope`);assert.match(background, /\.\.\.\(includePageContext \? \{ restoreSelectionScope: true \} : \{\}\)/, `${label}: checked custom questions should carry a transactional request to clear any older selection scope`);assert.match(background, /if \(msg\.restoreSelectionScope === true && !normalizeSelectionSourceGrounding\(msg\.sourceGrounding\)\) \{[\s\S]*?await agent\.restoreSelectionGroundingScope\(tabId\);/, `${label}: full-context custom questions should hydrate and clear an older durable selection scope only when their unscoped queued run starts`);