helloadhavan/github_issues huggingface dataset:
Repository: denoland/deno
Pull request: fix(ext/node): unref stdin on pause to allow process exit

When process.stdin is a pipe without a _handle (PIPE/TCP type), calling pause() did not unref the underlying Deno stdin resource. This caused pending reads to keep the event loop alive, preventing the process from exiting even after stdin was paused.

This fix adds `io.stdin[UNREF]()` in the onpause handler for handleless stdin, and `io.stdin[REF]()` in _read() to re-ref when reading resumes. This matches Node.js behavior where paused stdin does not keep the process alive.

Fixes node_compat test-stdin-child-proc.js timeout.

Changed files:
filename: ext/node/polyfills/_process/streams.mjs
patch: @@ -170,6 +170,7 @@ function _guessStdinType(fd) {
 }
 
 const _read = function (size) {
+  io.stdin?.[io.REF]();
   const p = Buffer.alloc(size || 16 * 1024);
   PromisePrototypeThen(io.stdin?.read(p), (length) => {
     // deno-lint-ignore prefer-primordials
@@ -264,6 +265,8 @@ export const initStdin = (warmup = false) => {
 
   function onpause() {
     if (!stdin._handle) {
+      // This allows the process to exit when stdin is paused.
+      io.stdin?.[io.UNREF]();
       return;
     }
 

filename: tests/node_compat/config.jsonc
patch: @@ -1149,6 +1149,7 @@
     "parallel/test-sqlite-timeout.js": {},
     "parallel/test-sqlite-transactions.js": {},
     "parallel/test-sqlite-typed-array-and-data-view.js": {},
+    "parallel/test-stdin-child-proc.js": {},
     "parallel/test-stdin-hang.js": {},
     "parallel/test-stdin-pause-resume-sync.js": {},
     "parallel/test-stdin-pause-resume.js": {},
Repository: denoland/deno
Pull request: fix(ext/node): serialize workerData before resolving worker filename

Fixes `parallel/test-worker-invalid-workerdata.js`

Changed files:
filename: ext/node/polyfills/worker_threads.ts
patch: @@ -169,27 +169,10 @@ class NodeWorker extends EventEmitter {
         "node:worker_threads support only 'file:' and 'data:' URLs",
       );
     }
-    if (options?.eval) {
-      const code = typeof specifier === "string"
-        ? encodeURIComponent(specifier)
-        // deno-lint-ignore prefer-primordials
-        : specifier.toString();
-      specifier = `data:text/javascript,${code}`;
-    } else if (
-      !(typeof specifier === "object" && specifier.protocol === "data:")
-    ) {
-      // deno-lint-ignore prefer-primordials
-      specifier = specifier.toString();
-      specifier = op_worker_threads_filename(specifier) ?? specifier;
-    }
 
-    // TODO(bartlomieu): this doesn't match the Node.js behavior, it should be
-    // `[worker {threadId}] {name}` or empty string.
-    let name = StringPrototypeTrim(options?.name ?? "");
-    if (options?.eval) {
-      name = "[worker eval]";
-    }
-    this.#name = name;
+    // Serialize workerData before resolving the filename so that
+    // DataCloneError is thrown before file-not-found errors,
+    // matching Node.js behavior.
 
     // Handle the `env` option following Node.js semantics:
     // - undefined/null: snapshot current process.env (isolated copy)
@@ -243,6 +226,29 @@ class NodeWorker extends EventEmitter {
       isEval: !!options?.eval,
       isWorkerThread: true,
     }, options?.transferList ?? []);
+
+    if (options?.eval) {
+      const code = typeof specifier === "string"
+        ? encodeURIComponent(specifier)
+        // deno-lint-ignore prefer-primordials
+        : specifier.toString();
+      specifier = `data:text/javascript,${code}`;
+    } else if (
+      !(typeof specifier === "object" && specifier.protocol === "data:")
+    ) {
+      // deno-lint-ignore prefer-primordials
+      specifier = specifier.toString();
+      specifier = op_worker_threads_filename(specifier) ?? specifier;
+    }
+
+    // TODO(bartlomieu): this doesn't match the Node.js behavior, it should be
+    // `[worker {threadId}] {name}` or empty string.
+    let name = StringPrototypeTrim(options?.name ?? "");
+    if (options?.eval) {
+      name = "[worker eval]";
+    }
+    this.#name = name;
+
     const id = op_create_worker(
       {
         // deno-lint-ignore prefer-primordials

filename: tests/node_compat/config.jsonc
patch: @@ -1564,6 +1564,7 @@
     "parallel/test-worker-event.js": {},
     "parallel/test-worker-execargv-invalid.js": {},
     "parallel/test-worker-fs-stat-watcher.js": {},
+    "parallel/test-worker-invalid-workerdata.js": {},
     "parallel/test-worker-load-file-with-extension-other-than-js.js": {},
     "parallel/test-worker-message-channel.js": {},
     "parallel/test-worker-message-port-infinite-message-loop.js": {},
Repository: denoland/deno
Pull request: fix(ext/node): emit close on both paired MessagePorts

Ref https://nodejs.org/api/worker_threads.html#portclose

Fixes `test-worker-message-channel.js`

Changed files:
filename: ext/node/polyfills/worker_threads.ts
patch: @@ -20,6 +20,7 @@ import {
   MessagePortPrototype,
   MessagePortReceiveMessageOnPortSymbol,
   nodeWorkerThreadCloseCb,
+  nodeWorkerThreadCloseCbInvoked,
   refMessagePort,
   serializeJsMessageData,
   unrefParentPort,
@@ -67,6 +68,7 @@ const {
   SymbolIterator,
   TypeError,
   Float64Array,
+  FunctionPrototypeBind,
 } = primordials;
 
 const workerCpuUsageBuffer = new Float64Array(2);
@@ -724,6 +726,26 @@ class NodeMessageChannel {
     const { port1, port2 } = new MessageChannel();
     this.port1 = webMessagePortToNodeMessagePort(port1);
     this.port2 = webMessagePortToNodeMessagePort(port2);
+
+    // When one port is closed, the paired port should also receive
+    // a 'close' event (matching Node.js behavior).
+    const origClose1 = FunctionPrototypeBind(port1.close, port1);
+    const origClose2 = FunctionPrototypeBind(port2.close, port2);
+
+    port1.close = () => {
+      origClose1();
+      if (!port2[nodeWorkerThreadCloseCbInvoked]) {
+        port2[nodeWorkerThreadCloseCbInvoked] = true;
+        port2.dispatchEvent(new Event("close"));
+      }
+    };
+    port2.close = () => {
+      origClose2();
+      if (!port1[nodeWorkerThreadCloseCbInvoked]) {
+        port1[nodeWorkerThreadCloseCbInvoked] = true;
+        port1.dispatchEvent(new Event("close"));
+      }
+    };
   }
 }
 

filename: ext/web/13_message_port.js
patch: @@ -542,6 +542,7 @@ export {
   MessagePortPrototype,
   MessagePortReceiveMessageOnPortSymbol,
   nodeWorkerThreadCloseCb,
+  nodeWorkerThreadCloseCbInvoked,
   refedMessagePortsCount,
   serializeJsMessageData,
   structuredClone,

filename: tests/node_compat/config.jsonc
patch: @@ -1558,6 +1558,7 @@
     "parallel/test-worker-execargv-invalid.js": {},
     "parallel/test-worker-fs-stat-watcher.js": {},
     "parallel/test-worker-load-file-with-extension-other-than-js.js": {},
+    "parallel/test-worker-message-channel.js": {},
     "parallel/test-worker-message-port-infinite-message-loop.js": {},
     "parallel/test-worker-message-port-multiple-sharedarraybuffers.js": {},
     "parallel/test-worker-message-port-receive-message.js": {},
Repository: facebook/react
Pull request: Gate inlined consoleWithStackDev transpilation

This code is getting deleted in #30313 anyway but it should've been gated all along.

This code exists to basically manually transpile console.error to  consoleWithStackDev because the transpiler doesn't work on `.apply` or `.bind` or the dynamic look up. We only apply the transform in DEV so we should've only done this in DEV.

Otherwise these logs get silenced in prod.

Changed files:
filename: packages/react-client/src/ReactClientConsoleConfigBrowser.js
patch: @@ -65,9 +65,9 @@ export function printToConsole(
     );
   }
 
-  if (methodName === 'error') {
+  if (methodName === 'error' && __DEV__) {
     error.apply(console, newArgs);
-  } else if (methodName === 'warn') {
+  } else if (methodName === 'warn' && __DEV__) {
     warn.apply(console, newArgs);
   } else {
     // $FlowFixMe[invalid-computed-prop]

filename: packages/react-client/src/ReactClientConsoleConfigPlain.js
patch: @@ -46,9 +46,9 @@ export function printToConsole(
     newArgs.splice(offset, 0, badgeFormat, pad + badgeName + pad);
   }
 
-  if (methodName === 'error') {
+  if (methodName === 'error' && __DEV__) {
     error.apply(console, newArgs);
-  } else if (methodName === 'warn') {
+  } else if (methodName === 'warn' && __DEV__) {
     warn.apply(console, newArgs);
   } else {
     // $FlowFixMe[invalid-computed-prop]

filename: packages/react-client/src/ReactClientConsoleConfigServer.js
patch: @@ -66,9 +66,9 @@ export function printToConsole(
     );
   }
 
-  if (methodName === 'error') {
+  if (methodName === 'error' && __DEV__) {
     error.apply(console, newArgs);
-  } else if (methodName === 'warn') {
+  } else if (methodName === 'warn' && __DEV__) {
     warn.apply(console, newArgs);
   } else {
     // $FlowFixMe[invalid-computed-prop]
Repository: ollama/ollama
Pull request: cmd: document environment variables for serve command

Updates #2944

Changed files:
filename: cmd/cmd.go
patch: @@ -879,6 +879,24 @@ func NewCLI() *cobra.Command {
 		Args:    cobra.ExactArgs(0),
 		RunE:    RunServer,
 	}
+	serveCmd.SetUsageTemplate(serveCmd.UsageTemplate() + `
+Environment Variables:
+
+	OLLAMA_HOST
+		The host:port to bind to (default "127.0.0.1:11434")
+
+		Examples:
+			"127.0.0.1:11434"
+	OLLAMA_ORIGINS
+		A comma separated list of allowed origins. If unset, the
+		default behavior is to allow same origin requests, only.
+
+		Examples:
+			"localhost:11434"
+			"example.com,api.example.com"
+	OLLAMA_MODELS
+		The path to the models directory (default is "~/.ollama/models")
+`)
 
 	pullCmd := &cobra.Command{
 		Use:     "pull MODEL",
@@ -907,7 +925,6 @@ func NewCLI() *cobra.Command {
 		PreRunE: checkServerHeartbeat,
 		RunE:    ListHandler,
 	}
-
 	copyCmd := &cobra.Command{
 		Use:     "cp SOURCE TARGET",
 		Short:   "Copy a model",
Repository: vercel/next.js
Pull request: Turbopack: add more details to the graph panic

### What?

give more information when a graph panic happens

Closes PACK-5549

Changed files:
filename: turbopack/crates/turbo-tasks-backend/src/backend/operation/aggregation_update.rs
patch: @@ -1419,8 +1419,14 @@ impl AggregationUpdateQueue {
             if retry > MAX_RETRIES {
                 panic!(
                     "inner_of_uppers_lost_follower is not able to remove follower \
-                     {lost_follower_id:?} from {upper_ids:?} as they don't exist as upper or \
-                     follower edges"
+                     {lost_follower_id:?} ({}) from {} as they don't exist as upper or follower \
+                     edges",
+                    ctx.get_task_description(lost_follower_id),
+                    upper_ids
+                        .iter()
+                        .map(|id| format!("{} ({})", id, ctx.get_task_description(*id)))
+                        .collect::<Vec<_>>()
+                        .join(", ")
                 );
             }
             self.push(AggregationUpdateJob::InnerOfUppersLostFollower {
Repository: ollama/ollama
Pull request: Add Odin Runes, a Feature-Rich Java UI for Ollama, to README

**Description:**
Hello,

I've added Odin Runes to the README under the "Community Integrations" section. Odin Runes is a Java-based GPT client that facilitates seamless interaction with GPT models, enhancing productivity in prompt engineering and text generation tasks. This addition highlights the integration between Odin Runes and Ollama, offering users the flexibility to leverage large language models locally within their development workflow.


**Changes:**
- Added Odin Runes to the "Community Integrations" section of the README.

**Demo:**
![OdinRunes-Ollama-integration-demo](https://github.com/ollama/ollama/assets/26918192/ab51d273-f528-4e96-8608-477e36f3b35a)
Caption: This GIF demonstrates the integration between Odin Runes and Ollama in action. 

**Context:**
This pull request addresses the need to document the integration between Odin Runes and Ollama, providing visibility to users who may benefit from the integration and fostering collaboration between our projects.


**Closing Note:**
I believe this addition will be beneficial to users and contributors alike. I'm open to any feedback or suggestions regarding the integration or the proposed README addition.

Thank you for considering my pull request.

Changed files:
filename: README.md
patch: @@ -278,6 +278,7 @@ See the [API documentation](./docs/api.md) for all endpoints.
 - [Chatbox](https://github.com/Bin-Huang/Chatbox)
 - [WinForm Ollama Copilot](https://github.com/tgraupmann/WinForm_Ollama_Copilot)
 - [NextChat](https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web) with [Get Started Doc](https://docs.nextchat.dev/models/ollama)
+- [Odin Runes](https://github.com/leonid20000/OdinRunes)
 
 ### Terminal
Repository: nodejs/node
Pull request: src: move shared_ptr objects in KeyObjectData

Since copying `shared_ptr` may involve costly atomic operations when copied implicitly, explicitly move both `shared_ptr` objects that are passed to the private `KeyObjectData` constructor.

<!--
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: src/crypto/crypto_keys.h
patch: @@ -127,7 +127,7 @@ class KeyObjectData final : public MemoryRetainer {
   KeyObjectData(KeyType type,
                 std::shared_ptr<Mutex> mutex,
                 std::shared_ptr<Data> data)
-      : key_type_(type), mutex_(mutex), data_(data) {}
+      : key_type_(type), mutex_(std::move(mutex)), data_(std::move(data)) {}
 };
 
 class KeyObjectHandle : public BaseObject {
Repository: ggml-org/llama.cpp
Pull request: examples : add missing code block end marker [no ci]

This commit adds the missing code block end marker in simple-cmake-pkg to correct the formatting.


Changed files:
filename: examples/simple-cmake-pkg/README.md
patch: @@ -18,6 +18,7 @@ cd llama.cpp
 cmake -S . -B build
 cmake --build build
 cmake --install build --prefix inst
+```
 
 ### Build simple-cmake-pkg
Repository: ollama/ollama
Pull request: Add NotesOllama to Community Integrations


Changed files:
filename: README.md
patch: @@ -340,6 +340,7 @@ See the [API documentation](./docs/api.md) for all endpoints.
 - [Continue](https://github.com/continuedev/continue)
 - [Obsidian Ollama plugin](https://github.com/hinterdupfinger/obsidian-ollama)
 - [Logseq Ollama plugin](https://github.com/omagdy7/ollama-logseq)
+- [NotesOllama](https://github.com/andersrex/notesollama) (Apple Notes Ollama plugin)
 - [Dagger Chatbot](https://github.com/samalba/dagger-chatbot)
 - [Discord AI Bot](https://github.com/mekb-turtle/discord-ai-bot)
 - [Ollama Telegram Bot](https://github.com/ruecat/ollama-telegram)
Repository: ollama/ollama
Pull request: Added community link for Ollama Copilot


Changed files:
filename: README.md
patch: @@ -276,6 +276,7 @@ See the [API documentation](./docs/api.md) for all endpoints.
 - [NextJS Web Interface for Ollama](https://github.com/jakobhoeg/nextjs-ollama-llm-ui)
 - [Msty](https://msty.app)
 - [Chatbox](https://github.com/Bin-Huang/Chatbox)
+- [WinForm Ollama Copilot](https://github.com/tgraupmann/WinForm_Ollama_Copilot)
 - [NextChat](https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web) with [Get Started Doc](https://docs.nextchat.dev/models/ollama)
 
 ### Terminal
Repository: denoland/deno
Pull request: fix(ext/node): read from stdin when spawns node with no args

When child_process.spawn(process.execPath, []) is used (equivalent to running `node` with no args), the CLI arg translator produced `deno run -A` which fails because no script is specified.

In Node.js, `node` with no args and piped stdin reads and executes the piped code. Adding `-` to the translated args makes Deno read from stdin, matching this behavior.

Enables node_compat test-stdin-script-child.js.

Changed files:
filename: ext/node/ops/node_cli_parser.rs
patch: @@ -72,10 +72,12 @@ pub fn op_node_translate_cli_args(
   #[serde] args: Vec<String>,
   script_in_npm_package: bool,
 ) -> Result<TranslatedArgs, CliParserError> {
-  // If no args, return early with run -A
+  // If no args, return early with run -A -
+  // `-` tells Deno to read from stdin, matching Node.js behavior where
+  // `node` with no args reads and executes piped stdin.
   if args.is_empty() {
     return Ok(TranslatedArgs {
-      deno_args: vec!["run".to_string(), "-A".to_string()],
+      deno_args: vec!["run".to_string(), "-A".to_string(), "-".to_string()],
       node_options: vec![],
       needs_npm_process_state: script_in_npm_package,
     });

filename: tests/node_compat/config.jsonc
patch: @@ -1157,6 +1157,7 @@
     "parallel/test-stdin-pipe-resume.js": {},
     "parallel/test-stdin-resume-pause.js": {},
     "parallel/test-stdin-script-child-option.js": {},
+    "parallel/test-stdin-script-child.js": {},
     "parallel/test-stdio-pipe-access.js": {},
     "parallel/test-stdio-pipe-redirect.js": {},
     "parallel/test-stdio-pipe-stderr.js": {
Repository: nodejs/node
Pull request: test: add missing hasPostData in test-inspector-emit-protocol-event

I fixed it because running it directly would result in the following error.
``` sh
shimaryuuheinoMac-mini:node shimaryuuhei$ node test/parallel/test-inspector-emit-protocol-event.js
NOTE: The test started as a child_process using these flags: [ '--inspect=0', '--experimental-network-inspection' ] Use NODE_SKIP_FLAG_CHECK to run the test with the original flags.
Debugger listening on ws://127.0.0.1:59541/ef451551-fb37-4406-b739-65ddcf43c6e9
For help, see: https://nodejs.org/en/docs/inspector
(node:62077) [ERR_ASSERTION] AssertionError [ERR_ASSERTION]: Expected values to be strictly deep-equal:
+ actual - expected

  {
    request: {
+     hasPostData: false,
      headers: {},
      method: 'GET',
      url: 'https://nodejs.org/en'
    },
    requestId: 'request-id-1',

(Use `node --trace-warnings ...` to show where the warning was created)
```
<!--
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: test/parallel/test-inspector-emit-protocol-event.js
patch: @@ -27,6 +27,7 @@ const EXPECTED_EVENTS = {
           url: 'https://nodejs.org/en',
           method: 'GET',
           headers: {},
+          hasPostData: false,
         },
         timestamp: 1000,
         wallTime: 1000,
Repository: huggingface/transformers
Pull request: Bump hfh prerelease version

From `1.0.0.rc1` to `1.0.0.rc2` (minor fix in `@strict` dataclass so shouldn't change anything).

Changed files:
filename: setup.py
patch: @@ -114,7 +114,7 @@
     "GitPython<3.1.19",
     "hf-doc-builder>=0.3.0",
     "hf_xet",
-    "huggingface-hub==1.0.0.rc1",
+    "huggingface-hub==1.0.0.rc2",
     "importlib_metadata",
     "ipadic>=1.0.0,<2.0",
     "jinja2>=3.1.0",

filename: src/transformers/dependency_versions_table.py
patch: @@ -23,7 +23,7 @@
     "GitPython": "GitPython<3.1.19",
     "hf-doc-builder": "hf-doc-builder>=0.3.0",
     "hf_xet": "hf_xet",
-    "huggingface-hub": "huggingface-hub==1.0.0.rc1",
+    "huggingface-hub": "huggingface-hub==1.0.0.rc2",
     "importlib_metadata": "importlib_metadata",
     "ipadic": "ipadic>=1.0.0,<2.0",
     "jinja2": "jinja2>=3.1.0",
Repository: vercel/next.js
Pull request: Turbopack: fix run_once when returning error

Errors returned from the callback are never read.
Instead, send errors returned from the `future` over the channel.


Closes PACK-5552

Changed files:
filename: turbopack/crates/turbo-tasks/src/manager.rs
patch: @@ -526,13 +526,13 @@ impl<B: Backend + 'static> TurboTasks<B> {
     ) -> Result<T> {
         let (tx, rx) = tokio::sync::oneshot::channel();
         self.spawn_once_task(async move {
-            let result = future.await?;
+            let result = future.await;
             tx.send(result)
                 .map_err(|_| anyhow!("unable to send result"))?;
             Ok(Completion::new())
         });
 
-        Ok(rx.await?)
+        rx.await?
     }
 
     pub async fn run<T: TraceRawVcs + Send + 'static>(