test: complete v0.12.0 bug hunt regression test coverage#36
Conversation
…L1, M1) Cover 7 previously untested bug fixes with 12 new test cases: - C4: ensure_rng consolidation via Tls_helpers - H1: session state machine transitions (double init, ready guard, close) - H2: version negotiation fallback to latest on unsupported version - L1: default_max_response_size constant verification - M1: pre-init session validation accepts any header Total: 22 -> 34 test cases in test_bug_fixes.ml Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…current HTTP requests handler.ml subscribed_uris was a plain mutable field. When two concurrent HTTP requests (subscribe + subscribe) raced on the same Handler.t, the read-modify-write sequence could lose one update (fiber A reads old set, fiber B reads old set, last writer wins). Replace mutable StringSet.t with StringSet.t Atomic.t and a lock-free compare-and-set loop. StringSet is immutable so CAS swaps a pointer. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: af83921a9a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| completion_handler: completion_handler option; | ||
| task_handlers: task_handlers option; | ||
| mutable subscribed_uris: StringSet.t; | ||
| subscribed_uris: StringSet.t Atomic.t; |
There was a problem hiding this comment.
Preserve independent subscription state per handler copy
Switching subscribed_uris to StringSet.t Atomic.t makes every record copy created via { s with ... } (for example through add_tool/add_resource/add_prompt) share the same mutable cell, whereas previously each copy had its own mutable field value. This means branching from a base handler into multiple handlers/servers will now leak resources/subscribe and resources/unsubscribe state across instances, so one instance’s subscriptions can unexpectedly affect another’s behavior.
Useful? React with 👍 / 👎.
Summary
test_bug_fixes.ml테스트 케이스: 22 → 34개Added Tests
Not Tested (by design)
Test plan
dune build --root .passesdune runtest --root .passes (34/34 in Bug_fixes suite)🤖 Generated with Claude Code