helloadhavan/github_issues huggingface dataset:
Repository: facebook/react
Pull request: [Flight] Unwrap lazy before reading the value

This is important if the lazy is at the root of the chunk. I don't have a unit test for it but @gnoff has a repro.

It also shouldn't unwrap the last value since that's the one we're referencing.

This was already done correctly by @unstubbable in waitForReference so this just aligns with that.

Changed files:
filename: packages/react-client/src/ReactFlightClient.js
patch: @@ -1057,8 +1057,7 @@ function getOutlinedModel<T>(
     case INITIALIZED:
       let value = chunk.value;
       for (let i = 1; i < path.length; i++) {
-        value = value[path[i]];
-        if (value.$$typeof === REACT_LAZY_TYPE) {
+        while (value.$$typeof === REACT_LAZY_TYPE) {
           const referencedChunk: SomeChunk<any> = value._payload;
           if (referencedChunk.status === INITIALIZED) {
             value = referencedChunk.value;
@@ -1069,10 +1068,11 @@ function getOutlinedModel<T>(
               key,
               response,
               map,
-              path.slice(i),
+              path.slice(i - 1),
             );
           }
         }
+        value = value[path[i]];
       }
       const chunkValue = map(response, value);
       if (__DEV__ && chunk._debugInfo) {
Repository: denoland/deno
Pull request: fix(ext/node): require --allow-net for udp.send


Changed files:
filename: ext/node/ops/udp.rs
patch: @@ -460,6 +460,13 @@ pub async fn op_node_udp_send(
   #[string] hostname: String,
   #[smi] port: u16,
 ) -> Result<usize, NodeUdpError> {
+  {
+    state
+      .borrow_mut()
+      .borrow_mut::<PermissionsContainer>()
+      .check_net(&(&hostname, Some(port)), "socket.send()")?;
+  }
+
   let resource = state
     .borrow()
     .resource_table

filename: tests/unit_node/dgram_test.ts
patch: @@ -175,6 +175,55 @@ Deno.test("[node/dgram] addSourceSpecificMembership and dropSourceSpecificMember
   await promise;
 });
 
+Deno.test("[node/dgram] send checks destination permission", {
+  permissions: { read: true, write: true, run: true, net: true },
+}, async () => {
+  // Verify that a subprocess with restricted --allow-net cannot send to
+  // destinations outside the allowed set.
+  const tempFile = Deno.makeTempFileSync({ suffix: ".ts" });
+  Deno.writeTextFileSync(
+    tempFile,
+    `import dgram from "node:dgram";
+const socket = dgram.createSocket("udp4");
+socket.bind(0, "0.0.0.0", () => {
+  socket.send("test", 9999, "127.0.0.1", (err) => {
+    if (err) {
+      console.log("SEND_BLOCKED:" + err.message);
+    } else {
+      console.log("SEND_ALLOWED");
+    }
+    socket.close();
+  });
+});
+socket.on("error", (err) => {
+  console.log("ERROR:" + err.message);
+  socket.close();
+});
+`,
+  );
+  try {
+    const { stdout, stderr } = await new Deno.Command(Deno.execPath(), {
+      args: [
+        "run",
+        "--no-prompt",
+        "--allow-net=0.0.0.0:0",
+        "--allow-read=" + tempFile,
+        tempFile,
+      ],
+      stdout: "piped",
+      stderr: "piped",
+    }).output();
+    const output = new TextDecoder().decode(stdout) +
+      new TextDecoder().decode(stderr);
+    assert(
+      !output.includes("SEND_ALLOWED"),
+      `Send should have been blocked, but got: ${output}`,
+    );
+  } finally {
+    Deno.removeSync(tempFile);
+  }
+});
+
 Deno.test("[node/dgram] large recvBufferSize and sendBufferSize do not throw", async () => {
   const { promise, resolve, reject } = Promise.withResolvers<void>();
   const socket = createSocket({
Repository: huggingface/transformers
Pull request: pin torchcodec on CI docker image

# What does this PR do?

As previous PR, we have issues with torch torchcodec 2.9

Changed files:
filename: docker/transformers-all-latest-gpu/Dockerfile
patch: @@ -24,7 +24,8 @@ RUN git clone https://github.com/huggingface/transformers && cd transformers &&
 # 1. Put several commands in a single `RUN` to avoid image/layer exporting issue. Could be revised in the future.
 # 2. Regarding `torch` part, We might need to specify proper versions for `torchvision` and `torchaudio`.
 #    Currently, let's not bother to specify their versions explicitly (so installed with their latest release versions).
-RUN python3 -m pip install --no-cache-dir -e ./transformers[dev,onnxruntime] && [ ${#PYTORCH} -gt 0 -a "$PYTORCH" != "pre" ] && VERSION='torch=='$PYTORCH'.*' ||  VERSION='torch'; echo "export VERSION='$VERSION'" >> ~/.profile && echo torch=$VERSION && [ "$PYTORCH" != "pre" ] && python3 -m pip install --no-cache-dir -U $VERSION torchvision torchaudio torchcodec --extra-index-url https://download.pytorch.org/whl/$CUDA || python3 -m pip install --no-cache-dir -U --pre torch torchvision torchaudio torchcodec --extra-index-url https://download.pytorch.org/whl/nightly/$CUDA
+# 3. For `torchcodec<0.8`: this is quickly added as torch 2.9.0 + torchcodec 0.8.0 fails on our CI env. Need to remove later once they work.
+RUN python3 -m pip install --no-cache-dir -e ./transformers[dev,onnxruntime] && [ ${#PYTORCH} -gt 0 -a "$PYTORCH" != "pre" ] && VERSION='torch=='$PYTORCH'.*' ||  VERSION='torch'; echo "export VERSION='$VERSION'" >> ~/.profile && echo torch=$VERSION && [ "$PYTORCH" != "pre" ] && python3 -m pip install --no-cache-dir -U $VERSION torchvision torchaudio "torchcodec<0.8" --extra-index-url https://download.pytorch.org/whl/$CUDA || python3 -m pip install --no-cache-dir -U --pre torch torchvision torchaudio torchcodec --extra-index-url https://download.pytorch.org/whl/nightly/$CUDA
 
 RUN python3 -m pip install --no-cache-dir -U timm
Repository: denoland/deno
Pull request: fix(ext/node): validate handle type in child_process send()

When `send(msg, handle)` is called with an invalid handle type (e.g. a string), Node.js throws ERR_INVALID_HANDLE_TYPE. Deno was hitting a generic `notImplemented()` error instead, since the handle validation was missing before the not-implemented guard.

Now validates that the handle is a recognized type (net.Socket, Server, or object with _handle) before rejecting, matching Node.js error behavior.

Changed files:
filename: ext/node/polyfills/internal/child_process.ts
patch: @@ -43,6 +43,7 @@ import {
   AbortError,
   ERR_INVALID_ARG_TYPE,
   ERR_INVALID_ARG_VALUE,
+  ERR_INVALID_HANDLE_TYPE,
   ERR_INVALID_SYNC_FORK_INPUT,
   ERR_IPC_CHANNEL_CLOSED,
   ERR_IPC_SYNC_FORK,
@@ -66,7 +67,8 @@ import process from "node:process";
 import { StringPrototypeSlice } from "ext:deno_node/internal/primordials.mjs";
 import { StreamBase } from "ext:deno_node/internal_binding/stream_wrap.ts";
 import { Pipe, socketType } from "ext:deno_node/internal_binding/pipe_wrap.ts";
-import { Socket } from "node:net";
+import { Server as NetServer, Socket } from "node:net";
+import { Socket as DgramSocket } from "node:dgram";
 import {
   kExtraStdio,
   kInputOption,
@@ -1882,6 +1884,15 @@ export function setupChannel(
     }
 
     if (handle !== undefined) {
+      // Validate handle type before rejecting as not implemented.
+      // Node.js only accepts net.Server, net.Socket, or dgram.Socket.
+      if (
+        !(handle instanceof Socket) &&
+        !(handle instanceof NetServer) &&
+        !(handle instanceof DgramSocket)
+      ) {
+        throw new ERR_INVALID_HANDLE_TYPE();
+      }
       notImplemented("ChildProcess.send with handle");
     }
 

filename: tests/node_compat/config.jsonc
patch: @@ -240,6 +240,7 @@
     "parallel/test-child-process-reject-null-bytes.js": {},
     "parallel/test-child-process-send-after-close.js": {},
     "parallel/test-child-process-send-cb.js": {},
+    "parallel/test-child-process-send-type-error.js": {},
     "parallel/test-child-process-set-blocking.js": {},
     "parallel/test-child-process-silent.js": {},
     "parallel/test-child-process-spawn-controller.js": {},
Repository: electron/electron
Pull request: test: cleanup RenderFrame lifespan tests

Backport of #47746

See that PR for details.


Notes: <!-- Please add a one-line description for app developers to read in the release notes, or 'none' if no notes relevant to app developers. Examples and help on special cases: https://github.com/electron/clerk/blob/main/README.md#examples -->none


Changed files:
filename: spec/api-web-frame-main-spec.ts
patch: @@ -313,6 +313,7 @@ describe('webFrameMain module', () => {
     beforeEach(async () => {
       w = new BrowserWindow({ show: false });
     });
+    afterEach(closeAllWindows);
 
     // TODO(jkleinsc) fix this flaky test on linux
     ifit(process.platform !== 'linux')('throws upon accessing properties when disposed', async () => {
@@ -373,7 +374,9 @@ describe('webFrameMain module', () => {
       await w.webContents.loadURL(server.crossOriginUrl);
       // senderFrame now points to a disposed RenderFrameHost. It should
       // be null when attempting to access the lazily evaluated property.
-      expect(event.senderFrame).to.be.null();
+      waitUntil(() => {
+        return event.senderFrame === null;
+      });
     });
 
     it('is detached when unload handler sends IPC', async () => {

filename: spec/chromium-spec.ts
patch: @@ -3089,7 +3089,7 @@ describe('iframe using HTML fullscreen API while window is OS-fullscreened', ()
   });
 });
 
-describe('navigator.serial', () => {
+ifdescribe(process.platform !== 'darwin' || process.arch !== 'arm64')('navigator.serial', () => {
   let w: BrowserWindow;
   before(async () => {
     w = new BrowserWindow({
@@ -3621,7 +3621,7 @@ ifdescribe((process.platform !== 'linux' || app.isUnityRunning()))('navigator.se
   });
 });
 
-describe('navigator.bluetooth', () => {
+ifdescribe(process.platform !== 'darwin' || process.arch !== 'arm64')('navigator.bluetooth', () => {
   let w: BrowserWindow;
   before(async () => {
     w = new BrowserWindow({
Repository: denoland/deno
Pull request: fix(ext/node): fix IPC message prototype for child_process JSON

Deno's serde_v8 layer deserializes JSON objects with null prototype (Object.create(null)), but Node.js IPC messages should have Object.prototype (as if from JSON.parse). This caused assert.deepStrictEqual to fail when comparing IPC messages.

For the JSON serialization mode, re-parse the message through JSON.parse(JSON.stringify(msg)) to restore normal prototypes.


Changed files:
filename: ext/node/polyfills/internal/child_process.ts
patch: @@ -1517,6 +1517,21 @@ function buildCommand(
   return [file, args, includeNpmProcessState];
 }
 
+// deno-lint-ignore no-explicit-any
+function restorePrototype(obj: any) {
+  if (obj === null || typeof obj !== "object") return;
+  if (Array.isArray(obj)) {
+    for (let i = 0; i < obj.length; i++) {
+      restorePrototype(obj[i]);
+    }
+    return;
+  }
+  Object.setPrototypeOf(obj, Object.prototype);
+  for (const key of Object.keys(obj)) {
+    restorePrototype(obj[key]);
+  }
+}
+
 function _createSpawnError(
   status: string,
   command: string,
@@ -1823,6 +1838,11 @@ export function setupChannel(
     if (!target.channel) {
       return;
     }
+    // serde_v8 deserializes objects with null prototype, but Node.js IPC
+    // messages should have Object.prototype (as if from JSON.parse).
+    if (serialization === "json") {
+      restorePrototype(msg);
+    }
     if (target.listenerCount("message") !== 0) {
       target.emit("message", msg);
       return;

filename: tests/node_compat/config.jsonc
patch: @@ -227,6 +227,7 @@
     "parallel/test-child-process-fork-close.js": {},
     "parallel/test-child-process-fork-detached.js": {},
     "parallel/test-child-process-fork-no-shell.js": {},
+    "parallel/test-child-process-fork-stdio-string-variant.js": {},
     "parallel/test-child-process-fork-ref.js": {},
     "parallel/test-child-process-fork-ref2.js": {},
     // "parallel/test-child-process-fork-timeout-kill-signal.js": {}, // https://github.com/denoland/deno/issues/32706
Repository: ggml-org/llama.cpp
Pull request: server: modify return_progress to also report 0% processing state

Ref comment: https://github.com/ggml-org/llama.cpp/issues/17079#issuecomment-3683031957

(See the test to understand what's included in the first chunk)


Changed files:
filename: tools/server/server-context.cpp
patch: @@ -2313,6 +2313,12 @@ struct server_context_impl {
                         slot.n_prompt_tokens_processed = 0;
 
                         slot.prompt.tokens.keep_first(n_past);
+
+                        // send initial 0% progress update if needed
+                        // this is to signal the client that the request has started processing
+                        if (slot.task->params.stream && slot.task->params.return_progress) {
+                            send_partial_response(slot, {}, true);
+                        }
                     }
 
                     if (!slot.can_split()) {

filename: tools/server/tests/unit/test_chat_completion.py
patch: @@ -434,8 +434,8 @@ def test_context_size_exceeded_stream():
 @pytest.mark.parametrize(
     "n_batch,batch_count,reuse_cache",
     [
-        (64, 3, False),
-        (64, 1, True),
+        (64, 4, False),
+        (64, 2, True),
     ]
 )
 def test_return_progress(n_batch, batch_count, reuse_cache):
@@ -462,17 +462,26 @@ def make_cmpl_request():
     res = make_cmpl_request()
     last_progress = None
     total_batch_count = 0
+
     for data in res:
         cur_progress = data.get("prompt_progress", None)
         if cur_progress is None:
             continue
+        if total_batch_count == 0:
+            # first progress report must have n_cache == n_processed
+            assert cur_progress["total"] > 0
+            assert cur_progress["cache"] == cur_progress["processed"]
+            if reuse_cache:
+                # when reusing cache, we expect some cached tokens
+                assert cur_progress["cache"] > 0
         if last_progress is not None:
             assert cur_progress["total"] == last_progress["total"]
             assert cur_progress["cache"] == last_progress["cache"]
             assert cur_progress["processed"] > last_progress["processed"]
         total_batch_count += 1
         last_progress = cur_progress
 
+    # last progress should indicate completion (all tokens processed)
     assert last_progress is not None
     assert last_progress["total"] > 0
     assert last_progress["processed"] == last_progress["total"]
Repository: facebook/react
Pull request: [Fiber] Don't call performance.now() twice in a row


Changed files:
filename: packages/react-reconciler/src/ReactProfilerTimer.js
patch: @@ -101,7 +101,7 @@ function startProfilerTimer(fiber: Fiber): void {
   profilerStartTime = now();
 
   if (((fiber.actualStartTime: any): number) < 0) {
-    fiber.actualStartTime = now();
+    fiber.actualStartTime = profilerStartTime;
   }
 }
Repository: huggingface/transformers
Pull request: Simplify GQA conditions in sdpa_attention.py

Removed unnecessary checks for key being a torch.fx.Proxy in GQA conditions because fx tracing is no longer supported, and torch.export supports enable_gqa.

Changed files:
filename: src/transformers/integrations/sdpa_attention.py
patch: @@ -32,13 +32,11 @@ def use_gqa_in_sdpa(attention_mask: Optional[torch.Tensor], key: torch.Tensor) -
     # 1.cuda or Ascend NPU
     #   - torch version >= 2.5
     #   - attention_mask is None (otherwise it will fall back to the math kernel)
-    #   - key is not a torch.fx.Proxy (otherwise it will fail with a tracing error)
     # 2.xpu
     #   - torch version >= 2.8
-    #   - key is not a torch.fx.Proxy (otherwise it will fail with a tracing error)
     if _is_torch_xpu_available:
-        return _is_torch_greater_or_equal_than_2_8 and not isinstance(key, torch.fx.Proxy)
-    return _is_torch_greater_or_equal_than_2_5 and attention_mask is None and not isinstance(key, torch.fx.Proxy)
+        return _is_torch_greater_or_equal_than_2_8
+    return _is_torch_greater_or_equal_than_2_5 and attention_mask is None
 
 
 def sdpa_attention_forward(
Repository: nodejs/node
Pull request: doc: type improvement of file `http.md`, `outgoingMessage.setHeader` and `outgoingMessage.getHeader` section

[setHeader](https://github.com/samuel871211/DefinitelyTyped/blob/master/types/node/http.d.ts#L613)
[getHeader](https://github.com/samuel871211/DefinitelyTyped/blob/master/types/node/http.d.ts#L672)

<!--
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: doc/api/http.md
patch: @@ -2142,7 +2142,7 @@ added: v0.4.0
 -->
 
 * `name` {string}
-* Returns: {any}
+* Returns: {number | string | string\[] | undefined}
 
 Reads out a header that's already been queued but not sent to the client.
 The name is case-insensitive. The type of the return value depends
@@ -2277,7 +2277,7 @@ added: v0.4.0
 -->
 
 * `name` {string}
-* `value` {any}
+* `value` {number | string | string\[]}
 * Returns: {http.ServerResponse}
 
 Returns the response object.
@@ -3228,7 +3228,7 @@ added: v0.4.0
 -->
 
 * `name` {string} Name of header
-* Returns: {string | undefined}
+* Returns: {number | string | string\[] | undefined}
 
 Gets the value of the HTTP header with the given name. If that header is not
 set, the returned value will be `undefined`.
@@ -3330,7 +3330,7 @@ added: v0.4.0
 -->
 
 * `name` {string} Header name
-* `value` {any} Header value
+* `value` {number | string | string\[]} Header value
 * Returns: {this}
 
 Sets a single header value. If the header already exists in the to-be-sent
Repository: ollama/ollama
Pull request: Fix paste of text with line feed characters

Hey there, thanks for this awesome tool 🙌 

This is a small patch to fix copy-paste with some terminals that send line feed characters when pasting text with newlines.

To test these changes, run ollama in interactive mode on [Kitty](https://github.com/kovidgoyal/kitty) and paste:
```txt
text
on multiple
lines
```

Curiously this issue doesn't occur on MacOS's default terminal, because it sends CR characters for the newlines. I'm not sure which terminal behavior is the correct one, anyway I figured it would make sense for ollama to support CR and LF characters in the same way.

Changed files:
filename: readline/readline.go
patch: @@ -218,7 +218,7 @@ func (i *Instance) Readline() (string, error) {
 		case CharCtrlZ:
 			fd := int(syscall.Stdin)
 			return handleCharCtrlZ(fd, i.Terminal.termios)
-		case CharEnter:
+		case CharEnter, CharCtrlJ:
 			output := buf.String()
 			if output != "" {
 				i.History.Add([]rune(output))
@@ -232,7 +232,7 @@ func (i *Instance) Readline() (string, error) {
 				metaDel = false
 				continue
 			}
-			if r >= CharSpace || r == CharEnter {
+			if r >= CharSpace || r == CharEnter || r == CharCtrlJ {
 				buf.Add(r)
 			}
 		}
Repository: facebook/react
Pull request: [Flight] Reset currentOwnerInDEV

Missed this bit.

Changed files:
filename: packages/react-client/src/ReactFlightClient.js
patch: @@ -2368,6 +2368,7 @@ const replayConsoleWithCallStack = {
       }
       callStack();
     } finally {
+      currentOwnerInDEV = null;
       ReactSharedInternals.getCurrentStack = prevStack;
     }
   },
Repository: denoland/deno
Pull request: fix(ext/node): gracefully exit on invalid NODE_CHANNEL_FD instead of panicking

## Summary
- When process managers like PM2 set `NODE_CHANNEL_FD` to a file descriptor that isn't a valid IPC pipe, Deno would panic during bootstrap with "Bootstrap exception"
- Now it prints a clear error message and exits with code 1 instead
- Adds a spec test verifying the graceful exit behavior

Closes #29007

## Test plan
- [x] `NODE_CHANNEL_FD=999 ./target/debug/deno eval 'console.log("hello")'` prints error and exits 1 (no panic)
- [x] Normal execution without `NODE_CHANNEL_FD` still works
- [x] Legitimate IPC via `fork()` still works
- [x] Spec test `tests/specs/node/invalid_ipc_channel_fd` passes

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Changed files:
filename: ext/node/ops/ipc.rs
patch: @@ -186,18 +186,28 @@ mod impl_ {
     log::debug!("op_node_child_ipc_pipe: {:?}, {:?}", fd, serialization);
     let ref_tracker = IpcRefTracker::new(state.external_ops_tracker.clone());
     match serialization {
-      ChildIpcSerialization::Json => Ok(Some((
-        state
-          .resource_table
-          .add(IpcJsonStreamResource::new(fd, ref_tracker)?),
-        0,
-      ))),
-      ChildIpcSerialization::Advanced => Ok(Some((
-        state
-          .resource_table
-          .add(IpcAdvancedStreamResource::new(fd, ref_tracker)?),
-        1,
-      ))),
+      ChildIpcSerialization::Json => {
+        match IpcJsonStreamResource::new(fd, ref_tracker) {
+          Ok(resource) => Ok(Some((state.resource_table.add(resource), 0))),
+          Err(err) => {
+            log::error!(
+              "Failed to open IPC channel from NODE_CHANNEL_FD ({fd}): {err}"
+            );
+            std::process::exit(1);
+          }
+        }
+      }
+      ChildIpcSerialization::Advanced => {
+        match IpcAdvancedStreamResource::new(fd, ref_tracker) {
+          Ok(resource) => Ok(Some((state.resource_table.add(resource), 1))),
+          Err(err) => {
+            log::error!(
+              "Failed to open IPC channel from NODE_CHANNEL_FD ({fd}): {err}"
+            );
+            std::process::exit(1);
+          }
+        }
+      }
     }
   }
 

filename: tests/specs/node/invalid_ipc_channel_fd/__test__.jsonc
patch: @@ -0,0 +1,8 @@
+{
+  "args": "eval console.log('hello')",
+  "output": "Failed to open IPC channel from NODE_CHANNEL_FD (999): [WILDCARD]\n",
+  "exitCode": 1,
+  "envs": {
+    "NODE_CHANNEL_FD": "999"
+  }
+}