helloadhavan/github_issues huggingface dataset:
Repository: facebook/react
Pull request: Add authorization header to artifacts request

CircleCI's artifacts API was updated; it now errors unless you're logged in. This affects any of our workflows that download build artifacts.

To fix, I added an authorization header to the request.

Changed files:
filename: .circleci/config.yml
patch: @@ -127,22 +127,19 @@ jobs:
     environment: *environment
     steps:
       - checkout
-      - run: yarn workspaces info | head -n -1 > workspace_info.txt
-      - *restore_node_modules
       - run:
           name: Download artifacts for base revision
+          # TODO: We can't use the normal download-build script here because it
+          # depends on the CircleCI artifacts API, which was recently changed to
+          # require authorization. And we can't pass an authorization token
+          # without possibly leaking it to the public, since we run sizebot on
+          # PRs from external contributors. As a temporary workaround, this job
+          # will pull the artifacts from a public mirror that I set up. But we
+          # should find some other solution so we don't have to maintain
+          # the mirror.
           command: |
-              git fetch origin main
-              cd ./scripts/release && yarn && cd ../../
-              scripts/release/download-experimental-build.js --commit=$(git merge-base HEAD origin/main)
-              mv ./build ./base-build
-      - run:
-          # TODO: The `download-experimental-build` script copies the npm
-          # packages into the `node_modules` directory. This is a historical
-          # quirk of how the release script works. Let's pretend they
-          # don't exist.
-          name: Delete extraneous files
-          command: rm -rf ./base-build/node_modules
+            curl -L --retry 60 --retry-delay 10 --retry-max-time 600 https://react-builds.vercel.app/api/commits/$(git merge-base HEAD origin/main)/artifacts/build.tgz | tar -xz
+            mv ./build ./base-build
 
       - persist_to_workspace:
           root: .

filename: scripts/release/shared-commands/download-build-artifacts.js
patch: @@ -9,6 +9,14 @@ const {getArtifactsList, logPromise} = require('../utils');
 const theme = require('../theme');
 
 const run = async ({build, cwd, releaseChannel}) => {
+  const CIRCLE_TOKEN = process.env.CIRCLE_CI_API_TOKEN;
+  if (!CIRCLE_TOKEN) {
+    console.error(
+      theme.error('Missing required environment variable: CIRCLE_CI_API_TOKEN')
+    );
+    process.exit(1);
+  }
+
   const artifacts = await getArtifactsList(build);
   const buildArtifacts = artifacts.find(entry =>
     entry.path.endsWith('build.tgz')
@@ -24,7 +32,7 @@ const run = async ({build, cwd, releaseChannel}) => {
   // Download and extract artifact
   await exec(`rm -rf ./build`, {cwd});
   await exec(
-    `curl -L $(fwdproxy-config curl) ${buildArtifacts.url} | tar -xvz`,
+    `curl -L $(fwdproxy-config curl) ${buildArtifacts.url} -H "Circle-Token: ${CIRCLE_TOKEN}" | tar -xvz`,
     {
       cwd,
     }
Repository: ggml-org/llama.cpp
Pull request: context : fix state io for memory-less contexts

fix #13463

Avoid nullptr dereference for memory-less contexts such as rerankers and embedders.

Changed files:
filename: src/llama-context.cpp
patch: @@ -1788,30 +1788,37 @@ size_t llama_context::state_read_data(llama_io_read_i & io) {
         }
     }
 
-    LLAMA_LOG_DEBUG("%s: - reading KV self\n", __func__);
-    llama_kv_cache * kv_self = static_cast<llama_kv_cache *>(memory.get());
+    if (memory) {
+        LLAMA_LOG_DEBUG("%s: - reading KV self\n", __func__);
 
-    kv_self->state_read(io);
+        llama_kv_cache * kv_self = static_cast<llama_kv_cache *>(memory.get());
+
+        kv_self->state_read(io);
+    }
 
     return io.n_bytes();
 }
 
 size_t llama_context::state_seq_write_data(llama_io_write_i & io, llama_seq_id seq_id) {
     GGML_UNUSED(seq_id);
 
-    llama_kv_cache * kv_self = static_cast<llama_kv_cache *>(memory.get());
+    if (memory) {
+        llama_kv_cache * kv_self = static_cast<llama_kv_cache *>(memory.get());
 
-    kv_self->state_write(io, seq_id);
+        kv_self->state_write(io, seq_id);
+    }
 
     return io.n_bytes();
 }
 
 size_t llama_context::state_seq_read_data(llama_io_read_i & io, llama_seq_id seq_id) {
     GGML_UNUSED(seq_id);
 
-    llama_kv_cache * kv_self = static_cast<llama_kv_cache *>(memory.get());
+    if (memory) {
+        llama_kv_cache * kv_self = static_cast<llama_kv_cache *>(memory.get());
 
-    kv_self->state_read(io, seq_id);
+        kv_self->state_read(io, seq_id);
+    }
 
     return io.n_bytes();
 }
Repository: facebook/react
Pull request: Add Offscreen stateNode

Add state node on Offscreen fibers with id (in preparation for transition tracing)

Changed files:
filename: packages/react-reconciler/src/ReactFiber.new.js
patch: @@ -15,7 +15,10 @@ import type {WorkTag} from './ReactWorkTags';
 import type {TypeOfMode} from './ReactTypeOfMode';
 import type {Lanes} from './ReactFiberLane.new';
 import type {SuspenseInstance, Props} from './ReactFiberHostConfig';
-import type {OffscreenProps} from './ReactFiberOffscreenComponent';
+import type {
+  OffscreenProps,
+  OffscreenInstance,
+} from './ReactFiberOffscreenComponent';
 
 import {
   createRootStrictEffectsByDefault,
@@ -735,6 +738,8 @@ export function createFiberFromOffscreen(
   const fiber = createFiber(OffscreenComponent, pendingProps, key, mode);
   fiber.elementType = REACT_OFFSCREEN_TYPE;
   fiber.lanes = lanes;
+  const primaryChildInstance: OffscreenInstance = {};
+  fiber.stateNode = primaryChildInstance;
   return fiber;
 }
 

filename: packages/react-reconciler/src/ReactFiber.old.js
patch: @@ -15,7 +15,10 @@ import type {WorkTag} from './ReactWorkTags';
 import type {TypeOfMode} from './ReactTypeOfMode';
 import type {Lanes} from './ReactFiberLane.old';
 import type {SuspenseInstance, Props} from './ReactFiberHostConfig';
-import type {OffscreenProps} from './ReactFiberOffscreenComponent';
+import type {
+  OffscreenProps,
+  OffscreenInstance,
+} from './ReactFiberOffscreenComponent';
 
 import {
   createRootStrictEffectsByDefault,
@@ -735,6 +738,8 @@ export function createFiberFromOffscreen(
   const fiber = createFiber(OffscreenComponent, pendingProps, key, mode);
   fiber.elementType = REACT_OFFSCREEN_TYPE;
   fiber.lanes = lanes;
+  const primaryChildInstance: OffscreenInstance = {};
+  fiber.stateNode = primaryChildInstance;
   return fiber;
 }
 

filename: packages/react-reconciler/src/ReactFiberOffscreenComponent.js
patch: @@ -31,3 +31,5 @@ export type OffscreenState = {|
   baseLanes: Lanes,
   cachePool: SpawnedCachePool | null,
 |};
+
+export type OffscreenInstance = {};
Repository: vercel/next.js
Pull request: Update Turbopack development test manifest

This auto-generated PR updates the development integration test manifest used when testing Turbopack.

Changed files:
filename: test/turbopack-dev-tests-manifest.json
patch: @@ -8807,13 +8807,6 @@
     "flakey": [],
     "runtimeError": false
   },
-  "test/e2e/app-dir/turbopack-loader-resource-query/turbopack-loader-resource-query.test.ts": {
-    "passed": ["turbopack-loader-resource-query should pass query to loader"],
-    "failed": [],
-    "pending": [],
-    "flakey": [],
-    "runtimeError": false
-  },
   "test/e2e/app-dir/turbopack-reports/turbopack-reports.test.ts": {
     "passed": ["turbopack-reports should render page importing sqlite3"],
     "failed": [],
@@ -9024,6 +9017,8 @@
       "use-cache should revalidate caches nested in unstable_cache",
       "use-cache should update after unstable_expireTag correctly",
       "use-cache should use revalidate config in fetch",
+      "use-cache usage in node_modules should cache results when using a directive with a handler",
+      "use-cache usage in node_modules should cache results when using a directive without a handler",
       "use-cache works with \"use cache\" in method props",
       "use-cache works with \"use cache\" in static class methods",
       "use-cache works with useActionState if previousState parameter is not used in \"use cache\" function"
@@ -9082,6 +9077,15 @@
     "flakey": [],
     "runtimeError": false
   },
+  "test/e2e/app-dir/webpack-loader-binary/webpack-loader-binary.test.ts": {
+    "passed": [
+      "webpack-loader-ts-transform should allow passing binary assets to and from a Webpack loader"
+    ],
+    "failed": [],
+    "pending": [],
+    "flakey": [],
+    "runtimeError": false
+  },
   "test/e2e/app-dir/webpack-loader-conditions/webpack-loader-conditions.test.ts": {
     "passed": [
       "webpack-loader-conditions should render correctly on client side",
@@ -9092,6 +9096,13 @@
     "flakey": [],
     "runtimeError": false
   },
+  "test/e2e/app-dir/webpack-loader-resource-query/turbopack-loader-resource-query.test.ts": {
+    "passed": ["webpack-loader-resource-query should pass query to loader"],
+    "failed": [],
+    "pending": [],
+    "flakey": [],
+    "runtimeError": false
+  },
   "test/e2e/app-dir/webpack-loader-ts-transform/webpack-loader-ts-transform.test.ts": {
     "passed": [
       "webpack-loader-ts-transform should accept Typescript returned from Webpack loaders"
Repository: huggingface/transformers
Pull request: fix link in kv_cache.md

Fix link reference in cache docs.

## Before submitting
- [ ] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
- [ ] Did you read the [contributor guideline](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#create-a-pull-request),
      Pull Request section?
- [ ] Was this discussed/approved via a Github issue or the [forum](https://discuss.huggingface.co/)? Please add a link
      to it if that's the case.
- [ ] Did you make sure to update the documentation with your changes? Here are the
      [documentation guidelines](https://github.com/huggingface/transformers/tree/main/docs), and
      [here are tips on formatting docstrings](https://github.com/huggingface/transformers/tree/main/docs#writing-source-documentation).
- [ ] Did you write any new necessary tests?


## Who can review?

Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.




Changed files:
filename: docs/source/en/kv_cache.md
patch: @@ -18,7 +18,7 @@ rendered properly in your Markdown viewer.
 
 The key-value (KV) vectors are used to calculate attention scores. For autoregressive models, KV scores are calculated *every* time because the model predicts one token at a time. Each prediction depends on the previous tokens, which means the model performs the same computations each time.
 
-A KV *cache* stores these calculations so they can be reused without recomputing them. Efficient caching is crucial for optimizing model performance because it reduces computation time and improves response rates. Refer to the [Caching](./cache_explanation.md) doc for a more detailed explanation about how a cache works.
+A KV *cache* stores these calculations so they can be reused without recomputing them. Efficient caching is crucial for optimizing model performance because it reduces computation time and improves response rates. Refer to the [Caching](./cache_explanation) doc for a more detailed explanation about how a cache works.
 
 Transformers offers several [`Cache`] classes that implement different caching mechanisms. Some of these [`Cache`] classes are optimized to save memory while others are designed to maximize generation speed. Refer to the table below to compare cache types and use it to help you select the best cache for your use case.
Repository: electron/electron
Pull request: fix: -Wunsafe-buffer-usage warning in V8Serializer::Serialize()

Backport of #43642

See that PR for details.


Notes: none.

Changed files:
filename: shell/common/v8_value_serializer.cc
patch: @@ -49,10 +49,12 @@ class V8Serializer : public v8::ValueSerializer::Delegate {
     }
     DCHECK(wrote_value);
 
-    std::pair<uint8_t*, size_t> buffer = serializer_.Release();
-    DCHECK_EQ(buffer.first, data_.data());
-    out->encoded_message = base::make_span(buffer.first, buffer.second);
+    const auto [data_bytes, data_len] = serializer_.Release();
+    DCHECK_EQ(std::data(data_), data_bytes);
+    DCHECK_GE(std::size(data_), data_len);
+    data_.resize(data_len);
     out->owned_encoded_message = std::move(data_);
+    out->encoded_message = out->owned_encoded_message;
     out->sender_agent_cluster_id =
         blink::WebMessagePort::GetEmbedderAgentClusterID();
Repository: denoland/deno
Pull request: fix: make `deno add` output more deterministic

Will fix some flaky tests.

```
---- specs::remove::basic ----
command /Users/runner/work/deno/deno/target/debug/deno add @std/assert @std/http
command cwd /var/folders/cy/09t6wxdj6qn64c5q9_kr6czr0000gn/T/deno-cli-testKwb00C
output path /Users/runner/work/deno/deno/tests/specs/remove/basic/add.out
-- OUTPUT START --
Created deno.json configuration file.
Add jsr:@std/http@1.0.0
Add jsr:@std/assert@1.0.0
Download http://127.0.0.1:4250/@std/http/1.0.0_meta.json
Download http://127.0.0.1:4250/@std/assert/1.0.0_meta.json
Download http://127.0.0.1:4250/@std/http/1.0.0/mod.ts
Download http://127.0.0.1:4250/@std/assert/1.0.0/mod.ts
Download http://127.0.0.1:4250/@std/assert/1.0.0/assert_equals.ts
Download http://127.0.0.1:4250/@std/assert/1.0.0/assert.ts
Download http://127.0.0.1:4250/@std/assert/1.0.0/fail.ts

-- OUTPUT END --
-- EXPECTED START --
Created deno.json configuration file.
Add jsr:@std/assert@1.0.0
Add jsr:@std/http@1.0.0
[UNORDERED_START]
Download http://127.0.0.1:4250/@std/http/1.0.0_meta.json
Download http://127.0.0.1:4250/@std/assert/1.0.0_meta.json
Download http://127.0.0.1:4250/@std/http/1.0.0/mod.ts
Download http://127.0.0.1:4250/@std/assert/1.0.0/mod.ts
Download http://127.0.0.1:4250/@std/assert/1.0.0/assert_equals.ts
Download http://127.0.0.1:4250/@std/assert/1.0.0/assert.ts
Download http://127.0.0.1:4250/@std/assert/1.0.0/fail.ts
[UNORDERED_END]
```

Changed files:
filename: cli/tools/registry/pm.rs
patch: @@ -247,7 +247,7 @@ pub async fn add(
     .collect::<Vec<_>>();
 
   let stream_of_futures = deno_core::futures::stream::iter(package_futures);
-  let mut buffered = stream_of_futures.buffer_unordered(10);
+  let mut buffered = stream_of_futures.buffered(10);
 
   while let Some(package_and_version_result) = buffered.next().await {
     let package_and_version = package_and_version_result?;
Repository: vercel/next.js
Pull request: Turbopack: fix search_index merging in trace server

Fix a regression in https://github.com/vercel/next.js/pull/78357
Bug found by @sokra as well: https://github.com/vercel/next.js/pull/78357#discussion_r2063544480

Closes PACK-4588

Changed files:
filename: turbopack/crates/turbopack-trace-server/src/span_ref.rs
patch: @@ -498,7 +498,9 @@ impl<'a> SpanRef<'a> {
                                 add_span_to_map(&mut map, span);
                             }
                             SpanOrMap::Map(other_map) => {
-                                map.extend(other_map);
+                                for (name, value) in other_map {
+                                    map.entry(name).or_default().extend(value);
+                                }
                             }
                         }
                         SpanOrMap::Map(map)
Repository: ggml-org/llama.cpp
Pull request: Allow content null for tool call

Fixes for https://github.com/ggml-org/llama.cpp/issues/13471, thanks @CISC 

Changed files:
filename: tools/server/utils.hpp
patch: @@ -644,7 +644,7 @@ static json oaicompat_completion_params_parse(
     }
     for (auto & msg : messages) {
         json & content = msg.at("content");
-        if (content.is_string()) {
+        if (content.is_string() || content.is_null()) {
             continue;
         }
Repository: nodejs/node
Pull request: tools: add REPLACEME check to workflow

Enables updating placeholders in documents

#56249

Changed files:
filename: .github/workflows/lint-release-proposal.yml
patch: @@ -57,3 +57,6 @@ jobs:
       - name: Verify NODE_VERSION_IS_RELEASE bit is correctly set
         run: |
           grep -q '^#define NODE_VERSION_IS_RELEASE 1$' src/node_version.h
+      - name: Check for placeholders in documentation
+        run: |
+          ! grep "REPLACEME" doc/api/*.md
Repository: facebook/react
Pull request: Don't hide console error|warn in inspectedElement-test

## Summary

Use `jest.spyOn` instead of `console.error = () => {}`. The former will ensure that `jest.restoreAllMocks()` restores console methods.The latter will result in console error|warn in subsequent tests to be hidden.

## How did you test this change?

- [x] [CI without https://github.com/facebook/react/pull/24084 logs error](https://app.circleci.com/pipelines/github/facebook/react/24858/workflows/026a8190-a19c-4f26-9fcf-ff7047072ae7/jobs/451955/parallel-runs/7?filterBy=ALL)
- [x] [CI based on `main` errors not](https://app.circleci.com/pipelines/github/facebook/react/24859/workflows/6dd5f764-d23a-4414-a074-be25ba1b9910/jobs/451985/parallel-runs/7?filterBy=ALL)

## Follow-up

- [ ] What's up with these [deep stack traces for console.error calls](https://app.circleci.com/pipelines/github/facebook/react/24858/workflows/026a8190-a19c-4f26-9fcf-ff7047072ae7/jobs/451955/parallel-runs/7?filterBy=ALL)?

Changed files:
filename: packages/react-devtools-shared/src/__tests__/inspectedElement-test.js
patch: @@ -459,7 +459,7 @@ describe('InspectedElement', () => {
     const prevInspectedElement = inspectedElement;
 
     // This test causes an intermediate error to be logged but we can ignore it.
-    console.error = () => {};
+    jest.spyOn(console, 'error').mockImplementation(() => {});
 
     // Wait for our check-for-updates poll to get the new data.
     jest.runOnlyPendingTimers();
@@ -2804,16 +2804,18 @@ describe('InspectedElement', () => {
       );
 
       // Suppress expected error and warning.
-      const originalError = console.error;
-      const originalWarn = console.warn;
-      console.error = () => {};
-      console.warn = () => {};
+      const consoleErrorMock = jest
+        .spyOn(console, 'error')
+        .mockImplementation(() => {});
+      const consoleWarnMock = jest
+        .spyOn(console, 'warn')
+        .mockImplementation(() => {});
 
       // now force error state on <Example />
       await toggleError(true);
 
-      console.error = originalError;
-      console.warn = originalWarn;
+      consoleErrorMock.mockRestore();
+      consoleWarnMock.mockRestore();
 
       // we are in error state now, <Example /> won't show up
       withErrorsOrWarningsIgnored(['Invalid index'], () => {
Repository: electron/electron
Pull request: fix: -Wunsafe-buffer-usage warning in V8Serializer::Serialize()

#### Description of Change

Part 4 in a [series](https://github.com/electron/electron/pull/43477) to fix `-Wunsafe-buffer-usage` warnings in electron `shell/`.

This PR fixes a warning in `electron::V8Serializer::Serialize()`. It does this by using a correctly-sized `data_` field directly so that we don't need to make a call to `UNSAFE_BUFFER_USAGE base::make_span()`.

The warning fixed by this PR:

```
../../electron/shell/common/v8_value_serializer.cc:54:28: error: function introduces unsafe buffer manipulation [-Werror,-Wunsafe-buffer-usage]
   54 |     out->encoded_message = base::make_span(buffer.first, buffer.second);
      |                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../electron/shell/common/v8_value_serializer.cc:54:28: note: pass -fsafe-buffer-usage-suggestions to receive code hardening suggestions
```

#### Checklist

- [x] PR description included and stakeholders cc'd
- [x] `npm test` passes
- [x] [PR release notes](https://github.com/electron/clerk/blob/main/README.md) describe the change in a way relevant to app developers, and are [capitalized, punctuated, and past tense](https://github.com/electron/clerk/blob/main/README.md#examples).

#### Release Notes

Notes: none.

Changed files:
filename: shell/common/v8_value_serializer.cc
patch: @@ -49,10 +49,12 @@ class V8Serializer : public v8::ValueSerializer::Delegate {
     }
     DCHECK(wrote_value);
 
-    std::pair<uint8_t*, size_t> buffer = serializer_.Release();
-    DCHECK_EQ(buffer.first, data_.data());
-    out->encoded_message = base::make_span(buffer.first, buffer.second);
+    const auto [data_bytes, data_len] = serializer_.Release();
+    DCHECK_EQ(std::data(data_), data_bytes);
+    DCHECK_GE(std::size(data_), data_len);
+    data_.resize(data_len);
     out->owned_encoded_message = std::move(data_);
+    out->encoded_message = out->owned_encoded_message;
     out->sender_agent_cluster_id =
         blink::WebMessagePort::GetEmbedderAgentClusterID();
Repository: denoland/deno
Pull request: fix(node/http): wrong `req.url` value

This PR addresses a regression introduced in https://github.com/denoland/deno/pull/25021 that would cause the `req.url` parameter in Node's http server to always be a single character instead of the expected value. The regression was caused by effectively calling `.indexOf()` on an empty string and thus passing the wrong index for slicing.

```js
"".indexOf("/") // -> -1
request.url.slice(-1) // effectively only giving us the last character
```

Fixes https://github.com/denoland/deno/issues/25080

Changed files:
filename: ext/node/polyfills/http.ts
patch: @@ -1781,7 +1781,8 @@ export class ServerImpl extends EventEmitter {
       });
 
       const req = new IncomingMessageForServer(socket);
-      req.url = request.url?.slice(req.url.indexOf("/", 8));
+      // Slice off the origin so that we only have pathname + search
+      req.url = request.url?.slice(request.url.indexOf("/", 8));
       req.method = request.method;
       req.upgrade =
         request.headers.get("connection")?.toLowerCase().includes("upgrade") &&

filename: tests/unit_node/http_test.ts
patch: @@ -1539,3 +1539,21 @@ Deno.test("[node/http] ClientRequest PUT subarray", async () => {
   await promise;
   assertEquals(body, "world");
 });
+
+Deno.test("[node/http] req.url equals pathname + search", async () => {
+  const { promise, resolve } = Promise.withResolvers<void>();
+
+  const server = http.createServer((req, res) => res.end(req.url));
+  server.listen(async () => {
+    const { port } = server.address() as net.AddressInfo;
+    const res = await fetch(`http://localhost:${port}/foo/bar?baz=1`);
+    const text = await res.text();
+    assertEquals(text, "/foo/bar?baz=1");
+
+    server.close(() => {
+      resolve();
+    });
+  });
+
+  await promise;
+});