Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
47beb41
fix(core): recover model requests rejected with HTTP 413 via one-shot…
yiliang114 Aug 28, 2026
cdc35be
fix(core): suppress post-compact restoration on payload-overflow comp…
yiliang114 Aug 28, 2026
0d5d3c9
fix(core): keep part siblings and slim functionCall args in 413 slimming
yiliang114 Aug 28, 2026
ecae69c
fix(core): keep cause-wrapped 413 status on the actionable error
yiliang114 Aug 28, 2026
db32264
fix(core): give 413 recovery outcome-accurate advice instead of uncon…
yiliang114 Aug 28, 2026
676fd2f
fix(core,cli): report payload_overflow trigger reason for 413-driven …
yiliang114 Aug 28, 2026
646932c
fix(core): label and log the 413 recovery path accurately for oncall
yiliang114 Aug 28, 2026
b3abd08
fix(core): anchor 413 recovery accounting on a local history estimate
yiliang114 Aug 28, 2026
73cbac7
fix(core): keep 413 recoveries off the cache-sharing side-query path
yiliang114 Aug 28, 2026
e368a6c
test(core): pin the maxFiles half of payload-overflow restoration sup…
yiliang114 Aug 28, 2026
faddd02
Merge remote-tracking branch 'origin/main' into prmerge-10408
qwencoder Aug 28, 2026
95eef8c
test(core): cast the restoration-suppression fake config to Config
yiliang114 Aug 28, 2026
7bc0446
Merge branch 'main' into fix/issue-10380-model-request-413
yiliang114 Aug 30, 2026
46aace5
fix(core): handle payload-overflow compaction edge cases
yiliang114 Aug 31, 2026
cda0ea9
Merge branch 'main' into fix/issue-10380-model-request-413
yiliang114 Aug 31, 2026
c3dc520
test(core): make 413 compaction fixtures carry a realistically large …
yiliang114 Aug 31, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions packages/cli/src/ui/hooks/use-llm-stream.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13590,6 +13590,47 @@ describe('useLlmStream', () => {
]);
});

// Issue #10380: 413-driven compactions fire below the token threshold;
// the notice must attribute the compaction to the request-body limit,
// not to an input token limit the request never approached.
it('attributes the notice to the request-body limit for payload-overflow compactions', async () => {
mockSendMessageStream.mockReturnValue(
(async function* () {
yield {
type: ServerLlmEventType.ChatCompressed,
value: {
originalTokenCount: 100,
newTokenCount: 50,
triggerReason: 'payload_overflow',
},
};
yield {
type: ServerLlmEventType.Finished,
value: { reason: 'STOP', usageMetadata: undefined },
};
})(),
);

const { result } = renderTestHook();
await act(async () => {
await result.current.submitQuery('test payload overflow compression');
});

const infoItems = mockAddItem.mock.calls
.map(([item]) => item as HistoryItem)
.filter((item) => item.type === 'info');
expect(infoItems).toEqual([
expect.objectContaining({
text: expect.stringContaining(
'exceeded the endpoint request-body limit',
),
}),
]);
expect((infoItems[0] as HistoryItem).text).not.toContain(
'approached the input token limit',
);
});

it('renders unknown counts when the auto-compaction event value is null', async () => {
mockSendMessageStream.mockReturnValue(
(async function* () {
Expand Down
4 changes: 3 additions & 1 deletion packages/cli/src/ui/hooks/use-llm-stream.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2350,7 +2350,9 @@ export const useLlmStream = (
const reasonClause =
eventValue?.triggerReason === 'image_overflow'
? `accumulated enough tool screenshots to trigger compaction for ${activeModel}`
: `approached the input token limit for ${activeModel}`;
: eventValue?.triggerReason === 'payload_overflow'
? `exceeded the endpoint request-body limit for ${activeModel}`
: `approached the input token limit for ${activeModel}`;
const warningSuffix = eventValue?.warning
? `\n⚠️ ${eventValue.warning}`
: '';
Expand Down
Loading
Loading