Skip to content

fix: atomic SQL increment for session.errors on ERROR events#126

Merged
acailic merged 2 commits into
mainfrom
fix/issue-124-atomic-error-increment
Mar 31, 2026
Merged

fix: atomic SQL increment for session.errors on ERROR events#126
acailic merged 2 commits into
mainfrom
fix/issue-124-atomic-error-increment

Conversation

@acailic
Copy link
Copy Markdown
Owner

@acailic acailic commented Mar 31, 2026

Summary

  • Replaces the read-modify-write pattern in _increment_session_error_count with a single atomic UPDATE ... SET errors = errors + N to eliminate race conditions when concurrent error events are added to the same session
  • Updates tests in test_issue_search_and_errors.py to rely on auto-counting rather than manually seeding the errors field at session creation

Test plan

Closes #124

🤖 Generated with Claude Code

acailic and others added 2 commits March 31, 2026 02:48
Replace read-modify-write pattern in _increment_session_error_count with
a single SQL UPDATE ... SET errors = errors + N to avoid race conditions
when concurrent events are added. Update tests to rely on auto-counting
rather than manually seeding the errors field.

Closes #124

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
New version (v2) of the codebase-to-course interactive HTML with
7 modules covering SDK tracing, event lifecycle, frontend mission
control, safety systems, and architecture. Previous version preserved
as docs/peaky-peek-course-v1.html.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@acailic acailic merged commit e62ac9c into main Mar 31, 2026
6 checks passed
@acailic acailic deleted the fix/issue-124-atomic-error-increment branch March 31, 2026 23:07
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.

bug: session.errors not auto-incremented when ERROR events are added

1 participant