fix(session): serialize concurrent schema migrations - #142
Conversation
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Co-authored-by: Medulla <medulla@tinyhumans.ai>
|
Important Approval pendingCodeRabbit has no unresolved comments, but it could not review the latest commit because the review limit was reached. Follow the review guidance in this comment to continue. Comment |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
tinysweeper found nothing blocking. Approving.
$0.0043 · 52,870 in / 407 out · 0 cached (0%) · openrouter/openai/text-embedding-3-small, deepseek/deepseek-v4-flash · 257 embedded
critique: $0.0019 · 23,429 in / 158 out · 0 cached (0%) · deepseek/deepseek-v4-flash
security: $0.0010 · 12,213 in / 94 out · 0 cached (0%) · deepseek/deepseek-v4-flash
tests: $0.0010 · 12,557 in / 92 out · 0 cached (0%) · deepseek/deepseek-v4-flash
description: $0.0004 · 4,671 in / 63 out · 0 cached (0%) · deepseek/deepseek-v4-flash
How this change flows0 changed behaviours across 9 relationships. 5 surrounding behaviours are shown (60 graph nodes walked). 47 further behaviours left out to keep the diagram readable. flowchart LR
n0["with_memory_connection"]:::impacted
n1["insert_test_session"]:::impacted
n2["execute"]:::impacted
n3["search_sessions_inner"]:::impacted
n4["search_by_fts_query"]:::impacted
n1 -->|calls| n2
n4 -->|calls| n0
n4 -->|tests| n0
n4 -->|calls| n1
n4 -->|tests| n1
n4 -->|calls| n2
n4 -->|tests| n2
n4 -->|calls| n3
n4 -->|tests| n3
classDef changed fill:#0d4429,stroke:#238636,color:#e6edf3
classDef impacted fill:#161b22,stroke:#6e7681,color:#c9d1d9
classDef flagged fill:#5a1e02,stroke:#d93f0b,color:#ffffff
classDef blocking fill:#67060c,stroke:#f85149,color:#ffffff
Green: changed behaviour. Grey: surrounding behaviour. Arrows name the call, use, implementation, or test relationship. Orange: has findings. Red: has a finding that blocks the merge. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e8c3c7c655
ℹ️ 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".
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Summary
Fix the schema migration race identified after #141 merged and document the new reasoning persistence API. Each migration now re-reads
schema_versionafter acquiringBEGIN IMMEDIATE, so a connection with a stale migration plan skips DDL another connection already applied.Follow-up to #141 and its review threads.
API Or Behavior Changes
record_message_with_reasoningand durable optional reasoning content.Tests
cargo fmt --checkcargo clippy -p tinyagents-session -- -D warningscargo clippy --all-targets -- -D warningsis covered by upstream CI; the changed crate passes strict Clippy.cargo clippy --all-targets --all-features -- -D warningsis covered by upstream CI; the changed crate passes strict Clippy.cargo build --all-targetsis covered by upstream CI; targeted package compilation completed through tests and Clippy.cargo build --all-targets --all-featuresis covered by upstream CI; targeted package compilation completed through tests and Clippy.cargo test -p tinyagents-session stale_migration_plan_rechecks_version_after_lockcargo test -p tinyagents-session assistant_reasoning_round_trips_separately_from_visible_contentcargo test --all-featuresis covered by upstream CI; focused migration and persistence regressions passed.Documentation
Updated
crates/tinyagents-session/src/README.mdand migration module docs with the public recording API, persisted column, and lock/recheck invariant.