You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 098a646
Browse filesBrowse the repository at this point in the historyBrowse files
J1 — exact family-string match misses real gateway values
`system.ts` (and `prompt.ts:isAnthropicLikeModel`) compared
`model.family` exactly against `"anthropic"` / `"gemini"`. But the
model registry (`models-api.json`) uses *specific* family values like
`claude-sonnet`, `claude-haiku`, `gemini-pro`, `gemini-flash`,
`gpt-codex`, etc. — never the coarse literals. Any config-added
Claude or Gemini model on the altimate-backend gateway therefore
silently fell through to `PROMPT_CODEX` — recreating the GH #887
misrouting class this PR was meant to fix. Latent today because the
only statically-registered altimate-backend model is `altimate-default`
with `family: "openai"` (coarse).
Fix: shared `familyVendor(family)` helper in `src/provider/family.ts`
that maps `claude` / `claude-*` / `anthropic` → `"anthropic"`,
`gemini` / `gemini-*` → `"gemini"`, `openai` / `openai-compatible` /
`gpt` / `gpt-*` → `"openai"`. Used by both `SystemPrompt.provider`
(altimate-backend block) and `isAnthropicLikeModel`. `isAnthropicLikeModel`
also tightens the api.id substring matches (lowercased; `claude-`
anchored to the last URL segment so `foo-claude-bench` doesn't
false-match; `anthropic-`/`anthropic/` anchored to the path).
J2 — experimental plan-mode reminders replay as user-role
`<system-reminder>` on turn 2+
Under `OPENCODE_EXPERIMENTAL_PLAN_MODE=true`, `insertReminders` calls
`Session.updatePart(...)` to persist the entering-plan-mode and
build-switch reminder parts. The persisted row was written *without*
`ignored: true`. The caller mutated `part.ignored = true` only on the
in-memory copy, so on the next turn the DB-reloaded part had
`ignored: undefined`, slipped past the `!part.ignored` filter in
`toModelMessages`, and re-entered the user-role payload as
`<system-reminder>...</system-reminder>` — re-triggering the GPT-5.x
refusal class this PR fixes. Bug was flag-gated so the default path
was unaffected, but the PR ships tests pinned to the experimental
branches so it shipped the bug latent under the flag.
Fix: push the hoist decision *into* `insertReminders`. The function
now takes `model`, computes `nonAnthropic = !isAnthropicLikeModel(...)`
once, and stamps `ignored: true` onto every trusted reminder at
insertion time — including the `Session.updatePart` payloads, so the
persisted row carries the flag across turns. Caller in `loop()`
no longer mutates `part.ignored`; the contract is now owned by
`insertReminders`. The hoist branch in `loop()` reduces to a simple
`.map(p => p.text)` over `trustedReminderParts`.
Tests
- New: `test/provider/family.test.ts` table-drives `familyVendor`
against every coarse-vs-specific case (claude/claude-haiku/
claude-opus/claude-sonnet/gemini/gemini-pro/gemini-flash/gpt/
gpt-codex), case-insensitivity, and the unknown→undefined contract.
- `test/session/plan-layer-e2e.test.ts`: regression guards that
(a) `system.ts` and `prompt.ts:isAnthropicLikeModel` both consume
`familyVendor` and no exact `family === "anthropic"` shape lingers
in the altimate-backend block; (b) `insertReminders` takes `model`
and stamps `nonAnthropic ? { ignored: true } : {}` onto persisted
reminder writes; (c) the caller no longer mutates `part.ignored`.
154 affected tests pass. Typecheck clean.
Addresses #888 review J1, J2, and N1 (case-sensitivity / over-broad
api.id substring) and N2 in spirit (`isAnthropicLikeModel` now has its
classifier under direct test via `familyVendor`).
@@ -2235,6 +2257,7 @@ This is critical - your turn should only end with either asking the user a quest
2235
2257
NOTE: At any point in time through this workflow you should feel free to ask the user questions or clarifications. Don't make large assumptions about user intent. The goal is to present a well researched plan to the user, and tie any loose ends before implementation begins.
0 commit comments