Skip to content

feat: add dry-run fallback for unauthenticated model resolution#139

Merged
l50 merged 2 commits into
mainfrom
dryrun-without-credentials
Jul 2, 2026
Merged

feat: add dry-run fallback for unauthenticated model resolution#139
l50 merged 2 commits into
mainfrom
dryrun-without-credentials

Conversation

@l50

@l50 l50 commented Jul 2, 2026

Copy link
Copy Markdown
Member

Key Changes:

  • Introduced a new rule (4a-dry) that allows --dry-run executions to proceed without credentials by falling back to the manifest's top model with a warning, rather than aborting
  • Added applyManifestTopUnauthenticated to handle BaseURL inheritance from both the manifest entry and bundle-level fallback
  • Added tests covering the no-credentials dry-run path and bundle-level BaseURL propagation

Added:

  • Dry-run credential bypass logic - New applyManifestTopUnauthenticated function in runner/run.go picks the top manifest model, inherits BaseURL from the manifest entry or bundle, logs a warning, and returns a human-readable warning string instead of erroring
  • Test coverage for unauthenticated dry-run behavior - runner/dryrun_credentials_test.go adds two tests: TestResolveModelPrecedenceDryRunWithoutCredentials pins that a dry-run proceeds on the manifest's top model while a real run still aborts with env-var guidance, and TestResolveModelPrecedenceDryRunBundleBaseURL verifies that the bundle-level BaseURL is correctly inherited when neither options nor the manifest entry provide one

Changed:

  • Model resolution branching in ResolveModelPrecedence - Added an early-exit branch in runner/run.go that checks opts.DryRun && len(skipped) > 0 before reaching noCredentialsError, routing unauthenticated dry-runs to applyManifestTopUnauthenticated while leaving real-run failure behavior unchanged

**Added:**

- `TestResolveModelPrecedenceDryRunWithoutCredentials` test that pins rule-4a-dry behavior: dry-run with no credentials proceeds on the manifest's top model with a warning, while a real run still aborts with env-var guidance - `runner/dryrun_credentials_test.go`
- `applyManifestTopUnauthenticated` helper that applies rule 4a-dry by selecting the manifest's top model preference and emitting a warning instead of failing when no credentials exist during a dry-run - `runner/run.go`

**Changed:**

- `ResolveModelPrecedence` now short-circuits to `applyManifestTopUnauthenticated` when `DryRun` is true and all providers were skipped due to missing credentials, allowing dry-runs to proceed without aborting - `runner/run.go`
@codecov

codecov Bot commented Jul 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

**Added:**

- `TestResolveModelPrecedenceDryRunBundleBaseURL` test verifying that when neither `RunOptions` nor the selected manifest entry specify a base URL, the dry-run path correctly inherits `BaseURL` from the parent `Bundle`
@l50 l50 merged commit 5aa5fec into main Jul 2, 2026
5 checks passed
@l50 l50 deleted the dryrun-without-credentials branch July 2, 2026 22:02
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