helloadhavan/github_issues huggingface dataset:
Repository: facebook/react
Pull request: Special case printing Promises in Performance Track Properties

Before:
<img width="266" alt="Screenshot 2025-06-30 at 8 32 23 AM" src="https://github.com/user-attachments/assets/98aae5e1-4b2c-49bd-9b71-040b788c36ba" />

After:
<img width="342" alt="Screenshot 2025-06-30 at 8 39 17 AM" src="https://github.com/user-attachments/assets/cd91c4a6-f6ae-4bec-9cd9-f42f4af468fe" />


Changed files:
filename: packages/shared/ReactPerformanceTrackProperties.js
patch: @@ -145,6 +145,40 @@ export function addValueToProperties(
             return;
           }
         }
+        if (objectName === 'Promise') {
+          if (value.status === 'fulfilled') {
+            // Print the inner value
+            const idx = properties.length;
+            addValueToProperties(propertyName, value.value, properties, indent);
+            if (properties.length > idx) {
+              // Wrap the value or type in Promise descriptor.
+              const insertedEntry = properties[idx];
+              insertedEntry[1] =
+                'Promise<' + (insertedEntry[1] || 'Object') + '>';
+              return;
+            }
+          } else if (value.status === 'rejected') {
+            // Print the inner error
+            const idx = properties.length;
+            addValueToProperties(
+              propertyName,
+              value.reason,
+              properties,
+              indent,
+            );
+            if (properties.length > idx) {
+              // Wrap the value or type in Promise descriptor.
+              const insertedEntry = properties[idx];
+              insertedEntry[1] = 'Rejected Promise<' + insertedEntry[1] + '>';
+              return;
+            }
+          }
+          properties.push([
+            '\xa0\xa0'.repeat(indent) + propertyName,
+            'Promise',
+          ]);
+          return;
+        }
         if (objectName === 'Object') {
           const proto: any = Object.getPrototypeOf(value);
           if (proto && typeof proto.constructor === 'function') {
Repository: ggml-org/llama.cpp
Pull request: fix: prevent nullptr dereference

When encountering an unsupported template (e.g. translategemma), the code currently dereferences a nullptr and causes the program to crash.

With this fix, a proper exception will be thrown from `common_chat_templates_apply_jinja` instead.

Changed files:
filename: common/chat-diff-analyzer.cpp
patch: @@ -479,6 +479,7 @@ analyze_content::analyze_content(const common_chat_template & tmpl, const analyz
 
     if (!comparison_with_tools || !comparison_with_reasoning) {
         LOG_DBG(ANSI_ORANGE "%s: Template application failed\n" ANSI_RESET, __func__);
+        return;
     }
 
     const auto & diff_tools     = comparison_with_tools->diff;
@@ -911,8 +912,10 @@ void analyze_tools::extract_function_markers() {
             // we'll have to rely on an extra diff with no-calls version
             auto notool_comp = compare_variants(
                 *tmpl, params, [&](template_params & p) { p.messages = json::array({ user_msg, assistant_nocall }); });
-            auto nt_diff  = notool_comp->diff;
-            closer_suffix = nt_diff.left.substr(nt_diff.left.find("YYYY") + 4);
+            if (notool_comp) {
+                auto nt_diff  = notool_comp->diff;
+                closer_suffix = nt_diff.left.substr(nt_diff.left.find("YYYY") + 4);
+            }
         } else {
             closer_suffix = diff.suffix.substr(0, diff.suffix.find(suffix_marker));
         }
Repository: facebook/react
Pull request: [Flight] Ensure we dedupe references if we later discover that it's the model root

I noticed we weren't deduping these cases.

Changed files:
filename: packages/react-server-dom-webpack/src/__tests__/ReactFlightDOMBrowser-test.js
patch: @@ -2574,4 +2574,54 @@ describe('ReactFlightDOMBrowser', () => {
     expect(errors).toEqual([new Error('Connection closed.')]);
     expect(container.innerHTML).toBe('');
   });
+
+  it('can dedupe references inside promises', async () => {
+    const foo = {};
+    const bar = {
+      foo: foo,
+    };
+    foo.bar = bar;
+
+    const object = {
+      foo: Promise.resolve(foo),
+      bar: Promise.resolve(bar),
+    };
+
+    const stream = await serverAct(() =>
+      ReactServerDOMServer.renderToReadableStream(object, webpackMap),
+    );
+
+    const response = await ReactServerDOMClient.createFromReadableStream(
+      passThrough(stream),
+    );
+
+    const responseFoo = await response.foo;
+    const responseBar = await response.bar;
+    expect(responseFoo.bar).toBe(responseBar);
+    expect(responseBar.foo).toBe(responseFoo);
+  });
+
+  it('can deduped outlined references inside promises', async () => {
+    const foo = {};
+    const bar = new Set([foo]); // This will be outlined which can create a future reference
+    foo.bar = bar;
+
+    const object = {
+      foo: Promise.resolve(foo),
+      bar: Promise.resolve(bar),
+    };
+
+    const stream = await serverAct(() =>
+      ReactServerDOMServer.renderToReadableStream(object, webpackMap),
+    );
+
+    const response = await ReactServerDOMClient.createFromReadableStream(
+      passThrough(stream),
+    );
+
+    const responseFoo = await response.foo;
+    const responseBar = await response.bar;
+    expect(responseFoo.bar).toBe(responseBar);
+    expect(Array.from(responseBar)[0]).toBe(responseFoo);
+  });
 });

filename: packages/react-server/src/ReactFlightServer.js
patch: @@ -3220,6 +3220,11 @@ function renderModelDestructive(
 
     if (existingReference !== undefined) {
       if (modelRoot === value) {
+        if (existingReference !== serializeByValueID(task.id)) {
+          // Turns out that we already have this root at a different reference.
+          // Use that after all.
+          return existingReference;
+        }
         // This is the ID we're currently emitting so we need to write it
         // once but if we discover it again, we refer to it by id.
         modelRoot = null;
Repository: vuejs/vue
Pull request: test: Add a unit test for "$off event and this event added by $once"

<!--
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
- [ ] Feature
- [ ] Code style update
- [ ] Refactor
- [ ] Build-related changes
- [x] Other, please describe: add a unit test for "$off event and this event added by $once"

**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:**

- [ ] It's submitted to the `dev` branch for v2.x (or to a previous version branch), _not_ the `master` branch
- [ ] 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
- [ ] 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: test/unit/features/instance/methods-events.spec.js
patch: @@ -56,6 +56,13 @@ describe('Instance methods events', () => {
     expect(spy).toHaveBeenCalledWith(1, 2, 3)
   })
 
+  it('$off event added by $once', () => {
+    vm.$once('test', spy)
+    vm.$off('test', spy) // test off event and this event added by once
+    vm.$emit('test', 1, 2, 3)
+    expect(spy).not.toHaveBeenCalled()
+  })
+
   it('$off', () => {
     vm.$on('test1', spy)
     vm.$on('test2', spy)
Repository: facebook/react
Pull request: [Flight] Don't replay performance logs when replayConsoleLogs is false

This is the same principle. They're both side-effects and go to the `console.*` namespace.


Changed files:
filename: packages/react-client/src/ReactFlightClient.js
patch: @@ -702,14 +702,16 @@ export function reportGlobalError(response: Response, error: Error): void {
     }
   }
   if (enableProfilerTimer && enableComponentPerformanceTrack) {
-    markAllTracksInOrder();
-    flushComponentPerformance(
-      response,
-      getChunk(response, 0),
-      0,
-      -Infinity,
-      -Infinity,
-    );
+    if (response._replayConsole) {
+      markAllTracksInOrder();
+      flushComponentPerformance(
+        response,
+        getChunk(response, 0),
+        0,
+        -Infinity,
+        -Infinity,
+      );
+    }
   }
 }
 
@@ -1838,7 +1840,9 @@ function ResponseInstance(
   if (enableProfilerTimer && enableComponentPerformanceTrack) {
     // Since we don't know when recording of profiles will start and stop, we have to
     // mark the order over and over again.
-    markAllTracksInOrder();
+    if (replayConsole) {
+      markAllTracksInOrder();
+    }
   }
 
   // Don't inline this call because it causes closure to outline the call above.
@@ -2963,28 +2967,30 @@ function initializeIOInfo(response: Response, ioInfo: ReactIOInfo): void {
   // $FlowFixMe[cannot-write]
   ioInfo.end += response._timeOrigin;
 
-  const env = response._rootEnvironmentName;
-  const promise = ioInfo.value;
-  if (promise) {
-    const thenable: Thenable<mixed> = (promise: any);
-    switch (thenable.status) {
-      case INITIALIZED:
-        logIOInfo(ioInfo, env, thenable.value);
-        break;
-      case ERRORED:
-        logIOInfoErrored(ioInfo, env, thenable.reason);
-        break;
-      default:
-        // If we haven't resolved the Promise yet, wait to log until have so we can include
-        // its data in the log.
-        promise.then(
-          logIOInfo.bind(null, ioInfo, env),
-          logIOInfoErrored.bind(null, ioInfo, env),
-        );
-        break;
+  if (response._replayConsole) {
+    const env = response._rootEnvironmentName;
+    const promise = ioInfo.value;
+    if (promise) {
+      const thenable: Thenable<mixed> = (promise: any);
+      switch (thenable.status) {
+        case INITIALIZED:
+          logIOInfo(ioInfo, env, thenable.value);
+          break;
+        case ERRORED:
+          logIOInfoErrored(ioInfo, env, thenable.reason);
+          break;
+        default:
+          // If we haven't resolved the Promise yet, wait to log until have so we can include
+          // its data in the log.
+          promise.then(
+            logIOInfo.bind(null, ioInfo, env),
+            logIOInfoErrored.bind(null, ioInfo, env),
+          );
+          break;
+      }
+    } else {
+      logIOInfo(ioInfo, env, undefined);
     }
-  } else {
-    logIOInfo(ioInfo, env, undefined);
   }
 }
Repository: huggingface/transformers
Pull request: Fix failing `recurrent_gemma` tests

# What does this PR do?

Fixes these failing [recurrent_gemma](https://github.com/huggingface/transformers/actions/runs/21199210283/job/60982514314#step:14:6060) tests.


<img width="2311" height="472" alt="image" src="https://github.com/user-attachments/assets/75b3122d-714a-4e95-8a99-de3886358ceb" />





## Before submitting
- [ ] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
- [x] 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?
@Rocketknight1 @vasqu, @Cyrilvallez (https://github.com/huggingface/transformers/pull/43255)

Changed files:
filename: src/transformers/models/recurrent_gemma/modeling_recurrent_gemma.py
patch: @@ -219,7 +219,7 @@ def forward(
         # Partial rotary embedding
         query_rot, query_pass = torch.chunk(query_states, int(1 / self.partial_rotary_factor), dim=-1)
         key_rot, key_pass = torch.chunk(key_states, int(1 / self.partial_rotary_factor), dim=-1)
-        query_rot, key_rot = apply_rotary_pos_emb(query_rot, key_rot, cos, sin, position_ids)
+        query_rot, key_rot = apply_rotary_pos_emb(query_rot, key_rot, cos, sin)
         query_states = torch.cat((query_rot, query_pass), dim=-1)
         key_states = torch.cat((key_rot, key_pass), dim=-1)
Repository: ollama/ollama
Pull request: Revert "parser: remove role validation from Modelfile parser (#9874)"

This reverts commit ffbfe833da387f9b6806fe887b85992c11d26eaa.

Changed files:
filename: parser/parser.go
patch: @@ -7,7 +7,6 @@ import (
 	"errors"
 	"fmt"
 	"io"
-	"log/slog"
 	"net/http"
 	"os"
 	"os/user"
@@ -301,8 +300,9 @@ const (
 )
 
 var (
-	errMissingFrom    = errors.New("no FROM line")
-	errInvalidCommand = errors.New("command must be one of \"from\", \"license\", \"template\", \"system\", \"adapter\", \"parameter\", or \"message\"")
+	errMissingFrom        = errors.New("no FROM line")
+	errInvalidMessageRole = errors.New("message role must be one of \"system\", \"user\", or \"assistant\"")
+	errInvalidCommand     = errors.New("command must be one of \"from\", \"license\", \"template\", \"system\", \"adapter\", \"parameter\", or \"message\"")
 )
 
 type ParserError struct {
@@ -379,10 +379,14 @@ func ParseFile(r io.Reader) (*Modelfile, error) {
 			case stateParameter:
 				cmd.Name = b.String()
 			case stateMessage:
-				role = b.String()
-				if !isKnownMessageRole(b.String()) {
-					slog.Warn("received non-standard role", "role", role)
+				if !isValidMessageRole(b.String()) {
+					return nil, &ParserError{
+						LineNumber: currLine,
+						Msg:        errInvalidMessageRole.Error(),
+					}
 				}
+
+				role = b.String()
 			case stateComment, stateNil:
 				// pass
 			case stateValue:
@@ -552,7 +556,7 @@ func isNewline(r rune) bool {
 	return r == '\r' || r == '\n'
 }
 
-func isKnownMessageRole(role string) bool {
+func isValidMessageRole(role string) bool {
 	return role == "system" || role == "user" || role == "assistant"
 }
 

filename: parser/parser_test.go
patch: @@ -256,13 +256,13 @@ You are a multiline file parser. Always parse things.
 		{
 			`
 FROM foo
-MESSAGE somerandomrole I'm ok with you adding any role message now!
+MESSAGE badguy I'm a bad guy!
 `,
-			[]Command{
-				{Name: "model", Args: "foo"},
-				{Name: "message", Args: "somerandomrole: I'm ok with you adding any role message now!"},
-			},
 			nil,
+			&ParserError{
+				LineNumber: 3,
+				Msg:        errInvalidMessageRole.Error(),
+			},
 		},
 		{
 			`
Repository: vuejs/vue
Pull request: fix #9571, rendering async components after initial context was destroyed

<!--
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
- [ ] Maybe (I'm not sure)

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
- [ ] 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:**

I have not heavily tested this in a lot of circumstances. The async part of it almost broke my brain ^^ But tests are passing, so... ¯\_(ツ)_/¯

Changed files:
filename: src/core/vdom/helpers/resolve-async-component.js
patch: @@ -8,7 +8,8 @@ import {
   isTrue,
   isObject,
   hasSymbol,
-  isPromise
+  isPromise,
+  remove
 } from 'core/util/index'
 
 import { createEmptyVNode } from 'core/vdom/vnode'
@@ -51,17 +52,21 @@ export function resolveAsyncComponent (
     return factory.resolved
   }
 
+  const owner = currentRenderingInstance
+  if (isDef(factory.owners) && factory.owners.indexOf(owner) === -1) {
+    // already pending
+    factory.owners.push(owner)
+  }
+
   if (isTrue(factory.loading) && isDef(factory.loadingComp)) {
     return factory.loadingComp
   }
 
-  const owner = currentRenderingInstance
-  if (isDef(factory.owners)) {
-    // already pending
-    factory.owners.push(owner)
-  } else {
+  if (!isDef(factory.owners)) {
     const owners = factory.owners = [owner]
     let sync = true
+ 
+    if (owner) owner.$on('hook:destroyed', () => remove(owners, owner))
 
     const forceRender = (renderCompleted: boolean) => {
       for (let i = 0, l = owners.length; i < l; i++) {
Repository: electron/electron
Pull request: fix: duplicate fullscreen macOS menu item

Backport of #49074

See that PR for details.


Notes: Fixed an issue whereby a duplicate "Toggle Full Screen" menu item appeared in the View menu on macOS.


Changed files:
filename: shell/browser/mac/electron_application_delegate.mm
patch: @@ -56,11 +56,6 @@ - (void)willPowerOff:(NSNotification*)notify {
 }
 
 - (void)applicationWillFinishLaunching:(NSNotification*)notify {
-  // Don't add the "Enter Full Screen" menu item automatically.
-  [[NSUserDefaults standardUserDefaults]
-      setBool:NO
-       forKey:@"NSFullScreenMenuItemEverywhere"];
-
   [[[NSWorkspace sharedWorkspace] notificationCenter]
       addObserver:self
          selector:@selector(willPowerOff:)

filename: shell/browser/ui/cocoa/electron_menu_controller.mm
patch: @@ -557,6 +557,14 @@ - (BOOL)isMenuOpen {
 
 - (void)menuWillOpen:(NSMenu*)menu {
   isMenuOpen_ = YES;
+
+  // macOS automatically injects a duplicate "Toggle Full Screen" menu item
+  // when we set menu.delegate on submenus. Remove hidden duplicates.
+  for (NSMenuItem* item in menu.itemArray) {
+    if (item.isHidden && item.action == @selector(toggleFullScreenMode:))
+      [menu removeItem:item];
+  }
+
   [self refreshMenuTree:menu];
   if (model_)
     model_->MenuWillShow();
Repository: huggingface/transformers
Pull request: Fix failing `ChameleonIntegrationTests`

# What does this PR do?

Fixes these failing [ChameleonIntegrationTests](https://github.com/huggingface/transformers/actions/runs/21199210283/job/60982512511#step:14:5322)

<img width="2294" height="322" alt="Screenshot from 2026-01-22 07-24-39" src="https://github.com/user-attachments/assets/b3650c09-6a9c-4280-adbd-2258087180d5" />




## Before submitting
- [ ] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
- [x] 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?
@Rocketknight1 @vasqu

Changed files:
filename: tests/models/chameleon/test_modeling_chameleon.py
patch: @@ -338,7 +338,7 @@ def test_model_7b(self):
         )
         prompt = "<image>Describe what do you see here and tell me about the history behind it?"
 
-        inputs = processor(images=image, text=prompt, return_tensors="pt").to(model.device, torch.float16)
+        inputs = processor(images=image, text=prompt, return_tensors="pt").to(model.device, torch.bfloat16)
 
         # greedy generation outputs
         EXPECTED_TEXT_COMPLETIONS = Expectations(
@@ -374,7 +374,7 @@ def test_model_7b_batched(self):
         ]
 
         inputs = processor(images=[image, image_2], text=prompts, padding=True, return_tensors="pt").to(
-            model.device, torch.float16
+            model.device, torch.bfloat16
         )
 
         # greedy generation outputs
@@ -416,7 +416,7 @@ def test_model_7b_multi_image(self):
         )
         prompt = "What do these two images have in common?<image><image>"
 
-        inputs = processor(images=[image, image_2], text=prompt, return_tensors="pt").to(model.device, torch.float16)
+        inputs = processor(images=[image, image_2], text=prompt, return_tensors="pt").to(model.device, torch.bfloat16)
 
         # greedy generation outputs
         EXPECTED_TEXT_COMPLETION = ['What do these two images have in common?The two images show a connection between the night sky and the internet. The first image shows a starry night sky, with the stars arranged in a pattern that resembles the structure of the internet. The']  # fmt: skip
Repository: electron/electron
Pull request: fix: duplicate fullscreen macOS menu item

#### Description of Change

Closes https://github.com/electron/electron/issues/49048

This fixes an issue introduced in 38be633 whereby a duplicate "Toggle Full Screen" menu item appeared in the View menu on macOS.

When `menu.delegate` is set on an `NSMenu` that contains a full screen menu item, macOS automatically injects a hidden duplicate menu item with the `toggleFullScreenMode:` action. This happens between menu creation and when menuWillOpen: is called. To fix this we now remove any hidden menu items in `menuWillOpen` that have the `toggleFullScreenMode:` action. 

#### Checklist
<!-- Remove items that do not apply. For completed items, change [ ] to [x]. -->

- [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: Fixed an issue whereby a duplicate "Toggle Full Screen" menu item appeared in the View menu on macOS.


Changed files:
filename: shell/browser/mac/electron_application_delegate.mm
patch: @@ -56,11 +56,6 @@ - (void)willPowerOff:(NSNotification*)notify {
 }
 
 - (void)applicationWillFinishLaunching:(NSNotification*)notify {
-  // Don't add the "Enter Full Screen" menu item automatically.
-  [[NSUserDefaults standardUserDefaults]
-      setBool:NO
-       forKey:@"NSFullScreenMenuItemEverywhere"];
-
   [[[NSWorkspace sharedWorkspace] notificationCenter]
       addObserver:self
          selector:@selector(willPowerOff:)

filename: shell/browser/ui/cocoa/electron_menu_controller.mm
patch: @@ -560,6 +560,14 @@ - (BOOL)isMenuOpen {
 
 - (void)menuWillOpen:(NSMenu*)menu {
   isMenuOpen_ = YES;
+
+  // macOS automatically injects a duplicate "Toggle Full Screen" menu item
+  // when we set menu.delegate on submenus. Remove hidden duplicates.
+  for (NSMenuItem* item in menu.itemArray) {
+    if (item.isHidden && item.action == @selector(toggleFullScreenMode:))
+      [menu removeItem:item];
+  }
+
   [self refreshMenuTree:menu];
   if (model_)
     model_->MenuWillShow();