Skip to content

fix(session): serialize concurrent schema migrations - #142

Merged
senamakel merged 3 commits into
tinyhumansai:mainfrom
senamakel:agent-turn-transcript
Aug 31, 2026
Merged

fix(session): serialize concurrent schema migrations#142
senamakel merged 3 commits into
tinyhumansai:mainfrom
senamakel:agent-turn-transcript

Conversation

@senamakel

Copy link
Copy Markdown
Member

Summary

Fix the schema migration race identified after #141 merged and document the new reasoning persistence API. Each migration now re-reads schema_version after acquiring BEGIN 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

Tests

  • cargo fmt --check
  • cargo clippy -p tinyagents-session -- -D warnings
  • N/A: cargo clippy --all-targets -- -D warnings is covered by upstream CI; the changed crate passes strict Clippy.
  • N/A: cargo clippy --all-targets --all-features -- -D warnings is covered by upstream CI; the changed crate passes strict Clippy.
  • N/A: cargo build --all-targets is covered by upstream CI; targeted package compilation completed through tests and Clippy.
  • N/A: cargo build --all-targets --all-features is covered by upstream CI; targeted package compilation completed through tests and Clippy.
  • cargo test -p tinyagents-session stale_migration_plan_rechecks_version_after_lock
  • cargo test -p tinyagents-session assistant_reasoning_round_trips_separately_from_visible_content
  • N/A: cargo test --all-features is covered by upstream CI; focused migration and persistence regressions passed.

Documentation

Updated crates/tinyagents-session/src/README.md and migration module docs with the public recording API, persisted column, and lock/recheck invariant.

senamakel and others added 2 commits August 31, 2026 22:12
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Co-authored-by: Medulla <medulla@tinyhumans.ai>
@coderabbitai

coderabbitai Bot commented Aug 31, 2026

Copy link
Copy Markdown

Important

Approval pending

CodeRabbit 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 @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Aug 31, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-08-31T19:29:40.475317Z 63dc528 New commits
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@tinysweeper tinysweeper 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.

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

@tinysweeper

tinysweeper Bot commented Aug 31, 2026

Copy link
Copy Markdown

How this change flows

0 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
Loading

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.

tinysweeper 0.1.0

@tinysweeper tinysweeper Bot added the priority: p3 Whenever. Cosmetic, a nicety, or a cleanup with no user visible effect. label Aug 31, 2026

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 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".

Comment thread crates/tinyagents-session/src/migrations.rs Outdated
Co-authored-by: Medulla <medulla@tinyhumans.ai>
@senamakel
senamakel merged commit 29e3415 into tinyhumansai:main Aug 31, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority: p3 Whenever. Cosmetic, a nicety, or a cleanup with no user visible effect.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant