feat(sdk): support max output tokens

This commit is contained in:
Yichen Jiang
2026-07-28 17:36:44 +08:00
parent f63d2deecf
commit 5358168787
55 changed files with 336 additions and 90 deletions
@@ -105,7 +105,7 @@ describe('DeepSeekHarness', () => {
await harness.close()
})
it('sends the configured cwd/provider/model in the handshake exactly once', async () => {
it('sends the configured cwd/provider/model/maxTokens in the handshake exactly once', async () => {
const dir = await tempDir('sdk-client-init-')
const recordFile = join(dir, 'init.jsonl')
const harness = new DeepSeekHarness({
@@ -113,13 +113,19 @@ describe('DeepSeekHarness', () => {
cwd: dir,
provider: 'custom-provider',
model: 'custom-model',
maxTokens: 4096,
})
cleanups.push(() => harness.close())
await harness.run('one')
await harness.run('two')
await harness.close()
const records = (await readFile(recordFile, 'utf8')).trim().split('\n').map(line => JSON.parse(line) as object)
expect(records).toEqual([{ cwd: dir, provider: 'custom-provider', model: 'custom-model' }])
expect(records).toEqual([{
cwd: dir,
provider: 'custom-provider',
model: 'custom-model',
maxTokens: 4096,
}])
})
it('resolves a relative launch cwd to an absolute workspace before the handshake', async () => {