fix: map AIUI model IDs and add node-list-peers stub

- Map claude-haiku-4.5 → claude-haiku-4-5-20251001 in proxy
- Map claude-sonnet-4.5 → claude-sonnet-4-5-20250514 in proxy
- Add node-list-peers RPC stub (returns empty array)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Dorian 2026-03-08 00:27:34 +00:00
parent 2938d8159b
commit 00ad7a42f5

View File

@ -895,7 +895,8 @@ app.post('/rpc/v1', (req, res) => {
case 'node-messages-received':
case 'node.messages':
case 'node.notifications': {
case 'node.notifications':
case 'node-list-peers': {
return res.json({ result: [] })
}
@ -1035,6 +1036,16 @@ app.post('/aiui/api/claude/*', (req, res) => {
const body = req.body
if (body) {
if (!body.max_tokens) body.max_tokens = 4096
// Fix model IDs — AIUI may send short names
if (body.model && !body.model.includes('-2')) {
const modelMap = {
'claude-haiku-4.5': 'claude-haiku-4-5-20251001',
'claude-haiku-4-5': 'claude-haiku-4-5-20251001',
'claude-sonnet-4-5': 'claude-sonnet-4-5-20250514',
'claude-sonnet-4.5': 'claude-sonnet-4-5-20250514',
}
if (modelMap[body.model]) body.model = modelMap[body.model]
}
// Strip AIUI-specific fields that Anthropic API rejects
delete body.webSearch
delete body.webResults