Reduce log noise: models.dev refresh logs at INFO level during startup #7520

Closed
opened 2026-02-16 18:07:26 -05:00 by yindo · 11 comments
Owner

Originally created by @devxoul on GitHub (Jan 25, 2026).

Originally assigned to: @rekram1-node on GitHub.

Problem

During startup, the models.dev refresh function logs at INFO level, creating unnecessary noise in production logs:

INFO  2026-01-25T06:06:04 +69ms service=models.dev file={} refreshing

Screenshot showing noisy INFO log

This log message is operational/diagnostic in nature and doesn't provide actionable information to end users in production environments.

Expected Behavior

  • Production (INFO level): Operational logs like "refreshing" should be hidden
  • Local development (DEBUG level): These logs should remain visible for debugging purposes

Proposed Solution

Change the log.info("refreshing", { file }) call to log.debug("refreshing") in the models.dev refresh function.

This approach:

  • Removes INFO-level log noise during startup
  • Preserves diagnostic capability for local development where log level defaults to DEBUG
  • Follows existing patterns in the codebase (e.g., config.ts uses log.debug() for similar operational logs)

Affected Files

  • packages/opencode/src/provider/models.ts
Originally created by @devxoul on GitHub (Jan 25, 2026). Originally assigned to: @rekram1-node on GitHub. ## Problem During startup, the models.dev refresh function logs at INFO level, creating unnecessary noise in production logs: ``` INFO 2026-01-25T06:06:04 +69ms service=models.dev file={} refreshing ``` ![Screenshot showing noisy INFO log](https://github.com/user-attachments/assets/45eb74b8-7243-4603-8242-5ff09b7292e9) This log message is operational/diagnostic in nature and doesn't provide actionable information to end users in production environments. ## Expected Behavior - **Production (INFO level)**: Operational logs like "refreshing" should be hidden - **Local development (DEBUG level)**: These logs should remain visible for debugging purposes ## Proposed Solution Change the `log.info("refreshing", { file })` call to `log.debug("refreshing")` in the models.dev refresh function. This approach: - Removes INFO-level log noise during startup - Preserves diagnostic capability for local development where log level defaults to DEBUG - Follows existing patterns in the codebase (e.g., `config.ts` uses `log.debug()` for similar operational logs) ## Affected Files - `packages/opencode/src/provider/models.ts`
yindo closed this issue 2026-02-16 18:07:26 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Jan 25, 2026):

This issue might be a duplicate of existing issues. Please check:

  • #5004: Excessive Informational Logging Clutters Log Files in Default Configuration

Both issues describe the same problem: INFO-level logs cluttering output during startup. You may want to check that issue for additional context or related solutions.

Feel free to ignore if your specific case is different.

@github-actions[bot] commented on GitHub (Jan 25, 2026): This issue might be a duplicate of existing issues. Please check: - #5004: Excessive Informational Logging Clutters Log Files in Default Configuration Both issues describe the same problem: INFO-level logs cluttering output during startup. You may want to check that issue for additional context or related solutions. Feel free to ignore if your specific case is different.
Author
Owner

@yanosh-k commented on GitHub (Jan 25, 2026):

As I see it, this is happening because the ModelsDev.refresh() is called on module initialization which is before Log.init() in packages/opencode/src/index.ts. The default log level, before Log.init() is called, is INFO, so those debug() calls will actually not be logged. This defeats the purpose of them being there and I think a more general fix is required.

Maybe moving the initial refresh() call into a its own init() function would be a better approach:

in packages/opencode/src/provider/models.ts wrap the initial call in:

 export function init() {
    if (!Flag.OPENCODE_DISABLE_MODELS_FETCH) {
      ModelsDev.refresh()
      setInterval(
        async () => {
          await ModelsDev.refresh()
        },
        60 * 1000 * 60,
      ).unref()
    }
  }

then in packages/opencode/src/index.ts, load the module and init() it after the Log has been initialized in the cli middleware: ModelsDev.init()

@yanosh-k commented on GitHub (Jan 25, 2026): As I see it, this is happening because the `ModelsDev.refresh()` is called on module initialization which is before `Log.init()` in `packages/opencode/src/index.ts`. The default log level, before `Log.init()` is called, is `INFO`, so those debug() calls will actually not be logged. This defeats the purpose of them being there and I think a more general fix is required. Maybe moving the initial `refresh()` call into a its own `init()` function would be a better approach: in `packages/opencode/src/provider/models.ts` wrap the initial call in: ``` export function init() { if (!Flag.OPENCODE_DISABLE_MODELS_FETCH) { ModelsDev.refresh() setInterval( async () => { await ModelsDev.refresh() }, 60 * 1000 * 60, ).unref() } } ``` then in `packages/opencode/src/index.ts`, load the module and `init()` it after the `Log` has been initialized in the cli middleware: `ModelsDev.init()`
Author
Owner

@padapada09 commented on GitHub (Jan 25, 2026):

I'm having this issue on a clean install on macos 26 with version 1.1.35. Haven't found a workaround yet.

@padapada09 commented on GitHub (Jan 25, 2026): I'm having this issue on a clean install on macos 26 with version 1.1.35. Haven't found a workaround yet.
Author
Owner

@padapada09 commented on GitHub (Jan 25, 2026):

To clarify this is not just a problem of amount of logs, this is preventing the use of opencode at least on macos, as it crashes the terminal ui entirely.

@padapada09 commented on GitHub (Jan 25, 2026): To clarify this is not just a problem of amount of logs, this is preventing the use of opencode at least on macos, as it crashes the terminal ui entirely.
Author
Owner

@yanosh-k commented on GitHub (Jan 25, 2026):

I'm having this issue on a clean install on macos 26 with version 1.1.35. Haven't found a workaround yet.

I think a temp workaround would be to just suppress stderr, when launching opencode: opencode 2>/dev/null

@yanosh-k commented on GitHub (Jan 25, 2026): > I'm having this issue on a clean install on macos 26 with version 1.1.35. Haven't found a workaround yet. I think a temp workaround would be to just suppress stderr, when launching opencode: `opencode 2>/dev/null`
Author
Owner

@padapada09 commented on GitHub (Jan 25, 2026):

@yanosh-k I just tried it, it did not show the info log, but it also crash showing me a blank screen.

@padapada09 commented on GitHub (Jan 25, 2026): @yanosh-k I just tried it, it did not show the info log, but it also crash showing me a blank screen.
Author
Owner

@FischLu commented on GitHub (Jan 25, 2026):

I'm having this issue on a clean install on macos 26 with version 1.1.35. Haven't found a workaround yet.

I think a temp workaround would be to just suppress stderr, when launching opencode: opencode 2>/dev/null

I tested it, and on macOS with opencode 1.1.36 this method doesn't work; nothing is displayed on the screen, and opencode won't start.

@FischLu commented on GitHub (Jan 25, 2026): > > I'm having this issue on a clean install on macos 26 with version 1.1.35. Haven't found a workaround yet. > > I think a temp workaround would be to just suppress stderr, when launching opencode: `opencode 2>/dev/null` I tested it, and on macOS with opencode 1.1.36 this method doesn't work; nothing is displayed on the screen, and opencode won't start.
Author
Owner

@FischLu commented on GitHub (Jan 25, 2026):

@padapada09 A temporary solution is to go to the release section and download an older version, such as 1.1.30, then run it once to initialize some configurations. After that, you can use version 1.1.36 without any issues.

@FischLu commented on GitHub (Jan 25, 2026): @padapada09 A temporary solution is to go to the release section and download an older version, such as 1.1.30, then run it once to initialize some configurations. After that, you can use version 1.1.36 without any issues.
Author
Owner

@vanyauhalin commented on GitHub (Jan 25, 2026):

I am hittin this INFO message on every command. For example:

# opencode completion
INFO  2026-01-25T21:51:27 +34ms service=models.dev file={} refreshing
###-begin-opencode-completions-###
...

The --log-level flag does not help:

# opencode --log-level ERROR completion
INFO  2026-01-25T21:56:29 +34ms service=models.dev file={} refreshing
###-begin-opencode-completions-###
...
@vanyauhalin commented on GitHub (Jan 25, 2026): I am hittin this INFO message on every command. For example: ``` # opencode completion INFO 2026-01-25T21:51:27 +34ms service=models.dev file={} refreshing ###-begin-opencode-completions-### ... ``` The `--log-level` flag does not help: ``` # opencode --log-level ERROR completion INFO 2026-01-25T21:56:29 +34ms service=models.dev file={} refreshing ###-begin-opencode-completions-### ... ```
Author
Owner

@alloyapple commented on GitHub (Jan 25, 2026):

When I open opencode, it show following message:


INFO  2026-01-25T22:31:08 +55ms service=models.dev file={} refreshing
INFO  2026-01-25T22:31:09 +52ms service=models.dev file={} refreshing

@alloyapple commented on GitHub (Jan 25, 2026): When I open opencode, it show following message: ``` markdown INFO 2026-01-25T22:31:08 +55ms service=models.dev file={} refreshing INFO 2026-01-25T22:31:09 +52ms service=models.dev file={} refreshing ```
Author
Owner

@rekram1-node commented on GitHub (Jan 25, 2026):

this is fixed in next release

@rekram1-node commented on GitHub (Jan 25, 2026): this is fixed in next release
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#7520