feat(session): persist assistant reasoning content - #141
Conversation
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Co-authored-by: Medulla <medulla@tinyhumans.ai>
|
Important Approval pendingCodeRabbit has no unresolved comments, but it has not reviewed the latest commit. Use the checkbox below to review the latest commit. CodeRabbit will approve the changes if it finds no blocking issues.
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. |
How this change flows4 changed behaviours across 10 relationships. 4 surrounding behaviours are shown (60 graph nodes walked). 45 further behaviours left out to keep the diagram readable. flowchart LR
n0["list_messages<br/>changed"]:::changed
n1["record_message<br/>changed"]:::changed
n2["...n_operations_round_trip_every_record_kind<br/>changed"]:::changed
n3["SessionMessage<br/>changed"]:::changed
n4["execute"]:::impacted
n5["insert_test_session"]:::impacted
n6["record_session_start"]:::impacted
n7["with_connection"]:::impacted
n0 -->|uses| n3
n0 -->|calls| n7
n2 -->|calls| n0
n2 -->|tests| n0
n2 -->|calls| n1
n2 -->|tests| n1
n2 -->|calls| n6
n2 -->|tests| n6
n5 -->|calls| n4
n6 -->|calls| n4
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.
tinysweeper found nothing blocking. Approving.
$0.0141 · 131,212 in / 1,779 out · 24,819 cached (19%) · openrouter/openai/text-embedding-3-small, deepseek/deepseek-v4-flash, z-ai/glm-5.2 · 264 embedded
critique: $0.0062 · 58,120 in / 978 out · 8,193 cached (14%) · deepseek/deepseek-v4-flash, z-ai/glm-5.2
security: $0.0064 · 55,395 in / 498 out · 16,626 cached (30%) · deepseek/deepseek-v4-flash, z-ai/glm-5.2
tests: $0.0011 · 12,941 in / 230 out · 0 cached (0%) · deepseek/deepseek-v4-flash
description: $0.0004 · 4,756 in / 73 out · 0 cached (0%) · deepseek/deepseek-v4-flash
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 33586973ac
ℹ️ 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".
|
@codex review\n\n@coderabbitai review |
|
|
|
Codex Review: Didn't find any major issues. Breezy! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
Summary
Persist assistant reasoning separately from visible message content in the SQLite session store. Adds a backward-compatible
record_message_with_reasoningAPI while retaining the existingrecord_messagewrapper, plus an append-only migration and round-trip coverage.API Or Behavior Changes
reasoning_contentto stored session messages.record_message_with_reasoning; existing callers ofrecord_messageremain source-compatible.Tests
cargo fmt --checkcargo clippy --all-targets -- -D warningsis covered by upstream CI; this is a narrow session-store change.cargo clippy --all-targets --all-features -- -D warningsis covered by upstream CI; this is a narrow session-store change.cargo build --all-targetsis covered by upstream CI; targeted package compilation completed through tests.cargo build --all-targets --all-featuresis covered by upstream CI; targeted package compilation completed through tests.cargo test -p tinyagents-sessioncargo test --all-featuresis covered by upstream CI; the changed crate suite passed (53 unit tests and 1 doctest).Documentation
No separate documentation change is needed; the additive public function and field are self-describing and covered by API tests.