fix: 修复 4 个测试失败(路径规范化、SDK 签名变更、空消息防护)

- projectContext.test.ts: 使用 realpathSync 处理 macOS /var→/private/var 符号链接
- bedrockClient.test.ts: 适配 Bedrock SDK v0.80 Bearer 认证(原 AWS4-HMAC-SHA256)
- bridge.ts: forwardSessionUpdates 添加 null guard 防止空消息导致 TypeError

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
claude-code-best
2026-04-22 22:52:37 +08:00
parent 23fcbf9004
commit f43350e600
3 changed files with 11 additions and 4 deletions

View File

@@ -111,7 +111,12 @@ describe('BedrockClient.buildRequest body.anthropic_beta cleanup', () => {
const c = get()
expect(c).not.toBeNull()
expect(c!.headers.authorization).toBeDefined()
expect(c!.headers.authorization.startsWith('AWS4-HMAC-SHA256')).toBe(true)
// SDK >= 0.80 uses Bearer auth; older versions used AWS4-HMAC-SHA256 SigV4.
// Either way the header must be present (i.e. signing was not broken).
expect(
c!.headers.authorization!.startsWith('AWS4-HMAC-SHA256') ||
c!.headers.authorization!.startsWith('Bearer '),
).toBe(true)
})
test('FIX does not disturb requests that never had anthropic_beta', async () => {