Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
f88d3eb
fix(session): filter Anthropic-only params from 3P provider requests …
adityachaudhary99 Jun 5, 2026
7b22033
test: add regression tests for provider gates (PR #1533)
adityachaudhary99 Jun 7, 2026
4be01fe
test: fix leaky mock harness and add redacted_thinking coverage
adityachaudhary99 Jun 8, 2026
2718193
test: eliminate mock.module leaks causing 10 CI failures
adityachaudhary99 Jun 8, 2026
18938be
test: clear provider profile env vars and remove aggressive mock.restore
adityachaudhary99 Jun 8, 2026
42c2110
test(betas): ensure provider env vars are cleared in afterEach, not j…
adityachaudhary99 Jun 8, 2026
7ab48fe
test(3p): also clear VENICE_API_KEY and MIMO_API_KEY per test
adityachaudhary99 Jun 12, 2026
7c41a3e
test(3p): use crypto.randomUUID() for message uuids
adityachaudhary99 Jun 12, 2026
d18a6bb
test(3p): cast assistantMessage.message through 'as never'
adityachaudhary99 Jun 12, 2026
0be3c96
test(betas): add non-Claude GitHub regression test for provider gate
adityachaudhary99 Jun 12, 2026
ceb8c1e
docs(compact): update stale "3P default: true" comments
adityachaudhary99 Jun 12, 2026
77389de
test(3p): also clear NEARAI_API_KEY per test
adityachaudhary99 Jun 12, 2026
5095f76
test(3p): pre-warm importFreshBetas in beforeAll to avoid 5s timeout
adityachaudhary99 Jun 12, 2026
42280eb
test(3p): add FIREWORKS_API_KEY to provider env cleanup
adityachaudhary99 Jun 13, 2026
64eaf84
test(3p): scrub provider env vars instead of restoring leaked snapshot
adityachaudhary99 Jun 13, 2026
4947145
debug(3p): add env/provider diagnostics to openai beta test
adityachaudhary99 Jun 13, 2026
21fcd5c
test(3p): restore real providers.js in betas/compact tests
adityachaudhary99 Jun 13, 2026
c30e4c7
test(3p): fix providers, diskOutput, and messages mock leaks
adityachaudhary99 Jun 13, 2026
f6015f2
test(compact): restore projectInstructions/path/config mocks in afterAll
adityachaudhary99 Jun 13, 2026
98c925b
fix(compact): keep cache-sharing for GitHub Native Anthropic compaction
adityachaudhary99 Jun 13, 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
37 changes: 37 additions & 0 deletions src/services/api/openaiShim.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5282,6 +5282,43 @@ test('drops empty assistant message when only thinking block was present and str
expect(String(messages[0].content)).toContain('Interrupting query')
})

test('drops empty assistant message when only redacted_thinking block was present and stripped', async () => {
let requestBody: Record<string, unknown> | undefined

globalThis.fetch = (async (_input, init) => {
requestBody = JSON.parse(String(init?.body))
return new Response(JSON.stringify({
id: 'chatcmpl-1',
object: 'chat.completion',
created: 123456789,
model: 'mistral-large-latest',
choices: [{ message: { role: 'assistant', content: 'hi' }, finish_reason: 'stop' }],
usage: { prompt_tokens: 1, completion_tokens: 1, total_tokens: 2 }
}), { headers: { 'Content-Type': 'application/json' } })
}) as FetchType

const client = createOpenAIShimClient({}) as OpenAIShimClient

await client.beta.messages.create({
model: 'mistral-large-latest',
messages: [
{ role: 'user', content: 'Initial' },
{ role: 'assistant', content: [{ type: 'redacted_thinking', data: '[thinking hidden]' }] },
{ role: 'user', content: 'Interrupting query' },
],
max_tokens: 64,
stream: false,
})

const messages = requestBody?.messages as Array<Record<string, unknown>>
// The assistant msg is dropped because redacted_thinking is stripped.
// The two user messages are coalesced.
expect(messages.length).toBe(1)
expect(messages[0].role).toBe('user')
expect(String(messages[0].content)).toContain('Initial')
expect(String(messages[0].content)).toContain('Interrupting query')
})

test('injects semantic assistant message when tool result is followed by user message', async () => {
let requestBody: Record<string, unknown> | undefined

Expand Down
1 change: 0 additions & 1 deletion src/services/compact/autoCompact.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ type ImportAutoCompactOptions = {
}

async function importAutoCompact(options: ImportAutoCompactOptions = {}) {
mock.restore()
mock.module('../../utils/config.js', () => ({
...realConfig,
getGlobalConfig: () => ({ autoCompactEnabled: true }),
Expand Down
Loading