ollama - ✅(Solved) Fix Verbose mode not properly registered in app launch code [2 pull requests, 1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
ollama/ollama#14654Fetched 2026-04-08 00:33:17
View on GitHub
Comments
0
Participants
1
Timeline
6
Reactions
0
Participants
Timeline (top)
cross-referenced ×3referenced ×2labeled ×1

Error Message

It not properly defined in launch context. So Go emit error: Error running model: flag accessed but not defined: verbose and fallback into the main menu. Error running model: flag accessed but not defined: verbose

Fix Action

Fixed

PR fix notes

PR #14659: cmd/config: register verbose flag in LaunchCmd

Description (problem / solution / changelog)

Summary

  • Register the verbose flag on LaunchCmd so that the interactive chat flow (which reads and sets this flag) works correctly when launched via ollama launch

Problem

Running a model through ollama launch triggers: Error running model: flag accessed but not defined: verbose. The interactive chat code (generateInteractive / chat) accesses cmd.Flags().GetBool("verbose"), but LaunchCmd never registered that flag.

Test plan

  • Added verbose flag existence check to TestLaunchCmd/flags_exist
  • All existing cmd/config tests pass

Fixes #14654

Changed files

  • cmd/config/integrations.go (modified, +1/-0)
  • cmd/config/integrations_test.go (modified, +5/-0)

PR #14701: fix: handle missing verbose flag in launch command context

Description (problem / solution / changelog)

Note: This PR was authored by Claude (AI), operated by @maxwellcalkin.

Fixes #14654

Summary

When running a model via ollama launch, the app crashes with:

Error running model: flag accessed but not defined: verbose

This happens because the verbose flag is registered on the run and root commands, but not on the launch command. When the shared chat() and generate() functions try to access the flag via cmd.Flags().GetBool("verbose"), it panics/errors because the flag does not exist in the launch command context.

Changes

cmd/cmd.go

  • In chat(): ignore the error from GetBool("verbose") instead of returning it. When the flag is not registered, GetBool returns false (the zero value), which is the correct default behavior.
  • In generate(): same fix.

cmd/interactive.go

  • In the /set verbose and /set quiet interactive commands: register the verbose flag on the command if it does not already exist before attempting to set it. This ensures these interactive commands work correctly regardless of which command (run or launch) started the interactive session.

Test plan

  • Run ollama launch, select "Run a model", send a message — should complete without the verbose flag error
  • Run ollama launch, run a model, type /set verbose then send a message — should show timing stats
  • Run ollama launch, run a model, type /set quiet — should suppress timing stats
  • Run ollama run <model> — existing behavior unchanged
  • Run ollama run <model> --verbose — existing verbose behavior unchanged

Changed files

  • cmd/cmd.go (modified, +2/-8)
  • cmd/interactive.go (modified, +6/-0)

Code Example

>ollama launch
>>> Hello?
Thinking...
Okay, the user said "Hello?" and I need to respond. Let me make sure I understand the context. They might just be testing if I'm responsive or starting a conversation. I should acknowledge their greeting politely.

I should keep it friendly and open-ended to encourage them to share more. Maybe add an emoji to keep the tone light. Let me check if there's anything else they might need. Since they didn't specify a particular topic, a general offer to help is good. Alright, time to put it all together.
...done thinking.

Hello! 😊 How can I assist you today? Whether you have questions, need help with something, or just want to chat, I'm here for you! What's on your mind?

Error running model: flag accessed but not defined: verbose
Ollama 0.17.6

Run a model (qwen3:8b)
    Start an interactive chat with a model

  Launch Claude Code (not installed)
    Agentic coding across large codebases

  Launch Codex (not installed)
    OpenAI's open-source coding agent

  Launch OpenClaw (install)
    Personal AI with 100+ skills

  More...
    Show additional integrations


/↓ navigate • enter launch • → change model • esc quit

---
RAW_BUFFERClick to expand / collapse

What is the issue?

  1. Run in windows console (cmd) ollama launch.
  2. Select first item (Run a model (qwen3:8b))
  3. Enter Hello?, press Enter.

Expected result: Model answer and prompt ask you again for enter next message.

Actual result: app try use verbose flag at the end, for detect if need show stats. It not properly defined in launch context. So Go emit error: Error running model: flag accessed but not defined: verbose and fallback into the main menu.

ollama run qwen3:8b or ollama run qwen3:8b --verbose will work fine.

Full log:

>ollama launch
>>> Hello?
Thinking...
Okay, the user said "Hello?" and I need to respond. Let me make sure I understand the context. They might just be testing if I'm responsive or starting a conversation. I should acknowledge their greeting politely.

I should keep it friendly and open-ended to encourage them to share more. Maybe add an emoji to keep the tone light. Let me check if there's anything else they might need. Since they didn't specify a particular topic, a general offer to help is good. Alright, time to put it all together.
...done thinking.

Hello! 😊 How can I assist you today? Whether you have questions, need help with something, or just want to chat, I'm here for you! What's on your mind?

Error running model: flag accessed but not defined: verbose
Ollama 0.17.6

▸ Run a model (qwen3:8b)
    Start an interactive chat with a model

  Launch Claude Code (not installed)
    Agentic coding across large codebases

  Launch Codex (not installed)
    OpenAI's open-source coding agent

  Launch OpenClaw (install)
    Personal AI with 100+ skills

  More...
    Show additional integrations


↑/↓ navigate • enter launch • → change model • esc quit

Relevant log output

OS

Windows

GPU

Nvidia

CPU

Intel

Ollama version

0.17.6

extent analysis

Fix Plan

To fix the issue, we need to define the verbose flag in the launch context.

Here are the steps:

  • Define the verbose flag in the launch command.
  • Update the launch command to handle the verbose flag.

Example code:

// Define the verbose flag
var verbose = flag.Bool("verbose", false, "enable verbose mode")

// Update the launch command to handle the verbose flag
func launchCmd() {
    // ...
    if *verbose {
        // Handle verbose mode
    } else {
        // Handle non-verbose mode
    }
    // ...
}

// Parse the flags
flag.Parse()

Alternatively, you can also use a default value for the verbose flag:

var verbose = flag.Bool("verbose", true, "enable verbose mode")

This way, the verbose flag will be enabled by default, and you can disable it by passing --verbose=false as an argument.

Verification

To verify that the fix worked, run the ollama launch command and select the first item (Run a model (qwen3:8b)). Enter a message and press Enter. The model should respond without emitting an error.

Extra Tips

Make sure to update the documentation to reflect the changes to the launch command. Additionally, consider adding a check to ensure that the verbose flag is only accessed after it has been defined.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING