Repository navigation
Commit 39e618a
fix(analyst): structured policy codes win over overflow-looking text; never finalize onto a completed compaction summary
- `message-v2.ts`: an explicit policy code (`guardrail_intervened` incl. nested orchestration codes, `content_filter`, `content_policy*`, `policy_violation`, `safety_*`, `moderation_*`) keeps the error fatal even when the message text looks like a context overflow; explicit overflow codes (`context_length_exceeded`, `content_length_exceeded`) and HTTP 413 stay overflows; policy metadata survives response truncation
- `prompt.ts`: when the message that would carry a recovered committed answer is a finished, error-free, non-empty compaction summary (a user request was queued during compaction), the summary stays intact as the compaction boundary and the committed text is published once on a new assistant message with the committed request's parent, agent, mode, model, variant and path; failed/empty summariser recovery still converts its own summary message
- tests: 503 guardrail with overflow text during echo stays fatal without publishing or compacting; queued user after successful compaction keeps the summary and gets tools after the new committed-answer message; 413 `content_length_exceeded` still compacts and resumes; 21 `fromError` cases for code vs text precedence
Co-Authored-By: Claude Fable 5.1 <[email protected]>1 parent 09e9581 commit 39e618a
4 files changed
Lines changed: 246 additions & 24 deletions
File tree
- packages/opencode
- src/session
- test
- agent
- session
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
544 | 544 | | |
545 | 545 | | |
546 | 546 | | |
547 | | - | |
| 547 | + | |
548 | 548 | | |
549 | 549 | | |
550 | | - | |
| 550 | + | |
551 | 551 | | |
552 | 552 | | |
553 | 553 | | |
554 | 554 | | |
555 | | - | |
| 555 | + | |
556 | 556 | | |
557 | 557 | | |
558 | 558 | | |
| |||
564 | 564 | | |
565 | 565 | | |
566 | 566 | | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
567 | 571 | | |
568 | 572 | | |
569 | 573 | | |
| |||
1271 | 1275 | | |
1272 | 1276 | | |
1273 | 1277 | | |
1274 | | - | |
| 1278 | + | |
| 1279 | + | |
| 1280 | + | |
| 1281 | + | |
1275 | 1282 | | |
1276 | | - | |
| 1283 | + | |
1277 | 1284 | | |
1278 | 1285 | | |
1279 | 1286 | | |
1280 | 1287 | | |
1281 | | - | |
1282 | | - | |
| 1288 | + | |
| 1289 | + | |
1283 | 1290 | | |
1284 | | - | |
| 1291 | + | |
1285 | 1292 | | |
1286 | 1293 | | |
1287 | 1294 | | |
1288 | 1295 | | |
1289 | | - | |
1290 | | - | |
| 1296 | + | |
1291 | 1297 | | |
1292 | 1298 | | |
1293 | 1299 | | |
| |||
1296 | 1302 | | |
1297 | 1303 | | |
1298 | 1304 | | |
| 1305 | + | |
1299 | 1306 | | |
1300 | 1307 | | |
1301 | 1308 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
827 | 827 | | |
828 | 828 | | |
829 | 829 | | |
830 | | - | |
831 | | - | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
| 833 | + | |
| 834 | + | |
| 835 | + | |
832 | 836 | | |
833 | 837 | | |
834 | 838 | | |
| |||
870 | 874 | | |
871 | 875 | | |
872 | 876 | | |
| 877 | + | |
| 878 | + | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
| 882 | + | |
| 883 | + | |
| 884 | + | |
873 | 885 | | |
874 | 886 | | |
875 | 887 | | |
| |||
915 | 927 | | |
916 | 928 | | |
917 | 929 | | |
918 | | - | |
| 930 | + | |
| 931 | + | |
| 932 | + | |
| 933 | + | |
| 934 | + | |
| 935 | + | |
| 936 | + | |
| 937 | + | |
| 938 | + | |
| 939 | + | |
| 940 | + | |
| 941 | + | |
| 942 | + | |
| 943 | + | |
| 944 | + | |
| 945 | + | |
| 946 | + | |
| 947 | + | |
| 948 | + | |
| 949 | + | |
| 950 | + | |
| 951 | + | |
| 952 | + | |
| 953 | + | |
| 954 | + | |
919 | 955 | | |
920 | 956 | | |
921 | 957 | | |
| |||
930 | 966 | | |
931 | 967 | | |
932 | 968 | | |
933 | | - | |
934 | | - | |
935 | | - | |
936 | | - | |
937 | 969 | | |
938 | 970 | | |
939 | 971 | | |
| |||
0 commit comments