Commit b40bbd2
Correct the opencode recipe: anthropic/ now works, openai/ crashes on Claude
The recommended launch was backwards. It advised `openai/claude-sonnet-5`, which
crashes: that form forces the Responses API, and litellm's Anthropic->Responses
translation emits three id namespaces in one stream (a resp_ id, Anthropic
msg_/toolu_ item ids, and a stray chatcmpl- id), so opencode dies resolving a
text part under an id it never registered. All six main-model calls returned 200,
so the gateway was never at fault.
`anthropic/claude-sonnet-5` is now the right form. It previously escaped the
gateway -- harbor's adapter injects a baseURL only for the openai provider and
opencode ignores ANTHROPIC_BASE_URL -- but vero now supplies that baseURL itself
for any non-openai provider. Measured on the conformance example: reward 1.0 over
39 steps, 39 metered `messages` calls, no translation layer involved.
Also corrects a security claim that overstated the risk. Escaping the gateway
fails closed rather than leaking: the optimizer only ever holds a scoped producer
token, so a direct call to a provider's public endpoint returns
`401 invalid x-api-key` and the run dies. The upstream credential never leaves the
gateway container. The note previously said such a run would hold a credential the
optimizer is never supposed to see, which would have discouraged the form that now
works, for the wrong reason.
Adds two things the same investigation turned up: opencode issues an auxiliary
small-model call of the same provider family (claude-haiku-4-5 or gpt-5.4-nano)
that 403s against a single-entry allow-list, silently and invisibly outside the
gateway log; and it drives the stateful Responses API for openai/ providers, which
changes how per_trial_tokens.py's content-matching fallback behaves.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>1 parent 47ac5e7 commit b40bbd2
1 file changed
Lines changed: 48 additions & 17 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
111 | 105 | | |
112 | | - | |
| 106 | + | |
113 | 107 | | |
114 | 108 | | |
115 | 109 | | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
121 | 152 | | |
122 | 153 | | |
123 | 154 | | |
| |||
0 commit comments