Repository navigation
Commit b07da4e
committed
fix: altimate-backend models hit Claude-fallback prompt that triggered GPT-5.x refusals
Root cause of the plan-mode refusals on `altimate-backend/altimate-default`:
the system-prompt router in `session/system.ts` selects a base prompt by
string-matching `model.api.id`. The gateway's api.id is the opaque alias
`altimate-default` (kept stable for backward compatibility — users persist
it in `model.json` favorites/recents), which matches none of the patterns
(`gpt-5`, `gpt-`, `gemini-`, `claude`, `trinity`), so it falls through to
`PROMPT_ANTHROPIC_WITHOUT_TODO` (`qwen.txt`).
`qwen.txt` begins with two hard "MUST refuse if borderline/malicious"
Claude-style directives. The upstream gateway model is GPT-5.x (an
OpenAI-trained model), and when those directives stack with plan.txt's
"STRICTLY FORBIDDEN: ANY modifications. ZERO exceptions." language, the
combination is enough to push GPT-5.x into refusing benign developer
requests (confirmed repro: "plan a feature to add a button called verify
output in the UI of altimate-code" → "I'm sorry, but I cannot assist with
that request.").
Fix: route altimate-backend models by `model.family` (which the provider
definition explicitly pins to `"openai"` for `altimate-default` at
`provider.ts:1291`) before the api.id string-match fallthrough. The
gateway-routed GPT-5.x model now gets `codex_header.txt` (its native
prompt) which contains zero refusal language.
Touches:
- `packages/opencode/src/session/system.ts`: family-based routing for
altimate-backend; falls through to existing logic otherwise.
- `packages/opencode/test/session/system.test.ts`: regression tests
locking the routing contract for the three relevant cases (altimate
openai, altimate anthropic, non-altimate openai).
This is the actual fix for #887 / AI-6957 — supersedes the warning-copy
and plan.txt changes from d21f9b1 / 6bbcfbf as the *user-visible*
behavior change. Those earlier commits remain correct: stronger
exploration mandate in plan.txt and accurate warning copy are still
improvements, just not the load-bearing fix.
Typecheck clean. 620 tests pass.1 parent 6bbcfbf commit b07da4e
2 files changed
Lines changed: 80 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
32 | 48 | | |
33 | 49 | | |
34 | 50 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
8 | 72 | | |
9 | 73 | | |
10 | 74 | | |
| |||
0 commit comments