Skip to content

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

Closed

Description

@devxoul

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

Activity

  1. github-actions commented on Jan 25, 2026

    @github-actions
    Contributor

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

    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.

  2. yanosh-k commented on Jan 25, 2026

    @yanosh-k
    Contributor

    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()

  3. padapada09 commented on Jan 25, 2026

    @padapada09

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

  4. padapada09 commented on Jan 25, 2026

    @padapada09

    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.

  5. yanosh-k commented on Jan 25, 2026

    @yanosh-k
    Contributor

    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

  6. padapada09 commented on Jan 25, 2026

    @padapada09

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

  7. FischLu commented on Jan 25, 2026

    @FischLu

    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.

  8. FischLu commented on Jan 25, 2026

    @FischLu

    @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.

  9. vanyauhalin commented on Jan 25, 2026

    @vanyauhalin
    Contributor

    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-###
    ...
    
  10. alloyapple commented on Jan 25, 2026

    @alloyapple

    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
    
  11. rekram1-node commented on Jan 26, 2026

    @rekram1-node
    Contributor

    this is fixed in next release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions