helloadhavan/github_issues huggingface dataset:
Repository: ollama/ollama
Pull request: tests: add tool calling test

Added qwen0.6b for tool calling test

Changed files:
filename: integration/api_test.go
patch: @@ -410,3 +410,99 @@ func TestAPIEmbeddings(t *testing.T) {
 		t.Errorf("zero length embedding response")
 	}
 }
+
+func TestAPIToolCalling(t *testing.T) {
+	initialTimeout := 60 * time.Second
+	streamTimeout := 30 * time.Second
+	ctx, cancel := context.WithTimeout(context.Background(), 2*time.Minute)
+	defer cancel()
+
+	client, _, cleanup := InitServerConnection(ctx, t)
+	defer cleanup()
+
+	modelName := "qwen3:0.6b"
+	if err := PullIfMissing(ctx, client, modelName); err != nil {
+		t.Fatalf("pull failed %s", err)
+	}
+
+	tools := []api.Tool{
+		{
+			Type: "function",
+			Function: api.ToolFunction{
+				Name:        "get_weather",
+				Description: "Get the current weather in a given location",
+				Parameters: api.ToolFunctionParameters{
+					Type:     "object",
+					Required: []string{"location"},
+					Properties: map[string]api.ToolProperty{
+						"location": {
+							Type:        api.PropertyType{"string"},
+							Description: "The city and state, e.g. San Francisco, CA",
+						},
+					},
+				},
+			},
+		},
+	}
+
+	req := api.ChatRequest{
+		Model: modelName,
+		Messages: []api.Message{
+			{
+				Role:    "user",
+				Content: "Call get_weather with location set to San Francisco.",
+			},
+		},
+		Tools: tools,
+		Options: map[string]any{
+			"temperature": 0,
+		},
+	}
+
+	stallTimer := time.NewTimer(initialTimeout)
+	var gotToolCall bool
+	var lastToolCall api.ToolCall
+
+	fn := func(response api.ChatResponse) error {
+		if len(response.Message.ToolCalls) > 0 {
+			gotToolCall = true
+			lastToolCall = response.Message.ToolCalls[len(response.Message.ToolCalls)-1]
+		}
+		if !stallTimer.Reset(streamTimeout) {
+			return fmt.Errorf("stall was detected while streaming response, aborting")
+		}
+		return nil
+	}
+
+	stream := true
+	req.Stream = &stream
+	done := make(chan int)
+	var genErr error
+	go func() {
+		genErr = client.Chat(ctx, &req, fn)
+		done <- 0
+	}()
+
+	select {
+	case <-stallTimer.C:
+		t.Errorf("tool-calling chat never started. Timed out after: %s", initialTimeout.String())
+	case <-done:
+		if genErr != nil {
+			t.Fatalf("chat failed: %v", genErr)
+		}
+
+		if !gotToolCall {
+			t.Fatalf("expected at least one tool call, got none")
+		}
+
+		if lastToolCall.Function.Name != "get_weather" {
+			t.Errorf("unexpected tool called: got %q want %q", lastToolCall.Function.Name, "get_weather")
+		}
+
+		if _, ok := lastToolCall.Function.Arguments["location"]; !ok {
+			t.Errorf("expected tool arguments to include 'location', got: %s", lastToolCall.Function.Arguments.String())
+		}
+	case <-ctx.Done():
+		t.Error("outer test context done while waiting for tool-calling chat")
+	}
+}
Repository: nodejs/node
Pull request: http: remove redundant keepAliveTimeoutBuffer assignment

`storeHTTPOptions()` (see lib/_http_server.js:496) already validates and initializes `keepAliveTimeoutBuffer`. This PR removes the redundant assignment so option validation and defaulting have a single source of truth.

<!--
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: lib/_http_server.js
patch: @@ -574,12 +574,6 @@ function Server(options, requestListener) {
 
   storeHTTPOptions.call(this, options);
 
-  // Optional buffer added to the keep-alive timeout when setting socket timeouts.
-  // Helps reduce ECONNRESET errors from clients by extending the internal timeout.
-  // Default is 1000ms if not specified.
-  const buf = options.keepAliveTimeoutBuffer;
-  this.keepAliveTimeoutBuffer =
-  (typeof buf === 'number' && NumberIsFinite(buf) && buf >= 0) ? buf : 1000;
   net.Server.call(
     this,
     { allowHalfOpen: true, noDelay: options.noDelay ?? true,
Repository: huggingface/transformers
Pull request: Fix: flaky `Kosmos2ModelTest` test

Reproduced locally with 

```
pytest -q -m generate --random-order-bucket=none --flake-finder --flake-runs=200 tests/models/kosmos2/test_modeling_kosmos2.py -k test_assisted_decoding_matches_greedy_search
```

Root cause:
- prepare_config_and_inputs_for_generate() uses helpers (ids_tensor, random_attention_mask) backed by global_rng.
- So each repetition used different random inputs. Some prompts pass, some fail in same assisted decoding.

Fix:
- The test now calls `gobal_rng()` before `prepare_config_and_inputs_for_generate()`

Changed files:
filename: tests/models/kosmos2/test_modeling_kosmos2.py
patch: @@ -44,6 +44,7 @@
     TEST_EAGER_MATCHES_SDPA_INFERENCE_PARAMETERIZATION,
     ModelTesterMixin,
     floats_tensor,
+    global_rng,
     ids_tensor,
     random_attention_mask,
 )
@@ -308,6 +309,7 @@ def setUp(self):
         self.config_tester = ConfigTester(
             self, config_class=Kosmos2Config, has_text_modality=False, common_properties=["latent_query_num"]
         )
+        global_rng.seed(0)
 
     def test_config(self):
         self.config_tester.run_common_tests()
Repository: facebook/react
Pull request: [Flight] Use valid CSS selectors in `useId` format

Resolves https://github.com/facebook/react/pull/32001#issuecomment-2843143441

## Summary

https://github.com/facebook/react/pull/32001 only applied to Fiber and Fizz. This makes the same change for Flight.

## How did you test this change?

- updated tests


Changed files:
filename: packages/react-client/src/__tests__/ReactFlight-test.js
patch: @@ -1957,8 +1957,8 @@ describe('ReactFlight', () => {
       });
       expect(ReactNoop).toMatchRenderedOutput(
         <>
-          <div prop=":S1:" />
-          <div prop=":S2:" />
+          <div prop="«S1»" />
+          <div prop="«S2»" />
         </>,
       );
     });
@@ -1981,8 +1981,8 @@ describe('ReactFlight', () => {
       });
       expect(ReactNoop).toMatchRenderedOutput(
         <>
-          <div prop=":fooS1:" />
-          <div prop=":fooS2:" />
+          <div prop="«fooS1»" />
+          <div prop="«fooS2»" />
         </>,
       );
     });
@@ -2021,8 +2021,8 @@ describe('ReactFlight', () => {
       assertLog(['ClientDoubler']);
       expect(ReactNoop).toMatchRenderedOutput(
         <>
-          <div prop=":S1:">:S1:</div>
-          <div prop=":S1:">:S1:</div>
+          <div prop="«S1»">«S1»</div>
+          <div prop="«S1»">«S1»</div>
         </>,
       );
     });

filename: packages/react-server/src/ReactFlightHooks.js
patch: @@ -120,7 +120,13 @@ function useId(): string {
   }
   const id = currentRequest.identifierCount++;
   // use 'S' for Flight components to distinguish from 'R' and 'r' in Fizz/Client
-  return ':' + currentRequest.identifierPrefix + 'S' + id.toString(32) + ':';
+  return (
+    '\u00AB' +
+    currentRequest.identifierPrefix +
+    'S' +
+    id.toString(32) +
+    '\u00BB'
+  );
 }
 
 function use<T>(usable: Usable<T>): T {
Repository: facebook/react
Pull request: Enable owner stacks in Canary builds

Pending internal decision to ship in Canary.
Still off for FB builds.

Docs: https://github.com/reactjs/react.dev/pull/7427

Changed files:
filename: packages/react/index.stable.development.js
patch: @@ -48,4 +48,5 @@ export {
   useActionState,
   version,
   act, // DEV-only
+  captureOwnerStack, // DEV-only
 } from './src/ReactClient';

filename: packages/react/src/ReactServer.js
patch: @@ -28,6 +28,7 @@ import {lazy} from './ReactLazy';
 import {memo} from './ReactMemo';
 import {cache} from './ReactCacheServer';
 import version from 'shared/ReactVersion';
+import {captureOwnerStack} from './ReactOwnerStack';
 
 const Children = {
   map,
@@ -57,4 +58,5 @@ export {
   useDebugValue,
   useMemo,
   version,
+  captureOwnerStack, // DEV-only
 };

filename: packages/shared/ReactFeatureFlags.js
patch: @@ -127,7 +127,7 @@ export const passChildrenWhenCloningPersistedNodes = false;
  */
 export const enablePersistedModeClonedFlag = false;
 
-export const enableOwnerStacks = __EXPERIMENTAL__;
+export const enableOwnerStacks = true;
 
 export const enableShallowPropDiffing = false;
 

filename: packages/shared/forks/ReactFeatureFlags.test-renderer.js
patch: @@ -88,7 +88,7 @@ export const enableReactTestRendererWarning = true;
 export const disableDefaultPropsExceptForClasses = true;
 
 export const enableObjectFiber = false;
-export const enableOwnerStacks = false;
+export const enableOwnerStacks = true;
 export const enableRemoveConsolePatches = true;
 
 // Flow magic to verify the exports of this file match the original version.
Repository: vercel/next.js
Pull request: fix: normalize loopback only in hostname

`NextURL` intentionally canonicalizes loopback hosts (127.x.x.x, [::1], localhost) to localhost so that internal URL handling is consistent across equivalent local origins. 

However, we were applying a regex replacement to the entire URL before parsing, which unintentionally rewrote loopback strings inside query parameter values, eg `?redirect_uri=http%3A%2F%2F127.0.0.1...`. This is unexpected for anyone that is explicitly passing through different loopback values.

This fixes it by first parsing the URL with `new URL()`, and then only apply the replacement logic to `parsed.hostname` when it is a loopback host. This leaves search unchanged. 

Fixes NEXT-4864

Changed files:
filename: packages/next/src/server/web/next-url.ts
patch: @@ -20,13 +20,14 @@ interface Options {
 }
 
 const REGEX_LOCALHOST_HOSTNAME =
-  /(?!^https?:\/\/)(127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}|\[::1\]|localhost)/
+  /^(?:127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}|\[::1\]|localhost)$/
 
 function parseURL(url: string | URL, base?: string | URL) {
-  return new URL(
-    String(url).replace(REGEX_LOCALHOST_HOSTNAME, 'localhost'),
-    base && String(base).replace(REGEX_LOCALHOST_HOSTNAME, 'localhost')
-  )
+  const parsed = new URL(String(url), base && String(base))
+  if (REGEX_LOCALHOST_HOSTNAME.test(parsed.hostname)) {
+    parsed.hostname = 'localhost'
+  }
+  return parsed
 }
 
 const Internal = Symbol('NextURLInternal')

filename: test/unit/web-runtime/next-url.test.ts
patch: @@ -205,6 +205,19 @@ it('consider 127.0.0.1 and variations as localhost', () => {
   expect(new NextURL('https://[::1]:3000/hello')).toStrictEqual(httpsUrl)
 })
 
+it('preserves loopback hostnames inside encoded query parameter values', () => {
+  const url = new NextURL(
+    'https://example.com/api/echo?redirect_uri=http%3A%2F%2F127.0.0.1%3A12345%2Ftest'
+  )
+
+  expect(url.searchParams.get('redirect_uri')).toEqual(
+    'http://127.0.0.1:12345/test'
+  )
+  expect(url.href).toEqual(
+    'https://example.com/api/echo?redirect_uri=http%3A%2F%2F127.0.0.1%3A12345%2Ftest'
+  )
+})
+
 it('allows to change the port', () => {
   const url = new NextURL('https://localhost:3000/foo')
   url.port = '3001'
Repository: ollama/ollama
Pull request: Added project (Clueless) to Community Integrations README.md

Added my open source project to Community Integrations. Clueless transforms how you interact with your computer. Simply take a screenshot of anything on your screen and start an intelligent conversation about it in real-time using locally served Ollama models.

Changed files:
filename: README.md
patch: @@ -413,6 +413,7 @@ See the [API documentation](./docs/api.md) for all endpoints.
 - [Mayan EDMS](https://gitlab.com/mayan-edms/mayan-edms) (Open source document management system to organize, tag, search, and automate your files with powerful Ollama driven workflows.)
 - [Serene Pub](https://github.com/doolijb/serene-pub) (Beginner friendly, open source AI Roleplaying App for Windows, Mac OS and Linux. Search, download and use models with Ollama all inside the app.)
 - [Andes](https://github.com/aqerd/andes) (A Visual Studio Code extension that provides a local UI interface for Ollama models)
+- [Clueless](https://github.com/KashyapTan/clueless) (Open Source & Local Cluely: A desktop application LLM assistant to help you talk to anything on your screen using locally served Ollama models. Also undetectable to screenshare)
 
 ### Cloud
Repository: ollama/ollama
Pull request: llm: Clamp batch size to context size

The context must always be able to store the current batch, so if the user requests a small context then we should also shrink the batch to match. This also fixes the TestLongInputContext test on the new engine. (The old engine already has this behavior.)

Changed files:
filename: integration/context_test.go
patch: @@ -36,7 +36,7 @@ func TestLongInputContext(t *testing.T) {
 	if err := PullIfMissing(ctx, client, req.Model); err != nil {
 		t.Fatalf("PullIfMissing failed: %v", err)
 	}
-	DoGenerate(ctx, t, client, req, []string{"russia", "germany", "france", "england", "austria", "prussia", "individuals", "coalition", "conflict"}, 120*time.Second, 10*time.Second)
+	DoGenerate(ctx, t, client, req, []string{"russia", "germany", "france", "england", "austria", "prussia", "europe", "individuals", "coalition", "conflict"}, 120*time.Second, 10*time.Second)
 }
 
 func TestContextExhaustion(t *testing.T) {

filename: llm/server.go
patch: @@ -173,6 +173,8 @@ func NewLlamaServer(gpus discover.GpuInfoList, modelPath string, f *ggml.GGML, a
 		opts.NumCtx = int(trainCtx)
 	}
 
+	opts.NumBatch = min(opts.NumBatch, opts.NumCtx)
+
 	loadRequest := LoadRequest{LoraPath: adapters, KvSize: opts.NumCtx * numParallel, BatchSize: opts.NumBatch, Parallel: numParallel, MultiUserCache: envconfig.MultiUserCache()}
 
 	defaultThreads := discover.GetSystemInfo().GetOptimalThreadCount()

filename: runner/ollamarunner/cache.go
patch: @@ -34,8 +34,8 @@ type InputCache struct {
 func NewInputCache(model model.Model, kvCacheType string, kvSize int32, numSlots int, batchSize int, multiUserCache bool) (*InputCache, error) {
 	numCtx := kvSize / int32(numSlots)
 
-	if numCtx < 1 {
-		return nil, fmt.Errorf("must have at least one kv cache entry per parallel sequence (kv: %v parallel: %v)", kvSize, numSlots)
+	if int(numCtx) < batchSize {
+		return nil, fmt.Errorf("kv size must be at least as large as batch size * parallel (kv: %v batch: %v parallel: %v)", kvSize, batchSize, numSlots)
 	}
 
 	slots := make([]InputCacheSlot, numSlots)
Repository: facebook/react
Pull request: Ensure `captureOwnerStack` returns `null` when no stack is available

## Summary

This helps differentiate when you're at the top of the stack and when no stack is available

## How did you test this change?

Added test for this scenario. `captureOwnerStack()` used to return an empty string after a commit.


Changed files:
filename: packages/react-reconciler/src/ReactCurrentFiber.js
patch: @@ -72,7 +72,7 @@ export function runWithFiberInDEV<A0, A1, A2, A3, A4, T>(
       }
       return callback(arg0, arg1, arg2, arg3, arg4);
     } finally {
-      current = previousFiber;
+      setCurrentFiber(previousFiber);
     }
   }
   // These errors should never make it into a build so we don't need to encode them in codes.json

filename: packages/react-reconciler/src/__tests__/ReactOwnerStacks-test.js
patch: @@ -62,4 +62,17 @@ describe('ReactOwnerStacks', () => {
       '\n    in Bar (at **)' + '\n    in Foo (at **)',
     );
   });
+
+  it('returns null outside of render', async () => {
+    // Awkward to gate since some builds will have `captureOwnerStack` return null in prod
+    if (__DEV__ && gate('enableOwnerStacks')) {
+      expect(React.captureOwnerStack()).toBe(null);
+
+      await act(() => {
+        ReactNoop.render(<div />);
+      });
+
+      expect(React.captureOwnerStack()).toBe(null);
+    }
+  });
 });
Repository: ollama/ollama
Pull request: fix: nil pointer dereference if cache is nil


Changed files:
filename: runner/ollamarunner/cache.go
patch: @@ -70,11 +70,9 @@ func kvCacheTypeFromStr(s string) ml.DType {
 }
 
 func (c *InputCache) Close() {
-	if c == nil {
-		return
+	if c != nil && c.cache != nil {
+		c.cache.Close()
 	}
-
-	c.cache.Close()
 }
 
 // Locking: Operations on InputCacheSlot (including finding one
Repository: vercel/next.js
Pull request: Turbopack: Update rust toolchain to nightly-2026-02-18

Rust finally merged a fix to the "trying to encode a dep node twice" ICE we seem to most frequently run into, triggered by the rustc parallel frontend feature: https://github.com/rust-lang/rust/pull/151509

- @mischnic  commented on the issue: https://github.com/rust-lang/rust/issues/150018#issuecomment-3754877064
- @mischnic just updated our toolchain last week, but I'd like to get this fix in.

CI Job for build-and-release that covers all platforms: https://github.com/vercel/next.js/actions/runs/22156881743  
  
In the process of this upgrade, I found and reported https://github.com/rust-lang/rust/issues/152735 upstream (fixed `nightly-2026-02-18`).

Changed files:
filename: .devcontainer/rust/devcontainer-feature.json
patch: @@ -5,7 +5,7 @@
   "dependsOn": {
     "ghcr.io/devcontainers/features/rust:1": {
       // this should match the `rust-toolchain.toml`
-      "version": "nightly-2026-02-05",
+      "version": "nightly-2026-02-18",
       "profile": "minimal",
       "components": "rustfmt,clippy,rust-analyzer"
     }

filename: rust-toolchain.toml
patch: @@ -1,5 +1,5 @@
 # if you update this, also update `.devcontainer/rust/devcontainer-feature.json`
 [toolchain]
-channel = "nightly-2026-02-05"
+channel = "nightly-2026-02-18"
 components = ["rustfmt", "clippy", "rust-analyzer"]
 profile = "minimal"

filename: turbopack/crates/turbopack-core/src/lib.rs
patch: @@ -1,6 +1,5 @@
 #![feature(min_specialization)]
 #![feature(type_alias_impl_trait)]
-#![feature(assert_matches)]
 #![feature(arbitrary_self_types)]
 #![feature(arbitrary_self_types_pointers)]
 #![feature(impl_trait_in_assoc_type)]

filename: turbopack/crates/turbopack-ecmascript/src/source_map.rs
patch: @@ -56,10 +56,8 @@ fn maybe_decode_data_url(url: &str) -> Option<Rope> {
 
     let data_b64 = if let Some(data) = url.strip_prefix(DATA_PREAMBLE) {
         data
-    } else if let Some(data) = url.strip_prefix(DATA_PREAMBLE_CHARSET) {
-        data
     } else {
-        return None;
+        url.strip_prefix(DATA_PREAMBLE_CHARSET)?
     };
 
     data_encoding::BASE64
Repository: rust-lang/rust
Pull request: Add missing `track_caller` to overflowing trait methods

Fixes rust-lang/rust#152599 by adding `#[track_caller]` to arithmetic trait methods (`Neg`, `Shl`, `ShlAssign`, `Shr` and `ShrAssign`) so overflow panics report the correct call site instead of the trait definition.

Changed files:
filename: library/core/src/ops/arith.rs
patch: @@ -716,6 +716,7 @@ macro_rules! neg_impl {
             type Output = $t;
 
             #[inline]
+            #[track_caller]
             #[rustc_inherit_overflow_checks]
             fn neg(self) -> $t { -self }
         }

filename: library/core/src/ops/bit.rs
patch: @@ -484,6 +484,7 @@ macro_rules! shl_impl {
             type Output = $t;
 
             #[inline]
+            #[track_caller]
             #[rustc_inherit_overflow_checks]
             fn shl(self, other: $f) -> $t {
                 self << other
@@ -606,6 +607,7 @@ macro_rules! shr_impl {
             type Output = $t;
 
             #[inline]
+            #[track_caller]
             #[rustc_inherit_overflow_checks]
             fn shr(self, other: $f) -> $t {
                 self >> other
@@ -958,6 +960,7 @@ macro_rules! shl_assign_impl {
         #[rustc_const_unstable(feature = "const_ops", issue = "143802")]
         impl const ShlAssign<$f> for $t {
             #[inline]
+            #[track_caller]
             #[rustc_inherit_overflow_checks]
             fn shl_assign(&mut self, other: $f) {
                 *self <<= other
@@ -1044,6 +1047,7 @@ macro_rules! shr_assign_impl {
         #[rustc_const_unstable(feature = "const_ops", issue = "143802")]
         impl const ShrAssign<$f> for $t {
             #[inline]
+            #[track_caller]
             #[rustc_inherit_overflow_checks]
             fn shr_assign(&mut self, other: $f) {
                 *self >>= other