Skip to content

fix(server): count terminal event bytes - #76

Merged
l1shen merged 1 commit into
oomol-lab:mainfrom
l1shen:fix/69-terminal-event-bytes
Sep 5, 2026
Merged

fix(server): count terminal event bytes#76
l1shen merged 1 commit into
oomol-lab:mainfrom
l1shen:fix/69-terminal-event-bytes

Conversation

@l1shen

@l1shen l1shen commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Terminal Run events increased event_count without updating event_bytes. Count their serialized UTF-8 bytes in the same transaction, using the existing event accounting convention.

Regression tests cover completed, failed, canceled, and indeterminate Runs with multibyte results, and verify repeated terminal commits do not count or insert the event twice. All four cases failed before the fix and pass afterward.

Validation: bun run format, bun run check, bun run test (1,087 tests), and bun run build passed.

Fixes #69.

@coderabbitai

coderabbitai Bot commented Sep 5, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Essentials

Run ID: 4341d027-9288-4396-9518-afa137774001

📥 Commits

Reviewing files that changed from the base of the PR and between baf1c87 and dce6121.

📒 Files selected for processing (2)
  • apps/server/node/store.ts
  • apps/server/test/service.test.ts

Included review availability: 2 reviews are currently available. Your included PR review attempts over the past 7 days set your current allowance at 3 reviews per hour.


Summary by CodeRabbit

  • Bug Fixes
    • Terminal run events now correctly include serialized payload sizes in byte totals, including UTF-8 content.
    • Completed, failed, canceled, and indeterminate terminal runs now update event and byte counts consistently.
    • Repeated commits are rejected without creating duplicate events or inflating counters.

Walkthrough

#finishRun now calculates the serialized terminal event size and updates both event_count and event_bytes. Service tests cover completed, failed, canceled, and indeterminate statuses. The tests verify UTF-8 byte sizing, single-event persistence, and rejection of duplicate commits.

Merge Risk: ⚪ Minimal · up to dce61

Terminal Run events now include their serialized UTF-8 payload size in event byte totals alongside event counts. Coverage includes all terminal statuses and repeated commits, with no remaining merge-readiness risk identified.

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title uses the required <type>(<scope>): <subject> format and accurately describes the server fix for terminal event byte counting.
Description check ✅ Passed The description directly explains the event byte-counting fix, regression tests, validation, and linked issue.
Linked Issues check ✅ Passed The change satisfies issue [#69] by calculating serialized UTF-8 bytes and updating event_bytes with event_count for terminal events. Tests cover all required terminal statuses and duplicate commi…
Out of Scope Changes check ✅ Passed All changes support issue [#69]. The implementation updates terminal event accounting, and the tests provide focused regression coverage without unrelated changes.
✨ Finishing Touches
✨ Simplify code
  • Create PR with simplified code

Comment @coderabbitai help to get the list of available commands.

@l1shen
l1shen merged commit 50fc5f0 into oomol-lab:main Sep 5, 2026
8 checks passed
@l1shen
l1shen deleted the fix/69-terminal-event-bytes branch September 5, 2026 02:21
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] #finishRun does not update event_bytes for terminal events

1 participant