helloadhavan/github_issues huggingface dataset:
Repository: facebook/react
Pull request: [DevTools] Shrink/Deshrink Owners breadcrumbs on any resizes

## Summary

We only recalculated the size when the window resizes. However, resize also happens when the inner panes are resized. Deep owner tree took up all the space since resizing wasn't possible anymore.

We use `ResizeObserver` now to cover all cases triggering a resize.

## How did you test this change?

Before:

https://github.com/user-attachments/assets/12dcd7d2-0dc1-4006-bc17-a5f174a2f4c8




After:


https://github.com/user-attachments/assets/12ec6b1d-716a-4774-a72d-614130462c91




Changed files:
filename: packages/react-devtools-shared/src/devtools/views/hooks.js
patch: @@ -112,30 +112,38 @@ export function useEditableValue(
 }
 
 export function useIsOverflowing(
-  containerRef: {current: HTMLDivElement | null, ...},
+  containerRef: {current: HTMLDivElement | null},
   totalChildWidth: number,
 ): boolean {
   const [isOverflowing, setIsOverflowing] = useState<boolean>(false);
 
   // It's important to use a layout effect, so that we avoid showing a flash of overflowed content.
   useLayoutEffect(() => {
-    if (containerRef.current === null) {
-      return () => {};
+    const container = containerRef.current;
+    if (container === null) {
+      return;
     }
 
-    const container = ((containerRef.current: any): HTMLDivElement);
-
-    const handleResize = () =>
-      setIsOverflowing(container.clientWidth <= totalChildWidth);
+    // ResizeObserver on the global did not fire for the extension.
+    // We need to grab the ResizeObserver from the container's window.
+    const ResizeObserver = container.ownerDocument.defaultView.ResizeObserver;
+    const observer = new ResizeObserver(entries => {
+      const entry = entries[0];
+      const contentWidth = entry.contentRect.width;
+      setIsOverflowing(
+        contentWidth <=
+          // We need to treat the box as overflowing when you're just
+          // about to overflow.
+          // Otherwise you won't be able to resize panes with custom resize handles.
+          // Previously we were relying on clientWidth which is already rounded.
+          // We don't want to read that again since that would trigger another layout.
+          totalChildWidth + 1,
+      );
+    });
 
-    handleResize();
+    observer.observe(container);
 
-    // It's important to listen to the ownerDocument.defaultView to support the browser extension.
-    // Here we use portals to render individual tabs (e.g. Profiler),
-    // and the root document might belong to a different window.
-    const ownerWindow = container.ownerDocument.defaultView;
-    ownerWindow.addEventListener('resize', handleResize);
-    return () => ownerWindow.removeEventListener('resize', handleResize);
+    return observer.disconnect.bind(observer);
   }, [containerRef, totalChildWidth]);
 
   return isOverflowing;
Repository: ollama/ollama
Pull request: mlxrunner: Fix panic on full KV cache hit

When the entire prompt was already cached (e.g. repeated prompt), findRemaining returned an empty slice, causing FromValues to panic on an index-out-of-range accessing a zero-length byte slice.

Fix by always keeping at least one token to re-evaluate so the pipeline can seed token generation. Also reject empty prompts early rather than panicking.

Changed files:
filename: x/mlxrunner/cache.go
patch: @@ -78,6 +78,12 @@ func (c *kvCache) findRemaining(tokens []int32) []int32 {
 		prefix++
 	}
 
+	// Always keep at least one token to re-evaluate so the
+	// pipeline can seed token generation from it.
+	if prefix == len(tokens) && prefix > 0 {
+		prefix--
+	}
+
 	if prefix < len(c.tokens) {
 		trim := len(c.tokens) - prefix
 		for _, kv := range c.caches {

filename: x/mlxrunner/pipeline.go
patch: @@ -47,14 +47,17 @@ func (r *Runner) TextGenerationPipeline(request Request) error {
 	mlx.ResetPeakMemory()
 
 	inputs := r.Tokenizer.Encode(request.Prompt, true)
+	if len(inputs) == 0 {
+		return errors.New("empty prompt")
+	}
+
 	session := r.cache.begin(r.Model, inputs)
 	defer session.close()
 
 	caches := session.caches
 	tokens := session.remaining
 
 	total, processed := len(tokens), 0
-	slog.Info("Prompt processing progress", "processed", processed, "total", total)
 	for total-processed > 1 {
 		if err := request.Ctx.Err(); err != nil {
 			return err
@@ -104,7 +107,6 @@ func (r *Runner) TextGenerationPipeline(request Request) error {
 		nextSample, nextLogprobs = step(sample)
 
 		if i == 0 {
-			slog.Info("Prompt processing progress", "processed", total, "total", total)
 			mlx.Eval(sample)
 			final.PromptTokensDuration = time.Since(now)
 			now = time.Now()
Repository: huggingface/transformers
Pull request: Fix AutoProcessor.from_pretrained silently dropping hub kwargs

## What does this PR do?

Fixes `AutoProcessor.from_pretrained` silently dropping hub kwargs like `force_download`, `cache_dir`, `token`, `revision`, etc.

### The bug

The existing code on line ~300 filters kwargs using `inspect.signature(cached_file).parameters`:

```python
cached_file_kwargs = {key: kwargs[key] for key in inspect.signature(cached_file).parameters if key in kwargs}
```

But `cached_file()` is defined as:

```python
def cached_file(path_or_repo_id, filename, **kwargs):
```

So `inspect.signature` only sees three parameter names: `path_or_repo_id`, `filename`, and `kwargs`. Hub parameters like `force_download`, `cache_dir`, `token`, etc. are never matched, and get silently dropped before reaching the `cached_file` calls.

### The fix

Replace the `inspect.signature` filtering with an explicit tuple of the hub parameter names that `cached_file` actually accepts (via `cached_files`). This is consistent with how other auto classes like `AutoTokenizer` handle the same situation -- they pass hub kwargs explicitly by name rather than trying to introspect the signature.

Also removes the now-unused `import inspect`.

Fixes #44704

## Who can review?

@ArthurZucker @Rocketknight1

Changed files:
filename: src/transformers/models/auto/processing_auto.py
patch: @@ -14,7 +14,6 @@
 """AutoProcessor class."""
 
 import importlib
-import inspect
 import json
 from collections import OrderedDict
 from typing import TYPE_CHECKING
@@ -299,7 +298,18 @@ def from_pretrained(cls, pretrained_model_name_or_path, **kwargs):
 
         # First, let's see if we have a processor or preprocessor config.
         # Filter the kwargs for `cached_file`.
-        cached_file_kwargs = {key: kwargs[key] for key in inspect.signature(cached_file).parameters if key in kwargs}
+        _hub_valid_kwargs = (
+            "cache_dir",
+            "force_download",
+            "proxies",
+            "token",
+            "revision",
+            "local_files_only",
+            "subfolder",
+            "repo_type",
+            "user_agent",
+        )
+        cached_file_kwargs = {key: kwargs[key] for key in _hub_valid_kwargs if key in kwargs}
         # We don't want to raise
         cached_file_kwargs.update(
             {
Repository: huggingface/transformers
Pull request: Fix `maybe_autocast` crashing on meta device tensors

## What does this PR do?

`maybe_autocast` calls `torch.is_autocast_enabled(device_type)` which raises a `RuntimeError` when `device_type` is `"meta"`:

```
RuntimeError: unknown device type for autocast in get_autocast_dispatch_key_from_device_type
```

This breaks any code that runs a forward pass on meta tensors — for example, [`nnsight`](https://github.com/ndif-team/nnsight)'s `.scan()` context, which traces the computational graph using meta tensors without materializing weights.

The error path is: `LlamaRotaryEmbedding.forward` → `maybe_autocast(device_type="meta", enabled=False)` → `torch.is_autocast_enabled("meta")` → 💥

Since autocast is meaningless on meta tensors (they don't compute anything), this PR returns `nullcontext()` early when `device_type == "meta"`.

This affects all 20+ model files that use `maybe_autocast` (via RoPE or directly), so fixing it at the source in `maybe_autocast` is preferable to patching each callsite.

## Reproduction

```python
import torch
torch.is_autocast_enabled("meta")  # RuntimeError
```

```python
# With nnsight / any meta-tensor forward pass:
from nnsight import LanguageModel
model = LanguageModel("meta-llama/Llama-3.1-70B")
with model.scan("test"):  # crashes in RoPE forward
    pass
```

## Fix

```python
def maybe_autocast(device_type, dtype=None, enabled=True, cache_enabled=None):
    if device_type == "meta":
        return nullcontext()
    ...
```

## Note on AI usage

🤖 Generated with [Claude Code](https://claude.ai/code)
👨 reviewed by the human:
This bug came out in some mech interp class and I maintain the nnterp library that was used and encounter this issue. claude helped me to traceback the issue to transformers and the fix proposed fix our issue and is clean and minimal

Changed files:
filename: src/transformers/utils/generic.py
patch: @@ -196,6 +196,8 @@ def maybe_autocast(
     Which makes graph splitting in `torch.compile` more flexible as it removes the
     requirement that partition IDs be monotonically increasing.
     """
+    if device_type == "meta":
+        return nullcontext()
     if torch.is_autocast_enabled(device_type) or enabled:
         return torch.autocast(device_type, dtype=dtype, enabled=enabled, cache_enabled=cache_enabled)
     else:
Repository: nodejs/node
Pull request: tools: adopt the `--check-for-duplicates` NCU flag

Refs: https://github.com/nodejs/node-core-utils/issues/1035

<!--
Before submitting a pull request, please read:

- the CONTRIBUTING guide at https://github.com/nodejs/node/blob/HEAD/CONTRIBUTING.md
- the commit message formatting guidelines at
  https://github.com/nodejs/node/blob/HEAD/doc/contributing/pull-requests.md#commit-message-guidelines

For code changes:
1. Include tests for any bug fixes or new features.
2. Update documentation if relevant.
3. Ensure that `make -j4 test` (UNIX), or `vcbuild test` (Windows) passes.

If you believe this PR should be highlighted in the Node.js CHANGELOG
please add the `notable-change` label.

Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I
    have the right to submit it under the open source license
    indicated in the file; or

(b) The contribution is based upon previous work that, to the best
    of my knowledge, is covered under an appropriate open source
    license and I have the right under that license to submit that
    work with modifications, whether created in whole or in part
    by me, under the same open source license (unless I am
    permitted to submit under a different license), as indicated
    in the file; or

(c) The contribution was provided directly to me by some other
    person who certified (a), (b) or (c) and I have not modified
    it.

(d) I understand and agree that this project and the contribution
    are public and that a record of the contribution (including all
    personal information I submit with it, including my sign-off) is
    maintained indefinitely and may be redistributed consistent with
    this project or the open source license(s) involved.
-->


Changed files:
filename: tools/actions/start-ci.sh
patch: @@ -10,7 +10,7 @@ for pr in "$@"; do
 
   ci_started=yes
   rm -f output;
-  ncu-ci run "$pr" >output 2>&1 || ci_started=no
+  ncu-ci run --check-for-duplicates "$pr" >output 2>&1 || ci_started=no
   cat output
 
   if [ "$ci_started" = "no" ]; then
Repository: ollama/ollama
Pull request: fix: window app crash on startup when update is pending

**Summary**

- Fix nil pointer dereference panic on Windows when the app starts with a
pending update
- Add nil guard to UpdateAvailable to prevent crash when tray is not yet
initialized
- Re-check for pending updates inside osRun after the tray is initialized

Fixes #14450

Changed files:
filename: app/cmd/app/app.go
patch: @@ -296,8 +296,15 @@ func main() {
 
 	// Check for pending updates on startup (show tray notification if update is ready)
 	if updater.IsUpdatePending() {
-		slog.Debug("update pending on startup, showing tray notification")
-		UpdateAvailable("")
+		// On Windows, the tray is initialized in osRun(). Calling UpdateAvailable
+		// before that would dereference a nil tray callback.
+		// TODO: refactor so the update check runs after platform init on all platforms.
+		if runtime.GOOS == "windows" {
+			slog.Debug("update pending on startup, deferring tray notification until tray initialization")
+		} else {
+			slog.Debug("update pending on startup, showing tray notification")
+			UpdateAvailable("")
+		}
 	}
 
 	hasCompletedFirstRun, err := st.HasCompletedFirstRun()

filename: app/cmd/app/app_windows.go
patch: @@ -154,6 +154,10 @@ func handleURLSchemeRequest(urlScheme string) {
 }
 
 func UpdateAvailable(ver string) error {
+	if app.t == nil {
+		slog.Debug("tray not yet initialized, skipping update notification")
+		return nil
+	}
 	return app.t.UpdateAvailable(ver)
 }
 
@@ -165,6 +169,14 @@ func osRun(shutdown func(), hasCompletedFirstRun, startHidden bool) {
 		log.Fatalf("Failed to start: %s", err)
 	}
 
+	// Check for pending updates now that the tray is initialized.
+	// The platform-independent check in app.go fires before osRun,
+	// when app.t is still nil, so we must re-check here.
+	if updater.IsUpdatePending() {
+		slog.Debug("update pending on startup, showing tray notification")
+		UpdateAvailable("")
+	}
+
 	signals := make(chan os.Signal, 1)
 	signal.Notify(signals, syscall.SIGINT, syscall.SIGTERM)
Repository: ollama/ollama
Pull request: app: fix first update check delayed by 1 hour

**Summary**

- Fix a regression from #13512 where the first update check was delayed by ~60 minutes instead of ~3 seconds after startup. The refactor changed the loop from check-then-wait to wait-then-check, so the first iteration blocked on the ticker instead of checking immediately.
- Reuse the existing store.Store in startHiddenTasks() instead of creating a second instance, avoiding an unnecessary duplicate DB connection.
- Fix a misleading comment that said "regardless of toggle state" on a code path only reachable when auto-update is enabled.


Changed files:
filename: app/cmd/app/app.go
patch: @@ -35,6 +35,7 @@ import (
 var (
 	wv           = &Webview{}
 	uiServerPort int
+	appStore     *store.Store
 )
 
 var debug = strings.EqualFold(os.Getenv("OLLAMA_DEBUG"), "true") || os.Getenv("OLLAMA_DEBUG") == "1"
@@ -208,6 +209,7 @@ func main() {
 	uiServerPort = port
 
 	st := &store.Store{}
+	appStore = st
 
 	// Enable CORS in development mode
 	if devMode {
@@ -360,8 +362,7 @@ func startHiddenTasks() {
 			slog.Info("deferring pending update for fast startup")
 		} else {
 			// Check if auto-update is enabled before automatically upgrading
-			st := &store.Store{}
-			settings, err := st.Settings()
+			settings, err := appStore.Settings()
 			if err != nil {
 				slog.Warn("failed to load settings for upgrade check", "error", err)
 			} else if !settings.AutoUpdateEnabled {

filename: app/updater/updater.go
patch: @@ -289,6 +289,7 @@ func (u *Updater) TriggerImmediateCheck() {
 
 func (u *Updater) StartBackgroundUpdaterChecker(ctx context.Context, cb func(string) error) {
 	u.checkNow = make(chan struct{}, 1)
+	u.checkNow <- struct{}{} // Trigger first check after initial delay
 	go func() {
 		// Don't blast an update message immediately after startup
 		time.Sleep(UpdateCheckInitialDelay)
@@ -333,7 +334,7 @@ func (u *Updater) StartBackgroundUpdaterChecker(ctx context.Context, cb func(str
 				continue
 			}
 
-			// Download successful - show tray notification (regardless of toggle state)
+			// Download successful - show tray notification
 			err = cb(resp.UpdateVersion)
 			if err != nil {
 				slog.Warn("failed to register update available with tray", "error", err)

filename: app/updater/updater_test.go
patch: @@ -351,10 +351,13 @@ func TestTriggerImmediateCheck(t *testing.T) {
 
 	updater.StartBackgroundUpdaterChecker(ctx, cb)
 
-	// Wait for goroutine to start and pass initial delay
-	time.Sleep(10 * time.Millisecond)
+	// Wait for the initial check that fires after the initial delay
+	select {
+	case <-checkDone:
+	case <-time.After(2 * time.Second):
+		t.Fatal("initial check did not happen")
+	}
 
-	// With 1 hour interval, no check should have happened yet
 	initialCount := checkCount.Load()
 
 	// Trigger immediate check
Repository: vercel/next.js
Pull request: Turbopack: correctly apply effects for issue snapshots

`snapshot_issues` emits effects when `UPDATE=1` 

Changed files:
filename: turbopack/crates/turbopack-tests/tests/snapshot.rs
patch: @@ -11,7 +11,7 @@ use rustc_hash::FxHashSet;
 use serde::Deserialize;
 use serde_json::json;
 use turbo_rcstr::{RcStr, rcstr};
-use turbo_tasks::{Effects, ResolvedVc, TurboTasks, Vc, get_effects, turbofmt};
+use turbo_tasks::{Effects, OperationVc, ResolvedVc, TurboTasks, Vc, get_effects, turbofmt};
 use turbo_tasks_backend::{BackendOptions, TurboTasksBackend, noop_backing_storage};
 use turbo_tasks_env::DotenvProcessEnv;
 use turbo_tasks_fs::{
@@ -222,7 +222,7 @@ async fn run(resource: PathBuf) -> Result<()> {
     ));
     tt.run_once(async move {
         #[turbo_tasks::function(operation)]
-        async fn inner_operation(resource: RcStr) -> Result<Vc<Effects>> {
+        async fn inner_operation(resource: RcStr) -> Result<Vc<()>> {
             let out_op = run_test_operation(resource);
             let out_vc = out_op.resolve_strongly_consistent().await?.owned().await?;
 
@@ -234,10 +234,16 @@ async fn run(resource: PathBuf) -> Result<()> {
             snapshot_issues(plain_issues, out_vc.join("issues")?, &REPO_ROOT)
                 .await
                 .context("Unable to handle issues")?;
+            Ok(Vc::cell(()))
+        }
 
-            Ok(get_effects(out_op).await?.cell())
+        #[turbo_tasks::function(operation)]
+        async fn extract_effects(op: OperationVc<()>) -> Result<Vc<Effects>> {
+            let _ = op.resolve_strongly_consistent().await?;
+            Ok(get_effects(op).await?.cell())
         }
-        inner_operation(resource.to_str().unwrap().into())
+
+        extract_effects(inner_operation(resource.to_str().unwrap().into()))
             .read_strongly_consistent()
             .await?
             .apply()
Repository: nodejs/node
Pull request: build: support empty libname flags in `configure.py`

Without this patch, passing e.g. `--shared-sqlite-libname=` ends up passing `-l''` in the lib flags, and there is no way to defer to the pkgconfig ones.

<!--
Before submitting a pull request, please read:

- the CONTRIBUTING guide at https://github.com/nodejs/node/blob/HEAD/CONTRIBUTING.md
- the commit message formatting guidelines at
  https://github.com/nodejs/node/blob/HEAD/doc/contributing/pull-requests.md#commit-message-guidelines

For code changes:
1. Include tests for any bug fixes or new features.
2. Update documentation if relevant.
3. Ensure that `make -j4 test` (UNIX), or `vcbuild test` (Windows) passes.

If you believe this PR should be highlighted in the Node.js CHANGELOG
please add the `notable-change` label.

Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I
    have the right to submit it under the open source license
    indicated in the file; or

(b) The contribution is based upon previous work that, to the best
    of my knowledge, is covered under an appropriate open source
    license and I have the right under that license to submit that
    work with modifications, whether created in whole or in part
    by me, under the same open source license (unless I am
    permitted to submit under a different license), as indicated
    in the file; or

(c) The contribution was provided directly to me by some other
    person who certified (a), (b) or (c) and I have not modified
    it.

(d) I understand and agree that this project and the contribution
    are public and that a record of the contribution (including all
    personal information I submit with it, including my sign-off) is
    maintained indefinitely and may be redistributed consistent with
    this project or the open source license(s) involved.
-->


Changed files:
filename: configure.py
patch: @@ -2007,10 +2007,9 @@ def configure_library(lib, output, pkgname=None):
       output['libraries'] += [pkg_libpath]
 
     default_libs = getattr(options, shared_lib + '_libname')
-    default_libs = [f'-l{l}' for l in default_libs.split(',')]
 
     if default_libs:
-      output['libraries'] += default_libs
+      output['libraries'] += [f'-l{l}' for l in default_libs.split(',')]
     elif pkg_libs:
       output['libraries'] += pkg_libs.split()
Repository: facebook/react
Pull request: [test] add activity test with gSBU and enableViewTransition bugfix

Related to https://github.com/facebook/react/pull/35548, `enableViewTransition` fixes a bug where `getSnapshotBeforeUpdate` was running in hidden trees when it shouldn't (`componentWillUpdate` won't run for hidden updates, and when it becomes visible it will be called with `componentWillMount`).

Changed files:
filename: packages/react-reconciler/src/__tests__/Activity-test.js
patch: @@ -1527,6 +1527,87 @@ describe('Activity', () => {
     expect(root).toMatchRenderedOutput(<span prop={2} />);
   });
 
+  // @gate enableActivity
+  it('getSnapshotBeforeUpdate does not run in hidden trees', async () => {
+    let setState;
+
+    class Child extends React.Component {
+      getSnapshotBeforeUpdate(prevProps) {
+        const snapshot = `snapshot-${prevProps.value}-to-${this.props.value}`;
+        Scheduler.log(`getSnapshotBeforeUpdate: ${snapshot}`);
+        return snapshot;
+      }
+      componentDidUpdate(prevProps, prevState, snapshot) {
+        Scheduler.log(`componentDidUpdate: ${snapshot}`);
+      }
+      componentDidMount() {
+        Scheduler.log('componentDidMount');
+      }
+      componentWillUnmount() {
+        Scheduler.log('componentWillUnmount');
+      }
+      render() {
+        Scheduler.log(`render: ${this.props.value}`);
+        return <span prop={this.props.value} />;
+      }
+    }
+
+    function Wrapper({show}) {
+      const [value, _setState] = useState(1);
+      setState = _setState;
+      return (
+        <Activity mode={show ? 'visible' : 'hidden'}>
+          <Child value={value} />
+        </Activity>
+      );
+    }
+
+    const root = ReactNoop.createRoot();
+
+    // Initial render
+    await act(() => {
+      root.render(<Wrapper show={true} />);
+    });
+    assertLog(['render: 1', 'componentDidMount']);
+
+    // Hide the Activity
+    await act(() => {
+      root.render(<Wrapper show={false} />);
+    });
+    assertLog([
+      'componentWillUnmount',
+      'render: 1',
+      // Bugfix: snapshots for hidden trees should not need to be read.
+      ...(gate('enableViewTransition')
+        ? []
+        : ['getSnapshotBeforeUpdate: snapshot-1-to-1']),
+    ]);
+
+    // Trigger an update while hidden by calling setState
+    await act(() => {
+      setState(2);
+    });
+    assertLog([
+      'render: 2',
+      ...(gate('enableViewTransition')
+        ? []
+        : ['getSnapshotBeforeUpdate: snapshot-1-to-2']),
+    ]);
+
+    // This is treated as a new mount so the snapshot also shouldn't be read.
+    await act(() => {
+      root.render(<Wrapper show={true} />);
+    });
+    assertLog([
+      'render: 2',
+      ...(gate('enableViewTransition')
+        ? []
+        : ['getSnapshotBeforeUpdate: snapshot-2-to-2']),
+      'componentDidMount',
+    ]);
+  });
+
+  // @gate enableActivity
   it('warns if you pass a hidden prop', async () => {
     function App() {
       return (