Skip to content

Comments

Redirect llama.cpp logs through tracing to avoid polluting CLI stdout/stderr#7434

Merged
jh-block merged 1 commit intomainfrom
jhugo/redirect-llamacpp-logs-to-tracing
Feb 23, 2026
Merged

Redirect llama.cpp logs through tracing to avoid polluting CLI stdout/stderr#7434
jh-block merged 1 commit intomainfrom
jhugo/redirect-llamacpp-logs-to-tracing

Conversation

@jh-block
Copy link
Collaborator

Problem

When using the goose CLI with the local inference provider, llama.cpp output goes directly to stderr, cluttering the text interface and making it harder to use.

Root Cause

The llama-cpp-2 Rust bindings provide send_logs_to_tracing() to redirect llama.cpp's C library log output through the tracing framework, but it was never called. This meant llama.cpp used its default behavior of writing to stderr.

Fix

Call llama_cpp_2::send_logs_to_tracing(LogOptions::default()) during InferenceRuntime initialization. This redirects all llama.cpp/ggml logs through tracing, which the CLI already routes exclusively to log files (no console layer). When running goosed directly or via the GUI, the tracing subscriber typically includes a console layer, so logs remain visible there.

Changes

  • crates/goose/src/providers/local_inference.rs: Added send_logs_to_tracing() call in InferenceRuntime::get_or_init()

…/stderr

llama.cpp's C library writes log output directly to stderr by default.
The llama-cpp-2 crate provides send_logs_to_tracing() to redirect this
through the tracing framework, but it was never called. This caused
llama.cpp output to clutter the terminal when using the goose CLI with
the local inference provider.

Call send_logs_to_tracing() during InferenceRuntime initialization so
all llama.cpp/ggml logs flow through tracing, which the CLI routes
exclusively to log files.
@jh-block jh-block requested a review from DOsinga February 23, 2026 15:53
@jh-block jh-block added this pull request to the merge queue Feb 23, 2026
Merged via the queue into main with commit 8182a6c Feb 23, 2026
20 checks passed
@jh-block jh-block deleted the jhugo/redirect-llamacpp-logs-to-tracing branch February 23, 2026 16:10
zanesq added a commit that referenced this pull request Feb 23, 2026
…oviders

* 'main' of github.com:block/goose:
  New navigation settings layout options and styling (#6645)
  refactor: MCP-compliant theme tokens and CSS class rename (#7275)
  Redirect llama.cpp logs through tracing to avoid polluting CLI stdout/stderr (#7434)
  refactor: change open recipe in new window to pass recipe id (#7392)
  fix: handle truncated tool calls that break conversation alternation (#7424)
  streamline some github actions (#7430)
  Enable bedrock prompt cache (#6710)
  fix: use BEGIN IMMEDIATE to prevent SQLite deadlocks (#7429)
  Display working dir (#7419)
  dev: add cmake to hermitized env (#7399)
  refactor: remove allows_unlisted_models flag, always allow custom model entry (#7255)
  feat: expose context window utilization to agent via MOIM (#7418)
  Small model naming (#7394)
  chore(deps): bump ajv in /documentation (#7416)
  doc: groq models (#7404)
  Client settings (#7381)
  Fix settings tabs getting cut off in narrow windows (#7379)

# Conflicts:
#	ui/desktop/src/components/settings/dictation/DictationSettings.tsx
michaelneale added a commit that referenced this pull request Feb 23, 2026
…xt-edit

* origin/main: (35 commits)
  docs: generate manpages (#7443)
  Blog/goose v1 25 0 release (#7433)
  fix: detect truncated LLM responses in apps extension (#7354)
  fix: removed unnecessary version for goose acp macro dependency (#7428)
  add flag to hide select voice providers (#7406)
  New navigation settings layout options and styling (#6645)
  refactor: MCP-compliant theme tokens and CSS class rename (#7275)
  Redirect llama.cpp logs through tracing to avoid polluting CLI stdout/stderr (#7434)
  refactor: change open recipe in new window to pass recipe id (#7392)
  fix: handle truncated tool calls that break conversation alternation (#7424)
  streamline some github actions (#7430)
  Enable bedrock prompt cache (#6710)
  fix: use BEGIN IMMEDIATE to prevent SQLite deadlocks (#7429)
  Display working dir (#7419)
  dev: add cmake to hermitized env (#7399)
  refactor: remove allows_unlisted_models flag, always allow custom model entry (#7255)
  feat: expose context window utilization to agent via MOIM (#7418)
  Small model naming (#7394)
  chore(deps): bump ajv in /documentation (#7416)
  doc: groq models (#7404)
  ...
lifeizhou-ap added a commit that referenced this pull request Feb 24, 2026
* main:
  Simplified custom model flow with canonical models (#6934)
  feat: simplify the text editor to be more like pi (#7426)
  docs: add YouTube short embed to Neighborhood extension tutorial (#7456)
  fix: flake.nix build failure and deprecation warning (#7408)
  feat(claude-code): add permission prompt routing for approve mode (#7420)
  docs: generate manpages (#7443)
  Blog/goose v1 25 0 release (#7433)
  fix: detect truncated LLM responses in apps extension (#7354)
  fix: removed unnecessary version for goose acp macro dependency (#7428)
  add flag to hide select voice providers (#7406)
  New navigation settings layout options and styling (#6645)
  refactor: MCP-compliant theme tokens and CSS class rename (#7275)
  Redirect llama.cpp logs through tracing to avoid polluting CLI stdout/stderr (#7434)
  refactor: change open recipe in new window to pass recipe id (#7392)
  fix: handle truncated tool calls that break conversation alternation (#7424)
  streamline some github actions (#7430)
  Enable bedrock prompt cache (#6710)
  fix: use BEGIN IMMEDIATE to prevent SQLite deadlocks (#7429)
  Display working dir (#7419)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants