image.png
# ask-ai
m
image.png
t
Thanks for reaching out, Rithwikreddy. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Thanks — I looked at the logs you shared. You’re asking about the “Failed to end billing session: 500 {"error":{"class":"decimal.ConversionSyntax"}}” error and the surrounding session lifecycle messages. I’ll summarize what the logs show and suggest targeted next steps to find and fix the issue. What the logs show • The agent session ended and the dashboard session closed (job_id AJ_NUU7JpsT6QxM, room_id RM_UwReqKUbupFh). • Right after that, billing_integration returned a 500 with
decimal.ConversionSyntax
, indicating the billing service failed while parsing a numeric/decimal value. • The database_manager still updated the call session and conversation logged CALL_END (147.7s), so session state was persisted despite the billing failure. Likely cause • A non-numeric or improperly formatted value (for example duration, price, or cost) was passed to the billing service when ending the session, causing decimal parsing to fail. What you can check next (targeted diagnostics) 1. Identify the billing payload sent at session end: ◦ Inspect logs or request/response traces from billing_integration for this job_id (
AJ_NUU7JpsT6QxM
) and timestamp (193051.998). Look for the exact JSON/body sent to the billing endpoint. 1. Validate numeric fields in that payload: ◦ Check fields like
duration
,
cost
,
price
,
rate
, or any amount strings. Ensure they are numeric or properly formatted decimal strings (e.g., "123.45") and not empty, null, or containing commas/units. 1. Reproduce with a sample: ◦ If you can reconstruct the billing payload in a dev environment, try parsing the suspect fields with your billing library to reproduce
decimal.ConversionSyntax
. 1. Review code paths that build billing values: ◦ Trace how duration/cost are computed when the input stream detaches / call ends. Confirm any conversions (ints → strings, rounding) produce valid decimals. 1. Temporary mitigation: ◦ Add defensive validation/normalization before sending to billing: coerce empty/null to 0, strip commas/units, format with fixed decimal places, and log the sanitized payload. Helpful details you can share to help me narrow it down • The raw billing request payload (or the fields sent) for job_id AJ_NUU7JpsT6QxM at ~193051.998. • The code snippet or function that constructs the billing payload. • The billing library/service you call (internal service, Stripe, etc.) and any input schema it expects. If you share the billing payload or the relevant code that formats the numeric fields, I’ll point out the exact offending field and recommend the precise fix. Sources: server-sdk-ruby | livekit/livekit_composite | DeepWiki | SIP Lifecycle Management Agent | LiveKit docs | https://blog.livekit.io/streamline-troubleshooting-with-agent-observability/#/portal| | LiveKit Pricing | LiveKit