Hey folks, we’ve got a Java service handling TOOL CALLING for our Cognigy.AI gateway and the JSON SCHEMA validation is tripping out on nested objects. We generally prefer general routing setups, but this orchestration layer demands strict PARAMETER SANITIZATION. The LLM pushes function requests through the REST ENDPOINT, but when we parse the arguments, the async payloads drop before the CORRELATION CONTEXT gets attached. Here’s the snippet we’re using to map the incoming payload: Map<String, Object> toolArgs = objectMapper.readValue(llmPayload.get("arguments").toString(), new TypeReference<Map<String, Object>>(){}); The backend execution works fine for synchronous calls, but once we switch to async responses, the correlation ID gets lost in the queue and the LLM times out waiting for the structured result. We’re trying to maintain the SESSION STATE across the callback, but the response handler isn’t matching the original request context.
We’ve wired up a TIMEOUT HANDLER with a basic fallback strategy that just returns a generic error string, but it’s messing with the cost attribution since our METRICS LOGGING isn’t capturing the failed invocation attempts properly. The logging framework needs to tag each tool execution with the exact schema version and execution latency so we can track spend per agent skill. Right now the async callback just spits back a 504 and the LLM synthesis loop breaks. Anyone got a clean way to thread the correlation context through the async response without bloating the payload? We’re stuck on the timeout retry logic and the logging hook isn’t firing.