Skip to content

fix(opencode): stop Azure model discovery from logging to stdout - #46646

Merged
rekram1-node merged 2 commits into
devfrom
azure-discovery-log
Sep 1, 2026
Merged

rekram1-node merged 2 commits into
devfrom
azure-discovery-log

Conversation

@rekram1-node

Copy link
Copy Markdown
Collaborator

Problem

Users with an Azure oauth auth entry but without the az CLI installed saw an Azure warning printed to stdout on every startup.

Two things were wrong in packages/opencode/src/plugin/azure.ts:

  1. The provider.models hook is invoked through Effect.promise in provider.ts, i.e. outside the app's Effect runtime. Its .catch called Effect.runSync(Effect.logWarning(...)), which spins up a bare runtime with the default console logger and writes straight to stdout.
  2. Discovery shelled out to az even when which("az") had already determined the CLI was missing, guaranteeing the failure.

Fix

  • Skip model discovery when the Azure CLI is unavailable and return the configured models.
  • Drop the console-bound log; on discovery failure fall back silently to the configured models (existing behavior otherwise).
  • Add a test asserting no az command is spawned when the CLI is unavailable.

The provider models hook runs outside the app Effect runtime, so
Effect.runSync(Effect.logWarning(...)) used the default console logger
and printed a warning on every startup for users with an Azure oauth
entry but no az CLI. Skip discovery when az is not installed and drop
the console-bound log.
Defaulting available to true hid the exact dependency this fix gates
on. Make every collaborator explicit and move the boilerplate into the
tests.
@rekram1-node
rekram1-node merged commit 216ba8f into dev Sep 1, 2026
7 of 8 checks passed
@rekram1-node
rekram1-node deleted the azure-discovery-log branch September 1, 2026 18:39
filipeforattini added a commit to reddb-io/redcode that referenced this pull request Sep 5, 2026
filipeforattini added a commit to reddb-io/redcode that referenced this pull request Sep 5, 2026
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.

1 participant