100 Commits
Author SHA1 Message Date
Darnell Andries f9ff51f087 Add "load after restore" feature to backup results service (#36999) 2026-06-04 20:07:31 -07:00
Darnell Andries e768b9521d [AI Chat] Add search support for NEAR E2EE (#36751) 2026-06-03 01:52:43 +02:00
Darnell Andries 33c5f9ec67 [AI Chat] Do not show BYOM API key error when ObliviousHTTPAPIClient encounters HTTP 401 (#36889) 2026-06-02 03:00:54 +02:00
Darnell Andries 801aeaffbb Include v1 services key and v2 services signature in Brave Search requests (#36806)
Add the `BraveServiceKey` header (v1 key) and `Authorization` header (v2 key signature) to Brave Search requests. This will be used to reduce captcha occurrences for browser users.
2026-05-29 10:56:37 -07:00
Darnell Andries f3bea37356 [AI Chat] OHTTP chunking + SSE parsing fix (#36750)
* Create `SSEParser` util in `api_request_helper` namespace

* Refactor `ObliviousHttpAPIClient` to use `SSEParser`

* Address PR feedback
2026-05-29 00:18:24 -07:00
Darnell Andries 075088f2a4 Add Email Aliases metrics (#36469)
* Add metrics for Email Aliases

* Add notes and copy metrics for email aliases

* Presubmit fix

* fix ups

* Add tests

* Address PR feedback

* Pass metrics remote as a prop
2026-05-28 11:37:29 -07:00
Darnell Andries 07941b18b6 [AI Chat] Enforce code execution output size limits (#36425)
* [AI Chat] Enforce code execution output size limits

* Address PR feedback
2026-05-27 21:43:19 -07:00
Darnell Andries b9b4c5d9e6 Large chunked OHTTP request fix (#36766)
The RFC suggests a maximum chunk size of 16,384 bytes. If a request is made with
a plaintext length that is greater than the limit, split it up into 15kb chunks and
encrypt them individually.
2026-05-27 20:53:03 +01:00
Darnell Andries 4b89a12e89 [AI Chat] Enable AIChatCodeExecutionTool by default (#36744) 2026-05-27 00:52:42 +01:00
Darnell Andries 914163af5e [AI Chat] Relay outer OHTTP response code to response handler (#36743) 2026-05-27 00:45:23 +01:00
Darnell Andries c6513394ff General BackupResultsServiceImpl improvements/fixes (#36682) 2026-05-25 13:26:10 -07:00
Darnell Andries d7eb753b52 [AI Chat] Add ObliviousHttpAPIClient (#36295)
* [AI Chat] Add `ObliviousHttpAPIClient`

* Address PR feedback

* Add model key/near verification status in response

* Add encryption feature param for NEAR model feature
2026-05-20 20:39:06 -07:00
Darnell Andries 3acf28a77f [AI Chat] Prepare EngineConsumerOAIRemote/OAIAPIClient for OHTTP support (#36294)
* [AI Chat] Prepare `EngineConsumerOAIRemote`/`OAIAPIClient` for OHTTP support

* Fix iOS build errors
2026-05-21 02:27:53 +01:00
Darnell Andries d4c72967f9 Extend OHTTP client to support relay headers and chunking (#36292)
* Extend OHTTP client to support relay headers and chunking

* Address PR feedback
2026-05-20 19:44:18 +01:00
Darnell Andries 049d6c4088 Add WDP toggle on Origin settings page (#36491)
Enable WDP toggle on Origin settings page
2026-05-15 14:18:17 -07:00
Darnell Andries 6cb5446eed [AI Chat] Expose status and error code to user on server error (#36391)
* Add error details struct

* Parse streaming error body in APIRequestHelper, extract status/error codes, display to user

* Add tests, v2 client fixups

* Add comment

* Rename error_code to error_type, use string as type

* Only parse error body if content type is application/json

* Address PR feedback

* Address PR feedback
2026-05-15 03:53:23 +01:00
Darnell Andries edfcf48e1f Add ObliviousHttpChunkProcessor to enable chunked OHTTP (#36291)
* Add `ObliviousHttpChunkProcessor` to enable chunked OHTTP

* Address PR feedback

* Address PR feedback
2026-05-15 00:23:35 +01:00
Darnell Andries 40a3137cd2 [AI Chat] Add manager/loader for OHTTP config (#36293) 2026-05-13 06:45:59 +01:00
Darnell Andries 5ab1e39cd4 Add feature + params for backup results service (#36339) 2026-05-12 13:56:24 -07:00
Darnell Andries 21fcbd286a Add metrics for Shred feature (#36031) 2026-05-01 16:14:36 -07:00
Darnell Andries 8d9ccb1993 Use upstream function for getting P3A locale-based country code (#35817) 2026-05-01 15:01:48 -07:00
Darnell Andries d920808543 Update MediaSessionUsage metric with 96-100% bucket (#35729) 2026-04-22 13:46:01 -07:00
Darnell Andries 6beeaff43f Change Brave.Shields.UpgradeHTTPSPerSite to report any non-default per-site setting (#35708)
Resolves https://github.com/brave/brave-browser/issues/54764
2026-04-22 13:37:38 -07:00
Darnell Andries b9a9ec6a73 Remove sensitive flag on MetricsReportingEnabled policy (#35742) 2026-04-22 11:57:31 -07:00
Darnell Andries 0cb3ffc6a4 Revert to old format for Rewards ad types metric (#35649) 2026-04-21 08:23:32 -07:00
Darnell Andries c02522f222 Add "did not navigate" answer to daily query metrics (#35519) 2026-04-17 12:34:13 -07:00
Darnell Andries 0a7437712c Ignore unknown attribute names in P3A manifest (#35421)
* Ignore unknown attribute names in P3A manifest

* Address PR feedback
2026-04-17 11:37:33 -07:00
7d5845d2c2 Fix webpack config for web-discovery-project (#35573)
Co-authored-by: Rémi Berson <remusao@users.noreply.github.com>
Co-authored-by: Yevhen Shymotiuk <yshym@pm.me>
2026-04-15 20:34:44 -07:00
Darnell Andries 25d6b31e5a Add 0 answer to Brave.Core.Navigated (#35521) 2026-04-15 20:23:55 +01:00
Darnell Andries b33c9fdc00 [AI Chat] Move bignumber.js from code execution tool to code plugin (#34732)
* [AI Chat] Add BigNumberCodePlugin to encapsulate bignumber.js in code execution

* Make `CodePlugin::ArtifactType` optional

* Add resource header to components/ai_chat/core/browser/DEPS

* Remove const from `CodePlugin::SetupScript`
2026-04-14 19:04:20 -07:00
Darnell Andries ba76cdd46f Add media_session_usage custom attribute, add attribute to daily query metrics (#35420)
* Add media_session_usage custom attribute, add attribute to daily query metrics

* Add `TestEventRelayObserver`, update media session metric tests

* Use more specific values for media session attribute

* Address PR feedback
2026-04-14 17:40:34 -07:00
Darnell Andries cbe59d4cd2 Add custom attribute support for metrics (#35418)
* Add custom attribute support for metrics

* Rename `EventReceiver` to `EventRelay`

* Address PR feedback
2026-04-14 15:47:18 -07:00
Darnell Andries e6c34638ff [AI Chat] Add id to artifact to allow overwriting existing artifacts (#34727)
* [AI Chat] Add id to artifact to allow overwriting existing artifacts

* Address PR feedback
2026-04-13 14:02:01 -07:00
Darnell Andries d0a32f30ae [CodeHealth] Remove P3A dead code (#35412) 2026-04-13 21:50:22 +01:00
Darnell Andries 1abf429b8d Record Android widget search metric on resume (#35300) 2026-04-07 19:00:23 -07:00
Darnell Andries 8dd7b1fac9 Add Widevine metric (#35308) 2026-04-07 18:58:48 -07:00
Darnell Andries 3bdbe730da Call top site metric methods on Android (#35096)
* Call top site metric methods on Android

* Fix PWA/external navigation recording on Android

* Address PR feedback
2026-04-03 20:18:38 -07:00
Darnell Andries d42415c8c2 Call omnibox metric methods on Android (#35009)
Ensure these methods are called for both normal/private contexts, so we get more comprehensive data results.
2026-03-27 22:17:00 +00:00
Darnell Andries 30fae1189f Add metric for shields dev mode (#34876) 2026-03-23 14:21:25 -07:00
Darnell Andries 7c0cadb6da Only report omnibox navigation source metric if URL is http/https (#34881) 2026-03-20 22:33:46 +01:00
Darnell Andries 4f173e789f Add metrics for Shields HTTPS upgrade setting (#34770) 2026-03-20 11:05:31 -07:00
Darnell Andries 9d43525020 Add NTP widget answer to Leo entry point metrics (#34592) 2026-03-20 11:05:11 -07:00
Darnell Andries ea2ccf00d1 Add PWA navigation source metric (#34077)
* Add PWA navigation source metric

* Add comment for YT exception in `PageMetricsTabHelper`

* Swap out browser finder for BrowserWindowInterface
2026-03-20 11:04:48 -07:00
Darnell Andries e6858da262 Fix illegal access within UptimeMonitorImpl (#34660) 2026-03-12 08:56:50 -07:00
Darnell Andries b88610b3d4 Add Android metrics for Brave Search (#34076)
* Add widget search perecent metric

* Add quick search percentage metrics

* Address bot feedback
2026-03-11 16:27:31 -07:00
Darnell Andries 4c42b2eaf0 Log successful chart creation to avoid duplicate charts (#34651) 2026-03-11 22:36:17 +00:00
Darnell Andries da0ce21181 Update code execution tool description (#33758) 2026-03-11 11:05:35 -07:00
Darnell Andries 9d80cb4ccd Add navigation source metrics (#34025)
* Add navigation source metrics

* Add external navigation source metric, add navigated metric

* Address bot feedback

* Move unit test to components

* Fix after Chromium upgrade

* Change `navigation_source_metrics` accessor to return ref

* Fix broken message manager test
2026-03-10 21:16:00 -07:00
Darnell Andries fa5a15696f Remove duplicate template_url_service decl (#34624) 2026-03-10 20:06:12 +00:00
Darnell Andries e83a428a16 Add PagePercentageMetrics base class (#34024)
* Add `PagePercentageMetrics` base class

* Address bot feedback

* Change `BraveSearchMetrics` accessor to return ref

* Remove `PagePercentageMetrics` destructor
2026-03-10 12:39:34 -07:00
Darnell Andries ec69821f17 Add metric for Android quick search (#33731)
* Add metric for Android quick search

* Address PR feedback

* Add registry check

* Add Brave to quick search answer
2026-03-10 11:22:18 -07:00
Darnell Andries 2d96e58fb0 [AI Chat] Remove CHAT capability for non-chat generation (#34549) 2026-03-10 09:30:48 -07:00
Darnell Andries ac8f4a61e1 Change brave_capability field to a list, add Deep Research feature & capability (#34511)
* Change `brave_capability` field to a list, add Deep Research feature & capability

* Allow multiple conversation capabilities in `ConversationHandler`

* Update tests to support capability lists

* Add CHECK for conflicting capabilities

* Add test for conversation capability set

* Fix rebase issues

* Fix storybook

* Move `ConversationCapabilitySet` to types.h

* Check that all conversation capabilities are included in model supported capabilities

* Remove `CHAT` and `CONTENT_AGENT` mutual exclusion

* Address PR test feedback
2026-03-09 21:01:29 -07:00
Darnell Andries ec552262a8 Media session metric fixes (#34509)
* Media session P3A fix wip

* Move `MediaSessionMetrics` to browser/misc_metrics

* Update test

* Code follow ups

* Expand uptime monitor to record 8 days

* Revert "Expand uptime monitor to record 8 days"

This reverts commit 00dd9f1d26f5d96fb2d2dbdaf0095cb7f91c739f.

* Use TimeDelta prefs instead of TPS

* Make Session final
2026-03-10 01:29:29 +01:00
Darnell Andries fdfbc6f866 Add metrics for Brave Search entry percentages (#33951)
* Add omnibox search percentage metrics

* Add NTP search percentage metric

* Include private queries in search metrics

* Update metric_names.h

* Fix

* Trigger `ReportDailyMetrics` from `PageMetrics::ReportAllMetrics`

* Address PR feedback

* Fix after Chromium upgrade, misc fixes after rebase

* Add CHECK_GT

* Add missing metric names
2026-03-06 16:09:40 -08:00
Darnell Andries b7a6573f8d Add metrics for Brave queries per day (#33884)
* Add metrics for Brave queries per day

* Move QPD metrics to separate class

* Add search metrics test

* Refactor search metrics to not use daily storage, report after 24 hours has elapsed

* Add Yahoo/DDG default histogram names

* Remove check deref include

* Move unit test to components

* Clear query counts on history clear

* Add check for registry

* Fix rebase error
2026-03-04 21:27:02 -08:00
Darnell Andries fb0f01a0de Re-enable wallet usage metrics, add Tor usage metric (#34335) 2026-03-03 16:39:34 -08:00
Darnell Andries 178f095466 Add Media Session metric (#34334)
* Add "is default" metric attribute

* Address PR feedback

* Use `static_library` for `default_browser_monitor`

* Address PR feedback

* Add Media Session metric
2026-03-03 16:38:47 -08:00
Darnell Andries 23fe5d1991 Add "is default" metric attribute (#33851)
* Add "is default" metric attribute

* Address PR feedback

* Use `static_library` for `default_browser_monitor`

* Address PR feedback
2026-03-03 10:51:22 -08:00
Darnell Andries 8e2d58111d [AI Chat] Add chart creation ability to code execution tool (#33457)
* [AI Chat] Add chart creation ability to code execution tool

* Move chart display to separate web ui

* Address PR feedback

* Add story for chart display

* Address PR feedback

* Disable chart generation by default

* Fix broken browser test

* Add data size limits to chart artifact
2026-03-03 07:59:35 +00:00
Darnell Andries 60235f3ea4 [AI Chat] Add support for code execution plugins (#33456)
* [AI Chat] Add support for code execution plugins

* Address PR feedback

* Update code after Chromium upgrade
2026-02-26 20:51:44 -08:00
Darnell Andries 995c6987c0 [AI Chat] Add support for tool artifacts (#33455)
* [AI Chat] Add support for tool artifacts

* Address PR feedback

* Fix rebase errors

* Fix test failure
2026-02-26 18:06:34 -08:00
Darnell Andries b9955dbe72 Add "no" answer to default daily metric (#33413) 2026-01-26 21:25:48 +00:00
Darnell Andries eede30b87f Add --ninja option to npm run test (#33379) 2026-01-23 11:00:59 -08:00
Darnell Andries 6d0f97f979 Integrate SkillsMetrics (#33051)
* Add `SkillsMetrics` class

* Address PR feedback

* Integrate `SkillsMetrics`

* Address PR feedback
2026-01-19 11:45:32 -08:00
Darnell Andries b3d64f979a Update recharts to 3.6.0 and @reduxjs/toolkit to 1.9.0 (#33228)
* Update recharts to 3.6.0 and @reduxjs/toolkit to 1.9.0

* Address PR feedback, fix chart tooltip
2026-01-16 22:54:26 +00:00
Darnell Andries 29992387f8 Add SkillsMetrics class (#33050)
* Add `SkillsMetrics` class

* Address PR feedback

* Swap out `base::flat_map` with `absl::flat_hash_map`
2026-01-16 13:45:36 -08:00
Darnell Andries 8bff233769 Add default browser and page visit intersection metrics (#33195)
* Add default browser and page visit intersection metrics

* Use delegate instead of callbacks in `DefaultBrowserMonitor`

* Address PR feedback

* Fix tests
2026-01-16 13:41:03 -08:00
Darnell Andries 15b06a0bdb Add Shields filter list metric (#33243) 2026-01-16 13:00:52 -08:00
Darnell Andries f4273d6f87 Add Rewards and default engine intersection metrics (#33047) 2026-01-12 19:04:10 -08:00
Darnell Andries c1e0e25601 [AI Chat] Include model key in tool call generation result data (#33118)
Include model key in tool call generation result data
2026-01-09 15:25:21 -08:00
Darnell Andries b08518157c [AI Chat] Fix model name for tool call responses (#33039) 2026-01-07 04:17:28 +00:00
Darnell Andries b5726bdc11 [AI Chat] Code execution improvements (#32827)
* [AI Chat] Code execution improvements

* Use github themes for aichat code block

* Address PR feedback
2025-12-16 19:20:38 -08:00
Darnell Andries 529dc3a442 [AI Chat] Use console logging for code execution, improve prompt (#32809) 2025-12-16 11:11:17 -08:00
Darnell Andries 0eac7f8e19 Add simple private window metric (#32795) 2025-12-15 23:24:07 -08:00
Darnell Andries 02a7494df1 Update code execution tool description (#32757) 2025-12-10 09:58:53 -08:00
Darnell Andries 0c122ac4df Add daily metric for new tabs created (#32655) 2025-12-04 19:02:25 -08:00
Darnell Andries 9c19af3949 [AI Chat] Add local code execution tool (#31252)
* [AI Chat] Local code execution tool

* Move `CodeSandboxScriptStorage` ownership to `AIChatService`, store & return `std::string` from storage

* Update code execution tool event UI

* Add `CodeSandboxNavigationThrottle`

* Omit window and location in code execution scope

* Remove `CodeSandboxScriptStorage`

* Use sandboxed iframe for code execution, use primary OTR profile

* Use script injection for code execution

* `expandedContent` should be null if `jsCode` is null

* Address PR feedback

* Address PR feedback

* Address PR feedback

* Move code sandbox webui constants
2025-12-04 20:28:33 +01:00
Darnell Andries 4bca16b1b3 Remove existing day zero UI modifications (#32441) 2025-11-21 06:20:18 +01:00
Darnell Andries 2a1e5d0d10 Remove News ads metrics (#32436) 2025-11-20 11:11:37 -08:00
Darnell Andries 6c57aef7c1 Fix flaky stats test (#31936) 2025-11-20 10:52:18 -08:00
Darnell Andries 1dfed76ba6 Add metric for adblock only mode (#32383) 2025-11-19 09:20:42 -08:00
Darnell Andries cc4a901ae3 [AIChat] Add NEAR attestation verification (#32370)
* [AIChat] Add NEAR attestation verification

* Remove `NEARVerifier`, get verification status from response header

* Update to use `near_verification_status`

* Address follow-ups
2025-11-19 02:07:08 +01:00
Darnell Andries cb92a78922 [AIChat] Add NEAR DeepSeek V3.1, NEAR models feature (#32372) 2025-11-18 14:03:19 -08:00
Darnell Andries ffdc8d2368 [AIChat] Persist NEAR verification status in database (#32334)
* [AIChat] Add id to completion event and NEAR verification status to conversation entry

* Remove id from completion event

* Wrap NEAR verification status in struct as workaround for iOS

* Update iOS AIChatResponseMessageView

* [AIChat] Persist NEAR verification status in database

* Remove `UpdateEntryVerificationStatus`

* Update to use `near_verification_status`
2025-11-18 13:54:29 -08:00
Darnell Andries 14e8c306ea [AIChat] Add NEAR verification status to conversation entry (#32333)
* [AIChat] Add id to completion event and NEAR verification status to conversation entry

* Remove id from completion event

* Wrap NEAR verification status in struct as workaround for iOS

* Update iOS AIChatResponseMessageView
2025-11-18 11:29:49 -08:00
Darnell Andries 4c7d92e95c Fix flaky vertical tab grouping tests (#31935) 2025-10-21 17:05:39 -07:00
Darnell Andries 7357147eaf Set default engine in network audit tests (#31498) 2025-10-09 20:20:59 -07:00
Darnell Andries 116e20bf97 Add Web Discovery policy to Brave Origin policy metadata map (#31719) 2025-10-09 14:09:00 -07:00
Darnell Andries a696995740 Default engine/switch engine metric modifications (#31419)
* Add locale-based country code P3A attribute, use for the default engine/engine switch metrics

* Change format and reporting cadence for default engine switch metric
2025-10-01 19:22:51 -07:00
Darnell Andries c68208e275 Add metric for backup result failures (#31322) 2025-09-29 21:37:39 -07:00
Darnell Andries 362e2bb7ca Set Android renderer size in backup results service (#31375) 2025-09-23 18:05:05 -07:00
Darnell Andries 80825cdd11 [CodeHealth] Replace blink::StringBuilder with blink::StrCat part 2 (#31046)
* [CodeHealth] Replace blink::StringBuilder with blink::StrCat part 1

* [CodeHealth] Replace blink::StringBuilder with blink::StrCat part 2
2025-09-16 08:39:15 -07:00
Darnell Andries ec4a5aa199 [CodeHealth] Replace blink::StringBuilder with blink::StrCat part 1 (#31029)
[CodeHealth] Replace blink::StringBuilder with blink::StrCat part 1
2025-09-16 08:38:54 -07:00
Darnell Andries 13b1403fe0 Set renderer size in backup results service (#31142) 2025-09-12 14:56:05 -07:00
Darnell Andries c85dcbbe5a Update brave-miracl (#31009) 2025-09-09 14:10:58 -07:00
Darnell Andries e0d7161f7a [CodeHealth] Use base::ElapsedTimer where applicable (#30918)
* Use `base::ElapsedTimer` where possible pt. 1

* Refactor `misc_metrics::UsageClock` to use `base::ElapsedTimer`

* Address CodeHealth PR feedback
2025-09-08 12:34:46 -07:00
Darnell Andries 3a90e5a7f0 Add admin policy for Playlist (#30351)
* Add admin policy for Playlist

* Remove Playlist disabled by policy pref, rename policy

* Remove disabled condition for Playlist settings page
2025-09-03 20:41:49 -07:00
Darnell Andries ff19d2a8c5 [CodeHealth] Replace base::WrapUnique with std::make_unique where applicable (#30923)
Replace `base::WrapUnique` with `std::make_unique` where applicable
2025-09-02 19:03:13 -07:00
Darnell Andries 11732b92c4 [CodeHealth] Use base::FindOrNull where applicable pt. 1 (#30927)
* Use `base::FindOrNull` where applicable pt. 1

* Use `base::FindPtrOrNull` where applicable
2025-09-02 10:58:18 -07:00