Closed Bug 2090794 Opened 27 days ago Closed 26 days ago

Perma browser/components/aiwindow/models/tests/browser/browser_aitab.js | test_modification_keeps_links_from_earlier_turns - The stored exchange holds no URL tokens. - false == true

Categories

(Core :: Machine Learning: General, defect, P5)

defect

Tracking

()

RESOLVED FIXED
162 Branch
Tracking Status
firefox-esr153 --- unaffected
firefox160 --- fixed
firefox161 --- fixed
firefox162 --- fixed

People

(Reporter: intermittent-bug-filer, Assigned: RyanVM)

References

(Regression)

Details

(Keywords: intermittent-failure, intermittent-testcase, regression, Whiteboard: [collect_confirm_failure])

Filed by: ctuns [at] mozilla.com
Parsed log: https://treeherder.mozilla.org/logviewer?job_id=605749772&repo=autoland&task=KprBC4h-SvW87QF1y8LY1A.0
Full log: https://firefox-ci-tc.services.mozilla.com/api/queue/v1/task/KprBC4h-SvW87QF1y8LY1A/runs/0/artifacts/public/logs/live_backing.log


[task 2026-11-08T20:35:58.473+00:00] 20:35:58     INFO - TEST-PASS | browser/components/aiwindow/models/tests/browser/browser_aitab.js | test_modification_keeps_links_from_earlier_turns - The stored exchange keeps the full URL. - true == true
[task 2026-11-08T20:35:58.473+00:00] 20:35:58     INFO - Buffered messages finished
[task 2026-11-08T20:35:58.476+00:00] 20:35:58     INFO - TEST-UNEXPECTED-FAIL | browser/components/aiwindow/models/tests/browser/browser_aitab.js | test_modification_keeps_links_from_earlier_turns - The stored exchange holds no URL tokens. - false == true
[task 2026-11-08T20:35:58.476+00:00] 20:35:58     INFO - chrome://mochitests/content/browser/browser/components/aiwindow/models/tests/browser/browser_aitab.js:test_modification_keeps_links_from_earlier_turns/<:755
[task 2026-11-08T20:35:58.476+00:00] 20:35:58     INFO - async*chrome://mochitests/content/browser/browser/components/aiwindow/models/tests/browser/browser_aitab.js:withAITab:184
[task 2026-11-08T20:35:58.476+00:00] 20:35:58     INFO - async*chrome://mochitests/content/browser/browser/components/aiwindow/models/tests/browser/browser_aitab.js:test_modification_keeps_links_from_earlier_turns:727
[task 2026-11-08T20:35:58.476+00:00] 20:35:58     INFO - chrome://mochikit/content/browser-test.js:handleTask:1777
[task 2026-11-08T20:35:58.476+00:00] 20:35:58     INFO - chrome://mochikit/content/browser-test.js:_runTaskBasedTest:1867
[task 2026-11-08T20:35:58.476+00:00] 20:35:58     INFO - async*chrome://mochikit/content/browser-test.js:Tester_execTest:2019
[task 2026-11-08T20:35:58.476+00:00] 20:35:58     INFO - chrome://mochikit/content/browser-test.js:nextTest/<:1757
[task 2026-11-08T20:35:58.476+00:00] 20:35:58     INFO - chrome://mochikit/content/tests/SimpleTest/SimpleTest.js:SimpleTest.waitForFocus/<:1060
[task 2026-11-08T20:35:58.476+00:00] 20:35:58     INFO - promise callback*chrome://mochikit/content/tests/SimpleTest/SimpleTest.js:SimpleTest.waitForFocus:1059
[task 2026-11-08T20:35:58.476+00:00] 20:35:58     INFO - chrome://mochikit/content/browser-test.js:nextTest:1694
[task 2026-11-08T20:35:58.476+00:00] 20:35:58     INFO - chrome://mochikit/content/browser-test.js:Tester_start/<:611
[task 2026-11-08T20:35:58.476+00:00] 20:35:58     INFO - promise callback*chrome://mochikit/content/browser-test.js:Tester_start:609
[task 2026-11-08T20:35:58.476+00:00] 20:35:58     INFO - chrome://mochikit/content/browser-harness.xhtml:createTester/</<:265
[task 2026-11-08T20:35:58.477+00:00] 20:35:58     INFO - GECKO(8473) | [MockEngineManager] Getting the engine with purpose "chat"
[task 2026-11-08T20:35:58.478+00:00] 20:35:58     INFO - GECKO(8473) | console.log: Conversation: "Request (private=true untrusted=true)" ({role:"user", content:"Call generate_page"})
[task 2026-11-08T20:35:58.478+00:00] 20:35:58     INFO - GECKO(8473) | console.debug: Conversation: "[Chat][Turn 2][CHAT SEND ]" [{role:"user", content:"Call generate_page"}]
[task 2026-11-08T20:35:58.479+00:00] 20:35:58     INFO - GECKO(8473) | [MockEngineManager] Waiting for the run request for the engine with purpose "chat"
[task 2026-11-08T20:35:58.480+00:00] 20:35:58     INFO - GECKO(8473) | [MockEngineManager] Responding to "chat" engine:
[task 2026-11-08T20:35:58.481+00:00] 20:35:58     INFO - GECKO(8473) | console.log: ({text:"", tokens:null, isPrompt:false, toolCalls:[{id:"generate_page_1", function:{name:"generate_page", arguments:"{\"modify_slug\":\"where-to-stay-in-lisbon\",\"modify_instructions\":\"drop everything over 100 euros a night\"}"}}]})
[task 2026-11-08T20:35:58.482+00:00] 20:35:58     INFO - GECKO(8473) | console.debug: Conversation: "[Chat][Turn 2][CHAT RECV ]" [{text:"", toolCalls:[{id:"generate_page_1", function:{name:"generate_page", arguments:"{\"modify_slug\":\"where-to-stay-in-lisbon\",\"modify_instructions\":\"drop everything over 100 euros a night\"}"}}]}]
[task 2026-11-08T20:35:58.483+00:00] 20:35:58     INFO - GECKO(8473) | console.log: Conversation: "[Tool] aiTab" "{\"modify_slug\":\"where-to-stay-in-lisbon\"}"
[task 2026-11-08T20:35:58.484+00:00] 20:35:58     INFO - GECKO(8473) | console.debug: AITab: "model returned 401 chars" "{\"components\":[{\"id\":\"root\",\"component\":\"Page\",\"header\":\"hdr\",\"children\":[\"lead\"]},{\"id\":\"hdr\",\"component\":\"Header\",\"title\":\"Where To Stay In Lisbon, Cheaply\",\"references\":{\"items\":[{\"href\":\"\xA7url_token: EXAMPLE_COM_BROWSER_BROWSER_COMPONENTS_AIWINDOW_MODELS_TESTS_BROWSER_AITAB_SOURCE_PAGE_HTML_1\xA7\",\"title\":\"Source\"}]}},{\"id\":\"lead\",\"component\":\"TextBlock\",\"lead\":\"A generated page.\"}],\"dataModel\":{}}"
[task 2026-11-08T20:35:58.485+00:00] 20:35:58     INFO - GECKO(8473) | console.debug: AITab: "structured surface validated successfully"
[task 2026-11-08T20:35:58.486+00:00] 20:35:58     INFO - GECKO(8473) | console.debug: Conversation: "[Chat][Turn 2][TOOL EXEC ] generate_page" [{arguments:{modify_slug:"where-to-stay-in-lisbon", modify_instructions:"drop everything over 100 euros a night"}, result:{message:"The page was modified.", page:{slug:"where-to-stay-in-lisbon"}}}]
[task 2026-11-08T20:35:58.486+00:00] 20:35:58     INFO - GECKO(8473) | console.log: Conversation: "Request (private=true untrusted=true)" ({role:"tool", content:"{\"message\":\"The page was modified.\",\"page\":{\"slug\":\"where-to-stay-in-lisbon\"}}", tool_call_id:"generate_page_1", name:"generate_page"})
[task 2026-11-08T20:35:58.487+00:00] 20:35:58     INFO - GECKO(8473) | console.debug: Conversation: "[Chat][Turn 2][CHAT SEND ]" [{role:"tool", content:"{\"message\":\"The page was modified.\",\"page\":{\"slug\":\"where-to-stay-in-lisbon\"}}", tool_call_id:"generate_page_1", name:"generate_page"}]
[task 2026-11-08T20:35:58.488+00:00] 20:35:58     INFO - GECKO(8473) | [MockEngineManager] Getting the engine with purpose "chat"
[task 2026-11-08T20:35:58.489+00:00] 20:35:58     INFO - GECKO(8473) | [MockEngineManager] Waiting for the run request for the engine with purpose "chat"
[task 2026-11-08T20:35:58.489+00:00] 20:35:58     INFO - GECKO(8473) | [MockEngineManager] Responding to "chat" engine:
[task 2026-11-08T20:35:58.490+00:00] 20:35:58     INFO - GECKO(8473) | console.debug: Conversation: "[Chat][Turn 2][CHAT RECV ]" [{text:"", toolCalls:null}]
[task 2026-11-08T20:35:58.491+00:00] 20:35:58     INFO - GECKO(8473) | console.debug: Conversation: "[Chat][Turn 2][STREAM END]"
[task 2026-11-08T20:35:58.493+00:00] 20:35:58     INFO - TEST-PASS | browser/components/aiwindow/models/tests/browser/browser_aitab.js | test_modification_keeps_links_from_earlier_turns - The generate_page call left its result in the chat - {"id":"105003af-b70a-4579-a705-89a77de41781","createdDate":1794170158126,"ordinal":8,"role":3,"content":{"tool_call_id":"generate_page_1","body":{"message":"The page was modified.","page":{"slug":"where-to-stay-in-lisbon"}},"name":"generate_page","args":{"modify_slug":"where-to-stay-in-lisbon"}},"turnIndex":2,"parentMessageId":"3aabda6d-3b17-4aa5-9148-7daf9c83d41c","modelId":"test-model","params":null,"usage":null,"toolCallId":null,"toolName":null,"revisionRootMessageId":"105003af-b70a-4579-a705-89a77de41781","isActiveBranch":true,"convId":"af1466b6-2f63-4867-acb0-c36f03d83deb","pageUrl":null,"memoriesEnabled":null,"memoriesFlagSource":null,"memoriesApplied":[],"webSearchQueries":[],"followUpSuggestions":[],"pageHistoryDeleted":false,"tokens":{"search":[],"existing_memory":[],"followup":[]},"toolUIData":null,"toolUIDraft":null,"historyResults":[],"citations":[],"kit":"undefined"} == true
[task 2026-11-08T20:35:58.494+00:00] 20:35:58     INFO - TEST-PASS | browser/components/aiwindow/models/tests/browser/browser_aitab.js | test_modification_keeps_links_from_earlier_turns - The earlier surface's link is sent as a token. - true == true

This started with today's ai-window-prompts.json remote-settings update, but the underlying test defect has been there since it was added by bug 2073307.
https://hg-edge.mozilla.org/integration/autoland/diff/46b492f4be2df8aa9c1c78a9522925985cb96075/services/settings/dumps/main/ai-window-prompts.json

test_modification_keeps_links_from_earlier_turns turns the whole stored tool conversation into a string, system prompt included, and asserts that the string has no §url_token text. Today's remote-settings repo-update brought in version 1.11 of the aitab generic system-instructions prompt. That prompt describes the URL token format in its own text, with examples like §url_token: ENERGY_GOV_1§, so the assertion now fails every time.

Product behavior is unchanged: AITab never tokenizes system messages (see AITab.#tokenizedMessages), and the assertion is only meant to cover the user, assistant and tool messages. The fix makes the test skip system messages before checking.

Assignee: nobody → ryanvm
Keywords: regression
Regressed by: 2073307
Pushed by rvandermeulen@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/57ddffbde75b https://hg.mozilla.org/integration/autoland/rev/72e2fd1d1ea6 Skip the system prompt when checking browser_aitab.js's stored exchange for URL tokens. a=test-only
Status: NEW → RESOLVED
Closed: 26 days ago
Resolution: --- → FIXED
Target Milestone: --- → 162 Branch
You need to log in before you can comment on or make changes to this bug.