Skip to content

Prevent silent data corruption in conversation state - #5

Merged
claude[bot] merged 1 commit into
mainfrom
improve/20260829-190729
Aug 29, 2026
Merged

Prevent silent data corruption in conversation state#5
claude[bot] merged 1 commit into
mainfrom
improve/20260829-190729

Conversation

@ssevera1

Copy link
Copy Markdown
Owner

What

Add validation and error handling for None/empty values in CallSession initialization and message storage methods.

Why

Prevents silent data corruption when invalid data is passed to conversation state, catching errors early with clear messages.

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified the validation against every call site of the touched methods. Live message appends come from voice/xai_bridge.py:150-158, which already guards with if text:, and store.create is only called from voice/twilio_webhook.py:94 where call_sid is explicitly rejected when "unknown" and caller is coerced via _sanitize(...) or "unknown" — so no existing path can newly raise. agent/brain.py's respond/generate_greeting are the only other callers and have no production callers today (only summarize_call is wired into the webhook, and it doesn't append messages), so the stricter behavior on an empty LLM reply is dormant and matches the PR's stated intent. Change is single-file, scoped to the described fix, with no security or error-swallowing concerns; the duplicated checks in create and __post_init__ are redundant but harmless.

@claude
claude Bot merged commit efcc98e into main Aug 29, 2026
3 checks passed
@claude
claude Bot deleted the improve/20260829-190729 branch August 29, 2026 19:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant