Repository navigation
Commit c688a19
committed
feat(bedrock): forward Anthropic stop_details into the stop-reason diagnostics
Part of Zoo-Code-Org#1820: an Opus 5.5 turn ended with a bare "content_filtered" and no
way to tell which classifier declined it.
Anthropic returns a stop_details object naming the refusal category (for
example reasoning_extraction) and a human-readable explanation. Bedrock only
forwards model response fields that are requested by JSON Pointer, so ask for
/stop_details on Claude models and append category and explanation to the
stop_reason chunk, e.g. "content_filtered (reasoning_extraction: ...)". The
explanation text is not stable, so it is shown, not parsed. Converse ignores
a valid pointer the model does not return.
Not yet effective: in a live test on 2026-09-26, Opus 5.5 on Bedrock accepted
the request field but returned content_filtered turns without
additionalModelResponseFields. Kept because it is harmless and starts working
if Bedrock begins forwarding the field; the code comment says so.
https://platform.claude.com/docs/en/build-with-claude/refusals-and-fallback#what-a-refusal-looks-like
https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_ConverseStream.html1 parent c7afb17 commit c688a19
2 files changed
Lines changed: 102 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| 40 | + | |
40 | 41 | | |
41 | 42 | | |
42 | 43 | | |
| |||
159 | 160 | | |
160 | 161 | | |
161 | 162 | | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
162 | 229 | | |
163 | 230 | | |
164 | 231 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
69 | 96 | | |
70 | 97 | | |
71 | 98 | | |
| |||
117 | 144 | | |
118 | 145 | | |
119 | 146 | | |
| 147 | + | |
120 | 148 | | |
121 | 149 | | |
122 | 150 | | |
| |||
620 | 648 | | |
621 | 649 | | |
622 | 650 | | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
623 | 654 | | |
624 | 655 | | |
625 | 656 | | |
| |||
872 | 903 | | |
873 | 904 | | |
874 | 905 | | |
| 906 | + | |
875 | 907 | | |
876 | 908 | | |
877 | | - | |
| 909 | + | |
| 910 | + | |
| 911 | + | |
878 | 912 | | |
879 | 913 | | |
880 | 914 | | |
| |||
0 commit comments