singularity-forge/src
Mikael Hugo 0b19afebf6
Some checks are pending
CI / detect-changes (push) Waiting to run
CI / docs-check (push) Blocked by required conditions
CI / lint (push) Blocked by required conditions
CI / build (push) Blocked by required conditions
CI / integration-tests (push) Blocked by required conditions
CI / windows-portability (push) Blocked by required conditions
CI / rtk-portability (linux, blacksmith-4vcpu-ubuntu-2404) (push) Blocked by required conditions
CI / rtk-portability (macos, macos-15) (push) Blocked by required conditions
CI / rtk-portability (windows, blacksmith-4vcpu-windows-2025) (push) Blocked by required conditions
test(providers): expand discovery test matrix to 46 cases
Adds full coverage for the discovery-gating root cause that was
fixed in commits d70d8d3b1 (xiaomi x-api-key auth) and the
subsequent refreshSfManagedProviders + writeSdkDiscoveryCacheEntry
work in model-catalog-cache.js.

Diagnosis recap: kimi-coding, opencode, opencode-go were silent
in ~/.sf/agent/discovery-cache.json because the SDK's
model-discovery.js adapter registry marked them with
StaticDiscoveryAdapter (supportsDiscovery=false), so the SDK's
discoverModels() never attempted them. SF's own
scheduleModelCatalogRefresh DID fetch them but wrote only to the
per-repo runtime cache (basePath/.sf/model-catalog/) and only fired
on session_start — not during --discover. The fix is to mirror the
write to the SDK's discovery cache on both fetch-path AND cache-hit
path, and await it in cli.ts before listModels when --discover is set.

New test sections:
- parseDiscoveredModels: OpenAI {data}/{models} formats, Google
  {models[].name} prefix stripping, name-as-id fallback, null on
  bad input, OpenRouter pricing extraction
- refreshSfManagedProviders: xiaomi uses x-api-key (not Bearer),
  opencode uses Bearer, no-key providers skipped, SDK discovery cache
  written on BOTH network-fetch and cache-hit paths, kimi-coding +
  opencode-go iterated when keys present

46 tests pass. No regressions.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-15 15:09:38 +02:00
..
resources test(providers): expand discovery test matrix to 46 cases 2026-05-15 15:09:38 +02:00
tests fix(headless): normalize auto alias to autonomous 2026-05-15 14:32:00 +02:00
web
app-paths.ts
bundled-extension-paths.ts
bundled-resource-path.ts
claude-cli-check.ts
cli-logs.ts
cli-stats.ts
cli-status.ts
cli-web-branch.ts
cli.ts chore(discovery): silence debug stderr from refresh path 2026-05-15 15:03:56 +02:00
env.ts
errors.ts
extension-discovery.ts
extension-registry.ts
headless-answers.ts
headless-context.ts
headless-events.ts fix(headless): do not restart graceful child exits 2026-05-15 07:25:06 +02:00
headless-import-backlog.ts
headless-query.ts
headless-reflect.ts
headless-triage.ts fix(triage): --run routes through runTriageApply{dryRun:true} via SF router 2026-05-15 09:20:43 +02:00
headless-types.ts
headless-ui.ts
headless-uok-status.ts
headless-usage.ts
headless.ts fix(headless): normalize auto alias to autonomous 2026-05-15 14:32:00 +02:00
help-text.ts
interactive-session-lock.ts
loader.ts
logger.ts
logo.ts
models-resolver.ts
onboarding.ts
pi-migration.ts
project-sessions.ts
provider-migrations.ts
remote-questions-config.ts
resource-loader.ts
rtk.ts
security-overrides.ts
startup-model-validation.ts
startup-timings.ts
tool-bootstrap.ts
traces.ts
update-check.ts
update-cmd.ts
web-mode.ts
welcome-screen.ts
wizard.ts
worktree-cli.ts
worktree-name-gen.ts