fix(voice): агент слушает 0.0.0.0 + защита tool_use.input от null
All checks were successful
Deploy / deploy (push) Successful in 1m58s
All checks were successful
Deploy / deploy (push) Successful in 1m58s
- agent/predict.py: HTTPServer bind 127.0.0.1 -> 0.0.0.0, иначе route.ts
(контейнер планшета) не достукивается до tablet-agent по имени в сети coolify
- route.ts: historyToAnthropicMessages приводит не-объект/null из
tc.function.arguments к {} — Anthropic 400 (tool_use.input must be object)
на legacy-истории от Groq (arguments: "null")
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UYsVrPyJ5phJeVsAGciS1v
This commit is contained in:
@@ -79,8 +79,8 @@ def serve(port):
|
|||||||
pass # тихо
|
pass # тихо
|
||||||
|
|
||||||
_ensure_loaded()
|
_ensure_loaded()
|
||||||
print(f"tablet-agent слушает http://127.0.0.1:{port} (порог {THRESHOLD})")
|
print(f"tablet-agent слушает http://0.0.0.0:{port} (порог {THRESHOLD})")
|
||||||
HTTPServer(("127.0.0.1", port), Handler).serve_forever()
|
HTTPServer(("0.0.0.0", port), Handler).serve_forever()
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ function historyToAnthropicMessages(history: HistoryMessage[]): any[] {
|
|||||||
if (msg.content) content.push({ type: 'text', text: msg.content })
|
if (msg.content) content.push({ type: 'text', text: msg.content })
|
||||||
for (const tc of msg.tool_calls) {
|
for (const tc of msg.tool_calls) {
|
||||||
let input: any = {}
|
let input: any = {}
|
||||||
try { input = JSON.parse(tc.function.arguments) } catch {}
|
try { const _p = JSON.parse(tc.function.arguments); if (_p && typeof _p === 'object' && !Array.isArray(_p)) input = _p } catch {}
|
||||||
content.push({ type: 'tool_use', id: tc.id, name: tc.function.name, input })
|
content.push({ type: 'tool_use', id: tc.id, name: tc.function.name, input })
|
||||||
}
|
}
|
||||||
result.push({ role: 'assistant', content })
|
result.push({ role: 'assistant', content })
|
||||||
|
|||||||
Reference in New Issue
Block a user