helloadhavan/github_issues huggingface dataset:
Repository: nodejs/node
Pull request: test: check util.parseArgs argv parsing with actual process execution

The new --eval tests for `util.parseArgs()` are genuine usage tests that spawn a node instance with command-line args, whereas the existing test for "command-line parsing" just overwrites `process.argv`. Mocking this property is fine for the input parsing tests, but the command-line behaviour should also be genuinely tested here.

Refs: #60814

Changed files:
filename: test/fixtures/parse-args.js
patch: @@ -0,0 +1,5 @@
+const { parseArgs } = require('util');
+
+const parsedArgs = parseArgs({ strict: false }).values;
+
+process.stdout.write(JSON.stringify(parsedArgs));

filename: test/parallel/test-parse-args.mjs
patch: @@ -1,4 +1,5 @@
 import { spawnPromisified } from '../common/index.mjs';
+import { path } from '../common/fixtures.mjs';
 import assert from 'node:assert';
 import { suite, test } from 'node:test';
 import { parseArgs } from 'node:util';
@@ -212,6 +213,8 @@ test('order of option and positional does not matter (per README)', () => {
 });
 
 suite('correct default args', () => {
+  const expected = { code: 0, signal: null, stderr: '', stdout: { foo: true, bar: true } };
+
   suite('with CLI flags', () => {
     const evalCode = "JSON.stringify(require('util').parseArgs({ strict: false }).values)";
     const evalCodePrinted = `process.stdout.write(${evalCode})`;
@@ -225,33 +228,21 @@ suite('correct default args', () => {
       '--print --eval <script>': ['--print', '--eval', evalCode],
       '--print --eval=<script>': ['--print', `--eval=${evalCode}`],
     };
-    for (const description in execArgsTests) {
-      const execArgs = execArgsTests[description];
+    for (const [description, execArgs] of Object.entries(execArgsTests)) {
       test(description, async () => {
         const { code, signal, stderr, stdout } = await spawnPromisified(
           process.execPath,
           [...execArgs, '--', '--foo', '--bar']);
-        assert.deepStrictEqual({
-          code,
-          signal,
-          stderr,
-          stdout: JSON.parse(stdout),
-        }, {
-          code: 0,
-          signal: null,
-          stderr: '',
-          stdout: { foo: true, bar: true },
-        });
+        assert.deepStrictEqual({ code, signal, stderr, stdout: JSON.parse(stdout) }, expected);
       });
     }
   });
 
-  test('without CLI flags', () => {
-    const holdArgv = process.argv;
-    process.argv = [process.argv0, 'script.js', '--foo', '--bar'];
-    const { values } = parseArgs({ strict: false });
-    assert.deepStrictEqual(values, { __proto__: null, foo: true, bar: true });
-    process.argv = holdArgv;
+  test('without CLI flags', async () => {
+    const { code, signal, stderr, stdout } = await spawnPromisified(
+      process.execPath,
+      [path('parse-args.js'), '--foo', '--bar']);
+    assert.deepStrictEqual({ code, signal, stderr, stdout: JSON.parse(stdout) }, expected);
   });
 });
Repository: huggingface/transformers
Pull request: Bump huggingface_hub minimal version

This PR bumps `huggingface_hub` minimal version to 1.3.0 (current latest release, see https://github.com/huggingface/huggingface_hub/releases/tag/v1.3.0).

This release includes:
- https://github.com/huggingface/huggingface_hub/pull/3666 => running `transformers` CLI will now run an auto-update check similar to what we do for `hf` CLI. If a new version is available, we let the user know + provide the exact command line to run
- https://github.com/huggingface/huggingface_hub/pull/3668 => fixes this [TODO](https://github.com/huggingface/transformers/blob/3a275d3581c0ecf962f7412aa764c2047331fd6b/pyproject.toml#L53C2-L53C44). I'll open a separate PR with all the code style fixes. => **EDIT:** opened https://github.com/huggingface/transformers/pull/43189

---

(Failing CI doesn't seem related to this PR)

Changed files:
filename: setup.py
patch: @@ -84,7 +84,7 @@
     "GitPython<3.1.19",
     "hf-doc-builder>=0.3.0",
     "hf_xet",
-    "huggingface-hub>=1.2.1,<2.0",
+    "huggingface-hub>=1.3.0,<2.0",
     "importlib_metadata",
     "ipadic>=1.0.0,<2.0",
     "jinja2>=3.1.0",

filename: src/transformers/cli/transformers.py
patch: @@ -13,7 +13,7 @@
 # limitations under the License.
 """Transformers CLI."""
 
-from huggingface_hub import typer_factory
+from huggingface_hub import check_cli_update, typer_factory
 
 from transformers.cli.add_fast_image_processor import add_fast_image_processor
 from transformers.cli.add_new_model_like import add_new_model_like
@@ -35,6 +35,7 @@
 
 
 def main():
+    check_cli_update("transformers")
     app()
 
 

filename: src/transformers/dependency_versions_table.py
patch: @@ -22,7 +22,7 @@
     "GitPython": "GitPython<3.1.19",
     "hf-doc-builder": "hf-doc-builder>=0.3.0",
     "hf_xet": "hf_xet",
-    "huggingface-hub": "huggingface-hub>=1.2.1,<2.0",
+    "huggingface-hub": "huggingface-hub>=1.3.0,<2.0",
     "importlib_metadata": "importlib_metadata",
     "ipadic": "ipadic>=1.0.0,<2.0",
     "jinja2": "jinja2>=3.1.0",
Repository: vercel/next.js
Pull request: [ci] Use native `concurrency` feature in build-and-test

Last remaining workflow using our custom cancel workflow.

Using the same concurrency logic as build-and-deploy

Changed files:
filename: .github/workflows/build_and_test.yml
patch: @@ -6,6 +6,12 @@ on:
   pull_request:
     types: [opened, synchronize]
 
+concurrency:
+  # Limit concurrent runs to 1 per PR,
+  # but allow concurrent runs on push if they potentially use different source code
+  group: ${{ github.event_name == 'pull_request' && format('{0}-pr-{1}', github.workflow, github.ref_name) || format('{0}-sha-{1}', github.workflow, github.sha) }}
+  cancel-in-progress: true
+
 # NOTE: anything in `afterBuild` inherits environment variables defined in
 # `build_reusable.yml` (not these!) because that job executes within the context
 # of that workflow. Environment variables are not automatically passed to

filename: .github/workflows/cancel.yml
patch: @@ -1,17 +0,0 @@
-name: Cancel
-on:
-  pull_request_target:
-    types:
-      - edited
-      - synchronize
-
-jobs:
-  cancel:
-    name: 'Cancel Previous Runs'
-    runs-on: ubuntu-latest
-    timeout-minutes: 2
-    steps:
-      - uses: styfle/cancel-workflow-action@0.12.1
-        with:
-          workflow_id: 57419851
-          access_token: ${{ github.token }}
Repository: ggml-org/llama.cpp
Pull request: cuda/hip: fix loop unrolling in ssm-conv

As discussed in https://github.com/ggml-org/llama.cpp/pull/20128

Changed files:
filename: ggml/src/ggml-cuda/ssm-conv.cu
patch: @@ -76,14 +76,17 @@ static __global__ void ssm_conv_long_token_f32(const float * __restrict__ src0,
     int row = tid / load_cols;
     int col = tid % load_cols;
 #pragma unroll
-    for (int idx = tid; idx < total_elems; idx += split_d_inner) {
+    for (int idx = 0; idx < total_elems; idx += split_d_inner) {
         if (row < (int)split_d_inner) {
             smem[row * n_cols + col] = x_block[row * stride_x + col];
         }
 
         col += split_d_inner;
         row += col / load_cols;
         col  = col % load_cols;
+        if (idx >= total_elems - tid - split_d_inner) {
+            break;
+        }
     }
     __syncthreads();
Repository: ollama/ollama
Pull request: fix: add back bf16 support

this was accidentally removed in [#7913](https://github.com/ollama/ollama/pull/7913/files#diff-fbcdd9c400e0dff0ac63aca45430d25a28762e987facde9464c092533e793beeL258-L259) when moving fs/ggml from its previous location

resolves #9343 

Changed files:
filename: fs/ggml/ggml.go
patch: @@ -207,11 +207,26 @@ func (t Tensor) block() (n int) {
 
 func (t Tensor) blockSize() uint64 {
 	switch t.Kind {
-	case 0, 1, 24, 25, 26, 27, 28, 30: // F32, F16, I8, I16, I32, I64, F64, BF16
+	case
+		0,  // F32
+		1,  // F16
+		24, // I8
+		25, // I16
+		26, // I32
+		27, // I64
+		28, // F64
+		30: // BF16
 		return 1
-	case 2, 3, 4, 5, 6, 7, 8, 9, 20: // Q4_0, Q4_1, Q5_0, Q5_1, Q8_0, Q8_1, IQ4_NL
+	case
+		2,  // Q4_0
+		3,  // Q4_1
+		6,  // Q5_0
+		7,  // Q5_1
+		8,  // Q8_0
+		9,  // Q8_1
+		20: // IQ4_NL
 		return 32
-	default: // All others
+	default:
 		return 256
 	}
 }
@@ -235,7 +250,7 @@ func (t Tensor) typeSize() uint64 {
 	case 8: // Q8_0
 		return 2 + blockSize
 	case 9: // Q8_1
-		return 4 + 4 + blockSize
+		return 2 + 2 + blockSize
 	case 10: // Q2_K
 		return blockSize/16 + blockSize/4 + 2 + 2
 	case 11: // Q3_K
@@ -247,7 +262,7 @@ func (t Tensor) typeSize() uint64 {
 	case 14: // Q6_K
 		return blockSize/2 + blockSize/4 + blockSize/16 + 2
 	case 15: // Q8_K
-		return 2 + blockSize + 2*blockSize/16
+		return 4 + blockSize + 2*blockSize/16
 	case 16: // IQ2_XXS
 		return 2 + 2*blockSize/8
 	case 17: // IQ2_XS
@@ -276,6 +291,8 @@ func (t Tensor) typeSize() uint64 {
 		return 8
 	case 29: // IQ1_M
 		return blockSize/8 + blockSize/16 + blockSize/32
+	case 30: // BF16
+		return 2
 	default:
 		return 0
 	}

filename: fs/ggml/ggml_test.go
patch: @@ -3,6 +3,7 @@ package ggml
 import (
 	"maps"
 	"slices"
+	"strconv"
 	"strings"
 	"testing"
 
@@ -157,3 +158,55 @@ func TestTensorLayers(t *testing.T) {
 		})
 	}
 }
+
+// ref: https://github.com/ggml-org/llama.cpp/blob/a82c9e7c23ef6db48cebfa194dc9cebbc4ac3552/ggml/src/ggml.c#L572
+func TestTensorTypes(t *testing.T) {
+	cases := []struct {
+		kind      uint32
+		blockSize uint64
+		typeSize  uint64
+	}{
+		{0, 1, 4},
+		{1, 1, 2},
+		{2, 32, 18},
+		{3, 32, 20},
+		{6, 32, 22},
+		{7, 32, 24},
+		{8, 32, 34},
+		{9, 32, 36},
+		{10, 256, 84},
+		{11, 256, 110},
+		{12, 256, 144},
+		{13, 256, 176},
+		{14, 256, 210},
+		{15, 256, 292},
+		{16, 256, 66},
+		{17, 256, 74},
+		{18, 256, 98},
+		{19, 256, 50},
+		{20, 32, 18},
+		{21, 256, 110},
+		{22, 256, 82},
+		{23, 256, 136},
+		{24, 1, 1},
+		{25, 1, 2},
+		{26, 1, 4},
+		{27, 1, 8},
+		{28, 1, 8},
+		{29, 256, 56},
+		{30, 1, 2},
+	}
+
+	for _, tt := range cases {
+		t.Run(strconv.Itoa(int(tt.kind)), func(t *testing.T) {
+			tensor := Tensor{Kind: tt.kind}
+			if tensor.blockSize() != tt.blockSize {
+				t.Errorf("unexpected block size: got=%d want=%d", tensor.blockSize(), tt.blockSize)
+			}
+
+			if tensor.typeSize() != tt.typeSize {
+				t.Errorf("unexpected type size: got=%d want=%d", tensor.typeSize(), tt.typeSize)
+			}
+		})
+	}
+}
Repository: nodejs/node
Pull request: zlib: add CHECK to validate fast path input

Add missing CHECK in FastCRC32 to match the slow path.

Changed files:
filename: src/node_zlib.cc
patch: @@ -1685,6 +1685,7 @@ static uint32_t FastCRC32(v8::Local<v8::Value> receiver,
                           v8::FastApiCallbackOptions& options) {
   TRACK_V8_FAST_API_CALL("zlib.crc32");
   v8::HandleScope handle_scope(options.isolate);
+  CHECK(data->IsArrayBufferView() || data->IsString());
   return CRC32Impl(options.isolate, data, value);
 }
Repository: vercel/next.js
Pull request: Fix incorrect 'Ready in' time for next start

## What

Fix the incorrect "Ready in" time displayed when running `next start`. The bug caused the time to show impossibly large values like "Ready in 29474457.7min" instead of the actual startup duration.

## Why

The `NEXT_PRIVATE_START_TIME` environment variable was not being properly set/propagated when `startServer()` read it. When the variable was missing, the code defaulted to `0`, causing the calculation `Date.now() - 0` to equal the entire Unix timestamp (~1.77 trillion milliseconds ≈ 29 million minutes).

## How

1. Added a fallback in `cli/next-start.ts` to set `NEXT_PRIVATE_START_TIME` if it's not already set by `bin/next.ts`
2. Updated the calculation in `start-server.ts` to use `0` as the duration if `startTime` is falsy, preventing the bug
3. Removed unused performance mark code that was leftover

## Test Plan

Run `next start` on a production build and verify the "Ready in" time shows a reasonable value (e.g., "Ready in 523ms" instead of millions of minutes).

Changed files:
filename: packages/next/src/cli/next-start.ts
patch: @@ -1,5 +1,12 @@
 #!/usr/bin/env node
 
+// Ensure NEXT_PRIVATE_START_TIME is set for accurate "Ready in" timing.
+// This should already be set by bin/next.ts, but we set it here as a fallback
+// in case the module is loaded through a different code path.
+if (!process.env.NEXT_PRIVATE_START_TIME) {
+  process.env.NEXT_PRIVATE_START_TIME = Date.now().toString()
+}
+
 import '../server/lib/cpu-profile'
 import { saveCpuProfile } from '../server/lib/cpu-profile'
 import { startServer } from '../server/lib/start-server'

filename: packages/next/src/server/lib/start-server.ts
patch: @@ -2,9 +2,6 @@
 import './cpu-profile'
 import { getNetworkHost } from '../../lib/get-network-host'
 
-if (performance.getEntriesByName('next-start').length === 0) {
-  performance.mark('next-start')
-}
 import '../next'
 import '../require-hook'
 
@@ -370,10 +367,11 @@ export async function startServer(
       })
 
       // Calculate and log "Ready in X" before loading config
-      // so it reflects actual framework startup time
+      // so it reflects actual framework startup time.
+      // NEXT_PRIVATE_START_TIME is set by bin/next.ts or cli/next-start.ts.
       const startTime = parseInt(process.env.NEXT_PRIVATE_START_TIME || '0', 10)
       const endTime = Date.now()
-      const startServerProcessDurationMs = endTime - startTime
+      const startServerProcessDurationMs = startTime ? endTime - startTime : 0
 
       const formattedStartDuration = durationToString(
         startServerProcessDurationMs / 1000
Repository: ggml-org/llama.cpp
Pull request: Fix agentic mcp image single model

*Make sure to read the [contributing guidelines](https://github.com/ggml-org/llama.cpp/blob/master/CONTRIBUTING.md) before submitting a PR*

## Bug

In single-model mode, options.model is undefined during the agentic loop.
modelSupportsVision(options.model ?? '') matches no model and returns false,
so MCP image attachments are silently dropped from tool results. The image
still reaches the VL one turn later through DB attachments, causing confusion.

## Fix

Resolve the effective model at the top of executeAgenticLoop. In MODEL mode,
use modelsStore.models[0] which carries modalities from /props. In ROUTER mode,
options.model is always set so the fallback is never reached.

## Test

Start llama-server in single-model mode with a VL model (--mmproj required).
Configure an MCP server that returns images.

Prompt (for an image generator) :

```
Use the image generator with prompt "an unspecified object".
Then describe what you see in the generated image.
```

### Before

Console: [AgenticStore] Skipping image attachment (model "undefined"...).
Model cannot see the image on the tool call turn.

### After

No skip log. Model describes the image immediately on the same agentic loop.

Solves #20314

Changed files:
filename: tools/server/webui/src/lib/stores/agentic.svelte.ts
patch: @@ -318,6 +318,12 @@ class AgenticStore {
 		const maxTurns = agenticConfig.maxTurns;
 		const maxToolPreviewLines = agenticConfig.maxToolPreviewLines;
 
+		// Resolve effective model for vision capability checks.
+		// In ROUTER mode, options.model is always set by the caller.
+		// In MODEL mode, options.model is undefined; use the single loaded model
+		// which carries modalities bridged from /props.
+		const effectiveModel = options.model || modelsStore.models[0]?.model || '';
+
 		for (let turn = 0; turn < maxTurns; turn++) {
 			this.updateSession(conversationId, { currentTurn: turn + 1 });
 			agenticTimings.turns = turn + 1;
@@ -571,14 +577,14 @@ class AgenticStore {
 				];
 				for (const attachment of attachments) {
 					if (attachment.type === AttachmentType.IMAGE) {
-						if (modelsStore.modelSupportsVision(options.model ?? '')) {
+						if (modelsStore.modelSupportsVision(effectiveModel)) {
 							contentParts.push({
 								type: ContentPartType.IMAGE_URL,
 								image_url: { url: (attachment as DatabaseMessageExtraImageFile).base64Url }
 							});
 						} else {
 							console.info(
-								`[AgenticStore] Skipping image attachment (model "${options.model}" does not support vision)`
+								`[AgenticStore] Skipping image attachment (model "${effectiveModel}" does not support vision)`
 							);
 						}
 					}
Repository: vuejs/vue
Pull request: fix(types): add model option to functional components

Closes #8210

<!--
Please make sure to read the Pull Request Guidelines:
https://github.com/vuejs/vue/blob/dev/.github/CONTRIBUTING.md#pull-request-guidelines
-->

<!-- PULL REQUEST TEMPLATE -->
<!-- (Update "[ ]" to "[x]" to check a box) -->

**What kind of change does this PR introduce?** (check at least one)

- [ ] Bugfix
- [x] Feature
- [ ] Code style update
- [ ] Refactor
- [ ] Build-related changes
- [ ] Other, please describe:

**Does this PR introduce a breaking change?** (check one)

- [ ] Yes
- [x] No

If yes, please describe the impact and migration path for existing applications:

**The PR fulfills these requirements:**

- [x] It's submitted to the `dev` branch for v2.x (or to a previous version branch), _not_ the `master` branch
- [x] When resolving a specific issue, it's referenced in the PR's title (e.g. `fix #xxx[,#xxx]`, where "xxx" is the issue number)
- [x] All tests are passing: https://github.com/vuejs/vue/blob/dev/.github/CONTRIBUTING.md#development-setup
- [x] New/updated tests are included

If adding a **new feature**, the PR's description includes:
- [ ] A convincing reason for adding this feature (to avoid wasting your time, it's best to open a suggestion issue first and wait for approval before working on it)

**Other information:**


Changed files:
filename: types/options.d.ts
patch: @@ -111,6 +111,10 @@ export interface ComponentOptions<
 export interface FunctionalComponentOptions<Props = DefaultProps, PropDefs = PropsDefinition<Props>> {
   name?: string;
   props?: PropDefs;
+  model?: {
+    prop?: string;
+    event?: string;
+  };
   inject?: InjectOptions;
   functional: boolean;
   render?(this: undefined, createElement: CreateElement, context: RenderContext<Props>): VNode | VNode[];

filename: types/test/options-test.ts
patch: @@ -376,4 +376,24 @@ Vue.component("async-component", ((resolve, reject) => {
   })
 }));
 
+Vue.component('functional-component-v-model', {
+  props: ['foo'],
+  functional: true,
+  model: {
+    prop: 'foo',
+    event: 'change'
+  },
+  render(createElement, context) {
+    return createElement("input", {
+      on: {
+        input: new Function()
+      },
+      domProps: {
+        value: context.props.foo
+      }
+    });
+  }
+});
+
+
 Vue.component('async-es-module-component', () => import('./es-module'))
Repository: vuejs/vue
Pull request: fix(for): use IE compatible regex in v-for regex

Closes #7946

<!--
Please make sure to read the Pull Request Guidelines:
https://github.com/vuejs/vue/blob/dev/.github/CONTRIBUTING.md#pull-request-guidelines
-->

<!-- PULL REQUEST TEMPLATE -->
<!-- (Update "[ ]" to "[x]" to check a box) -->

**What kind of change does this PR introduce?** (check at least one)

- [x] Bugfix
- [ ] Feature
- [ ] Code style update
- [ ] Refactor
- [ ] Build-related changes
- [ ] Other, please describe:

**Does this PR introduce a breaking change?** (check one)

- [ ] Yes
- [x] No

If yes, please describe the impact and migration path for existing applications:

**The PR fulfills these requirements:**

- [x] It's submitted to the `dev` branch for v2.x (or to a previous version branch), _not_ the `master` branch
- [x] When resolving a specific issue, it's referenced in the PR's title (e.g. `fix #xxx[,#xxx]`, where "xxx" is the issue number)
- [ ] All tests are passing: https://github.com/vuejs/vue/blob/dev/.github/CONTRIBUTING.md#development-setup
- [ ] New/updated tests are included

If adding a **new feature**, the PR's description includes:
- [ ] A convincing reason for adding this feature (to avoid wasting your time, it's best to open a suggestion issue first and wait for approval before working on it)

**Other information:**


Changed files:
filename: src/compiler/parser/index.js
patch: @@ -21,7 +21,7 @@ import {
 
 export const onRE = /^@|^v-on:/
 export const dirRE = /^v-|^@|^:/
-export const forAliasRE = /([^]*?)\s+(?:in|of)\s+([^]*)/
+export const forAliasRE = /([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/
 export const forIteratorRE = /,([^,\}\]]*)(?:,([^,\}\]]*))?$/
 const stripParensRE = /^\(|\)$/g
Repository: ollama/ollama
Pull request: build: support Compute Capability 5.0, 5.2 and 5.3 for CUDA 12.x

CUDA 12.x still supports Compute Capability 5.0, 5.2 and 5.3, so let's build for these architectures as well

I have a GPU with CC 5.2 and confirmed that before the change ollama crashes, afterwards it works just fine.

source: https://stackoverflow.com/questions/28932864/which-compute-capability-is-supported-by-which-cuda-versions

Changed files:
filename: CMakePresets.json
patch: @@ -28,7 +28,7 @@
       "name": "CUDA 12",
       "inherits": [ "CUDA" ],
       "cacheVariables": {
-        "CMAKE_CUDA_ARCHITECTURES": "60;61;62;70;72;75;80;86;87;89;90;90a"
+        "CMAKE_CUDA_ARCHITECTURES": "50;52;53;60;61;62;70;72;75;80;86;87;89;90;90a"
       }
     },
     {

filename: discover/cuda_common.go
patch: @@ -57,7 +57,8 @@ func cudaVariant(gpuInfo CudaGPUInfo) string {
 		}
 	}
 
-	if gpuInfo.computeMajor < 6 || gpuInfo.DriverMajor < 12 || (gpuInfo.DriverMajor == 12 && gpuInfo.DriverMinor == 0) {
+	// driver 12.0 has problems with the cuda v12 library, so run v11 on those older drivers
+	if gpuInfo.DriverMajor < 12 || (gpuInfo.DriverMajor == 12 && gpuInfo.DriverMinor == 0) {
 		return "v11"
 	}
 	return "v12"
Repository: electron/electron
Pull request: feat: suppress devtools console logging

Backport of #49292

See that PR for details.


Notes: DevTools errors are no longer printed to console

Changed files:
filename: shell/browser/ui/inspectable_web_contents.cc
patch: @@ -13,6 +13,7 @@
 
 #include "base/base64.h"
 #include "base/containers/span.h"
+#include "base/dcheck_is_on.h"
 #include "base/memory/raw_ptr.h"
 #include "base/metrics/histogram.h"
 #include "base/strings/pattern.h"
@@ -957,6 +958,35 @@ bool InspectableWebContents::HandleKeyboardEvent(
   return !delegate || delegate->HandleKeyboardEvent(source, event);
 }
 
+bool InspectableWebContents::DidAddMessageToConsole(
+    content::WebContents* source,
+    blink::mojom::ConsoleMessageLevel log_level,
+    const std::u16string& message,
+    int32_t line_no,
+    const std::u16string& source_id) {
+  // Suppress Chromium's default logging of DevTools frontend console messages
+  // into native logs for the managed DevTools WebContents. Can be overridden by
+  // enabling verbose logging.
+  if (source == managed_devtools_web_contents_.get()) {
+#if DCHECK_IS_ON()
+    // In debug/testing builds, let logging through.
+    return false;
+#endif
+
+    if (VLOG_IS_ON(1)) {
+      // Match Chromium's `content::LogConsoleMessage()` output format, but emit
+      // it as a verbose log.
+      logging::LogMessage("CONSOLE", line_no, logging::LOGGING_VERBOSE).stream()
+          << "\"" << message << "\", source: " << source_id << " (" << line_no
+          << ")";
+    }
+
+    return true;  // Suppress the default logging.
+  }
+
+  return false;  // Allow the default logging.
+}
+
 void InspectableWebContents::CloseContents(content::WebContents* source) {
   // This is where the devtools closes itself (by clicking the x button).
   CloseDevTools();

filename: shell/browser/ui/inspectable_web_contents.h
patch: @@ -221,6 +221,11 @@ class InspectableWebContents
   // content::WebContentsDelegate:
   bool HandleKeyboardEvent(content::WebContents*,
                            const input::NativeWebKeyboardEvent&) override;
+  bool DidAddMessageToConsole(content::WebContents* source,
+                              blink::mojom::ConsoleMessageLevel log_level,
+                              const std::u16string& message,
+                              int32_t line_no,
+                              const std::u16string& source_id) override;
   void CloseContents(content::WebContents* source) override;
   std::unique_ptr<content::EyeDropper> OpenEyeDropper(
       content::RenderFrameHost* frame,