Skip to content

feat(coder): Gemini as bridge-default provider - #21

Merged
huhn511 merged 5 commits into
mainfrom
feat/free-llm-allotment
Jun 20, 2026
Merged

feat(coder): Gemini as bridge-default provider#21
huhn511 merged 5 commits into
mainfrom
feat/free-llm-allotment

Conversation

@huhn511

Copy link
Copy Markdown
Contributor

Generalizes the env-fallback (company-free) coder path so the bridge-default provider is configurable and prefers Gemini when a Google key is present, falling back to OpenRouter (qwen free) / Anthropic / OpenAI.

Changes

  • store.ts: new resolveEnvFallback() — picks the bridge-default provider (pin with MIND_DEFAULT_PROVIDER), per-provider default model (google → gemini-2.0-flash, openrouter → qwen/qwen3-coder:free, …). Widened the env-fallback summary type to any provider.
  • env.ts: align MIND_AGENT_MODEL default to qwen/qwen3-coder:free (matched store.ts).
  • BYOK (user-pref) stays the optional override and runs unmetered; bridge per-run MIND metering unchanged.

Verified

tsc clean + 102 tests pass. Deployed to prod and verified in Builder: coder runs provider=google source=env-fallback model=gemini-2.5-flash, Gemini wrote + vite-built an app end-to-end.

Companion infra PR: MIND-Studio/mindpods-infra#9.

🤖 Generated with Claude Code

huhn511and others added 4 commits June 21, 2026 01:37
Generalize the env-fallback (company-free) coder path so the bridge-
default provider is configurable and prefers Gemini when a Google key is
present, falling back to OpenRouter (qwen free) / Anthropic / OpenAI.
Pin explicitly with MIND_DEFAULT_PROVIDER. Per-provider default model
(google -> gemini-2.0-flash, openrouter -> qwen/qwen3-coder:free).
BYOK (user-pref) stays the optional override and runs unmetered; bridge
per-run MIND metering is unchanged. Also align env.ts MIND_AGENT_MODEL
default to qwen/qwen3-coder:free (matched store.ts).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The workflow runner was hardcoded to node:22-alpine (musl). Vite/Tailwind v4
pull in lightningcss, whose musl prebuilt binary npm skips on a fresh install
(optional-deps bug) — every `vite build` died with
`Cannot find module lightningcss.linux-x64-musl.node` (exit 1).
Default to node:22-bookworm-slim (glibc) where the gnu binary resolves
cleanly; reproduced the scaffold build green on glibc. Make it overridable
via MIND_WORKFLOW_IMAGE.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…rned
When the in-process session cache is cold (after a restart) and several
publish-path callers (post_receive + reconciler + tracker + publisher) hit
loadAuthedFetchForWebId for the same WebID at once, each spent the SAME stored
single-use refresh token against CSS. The first rotated it; the rest got
`invalid_grant (unknown refresh_token)`, and the clobbered rotation left the
stored token permanently dead — forcing a /connect re-auth (observed in prod:
a refresh storm of 5+ failed refreshes on one dead session).
Collapse concurrent refreshes per WebID onto one in-flight promise: the token
is spent exactly once and every caller shares the resulting live session.
Complements the MC-176 cache (which only helps once a session is warm).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
… doesn't wipe the publish
The after-upload prune compared each pod child against `kept` using the raw
`ldp:contains` object. CSS can emit that object as an absolute URL, so
`childRel` became a full URL that never matched the relative keys in `kept`
— the prune then DELETEd every file it had just uploaded and the published
site served 404s despite `publisher.done uploaded:N`. Resolve each child to
absolute, re-derive the immediate segment relative to the container, and
compare that. Works for both relative-slug and absolute-URL servers.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@huhn511
huhn511force-pushed the feat/free-llm-allotment branch from 90663c7 to 5bccc5bCompareJune 20, 2026 23:39
The biome ci gate (#20) checks formatting too. My hand-edits to the four
publish-pipeline files differed from biome's 100-col formatter, and the
tracker-pod test used forbidden non-null assertions — both fail `biome ci .`.
Reformat the four files and switch the test asserts to optional chaining /
guarded gets. No behavior change.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@huhn511
huhn511 merged commit cc11c1c into mainJun 20, 2026
1 check passed
@huhn511
huhn511 deleted the feat/free-llm-allotment branch June 20, 2026 23:52
@mind-release-botmind-release-botBot mentioned this pull request Jun 20, 2026
Sign up for freeto 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

@huhn511