Skip to content

feat(session): persist assistant reasoning content - #141

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

feat(session): persist assistant reasoning content#141
senamakel merged 3 commits into
tinyhumansai:mainfrom
senamakel:agent-turn-transcript

Conversation

@senamakel

Copy link
Copy Markdown
Member

Summary

Persist assistant reasoning separately from visible message content in the SQLite session store. Adds a backward-compatible record_message_with_reasoning API while retaining the existing record_message wrapper, plus an append-only migration and round-trip coverage.

API Or Behavior Changes

  • Adds optional reasoning_content to stored session messages.
  • Adds record_message_with_reasoning; existing callers of record_message remain source-compatible.

Tests

  • cargo fmt --check
  • N/A: cargo clippy --all-targets -- -D warnings is covered by upstream CI; this is a narrow session-store change.
  • N/A: cargo clippy --all-targets --all-features -- -D warnings is covered by upstream CI; this is a narrow session-store change.
  • N/A: cargo build --all-targets is covered by upstream CI; targeted package compilation completed through tests.
  • N/A: cargo build --all-targets --all-features is covered by upstream CI; targeted package compilation completed through tests.
  • cargo test -p tinyagents-session
  • N/A: cargo test --all-features is 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.

senamakel and others added 3 commits August 31, 2026 18:47
@coderabbitai

coderabbitai Bot commented Aug 31, 2026

Copy link
Copy Markdown

Important

Approval pending

CodeRabbit 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.

  • 🔍 Trigger review

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:20:09.403634Z 3358697 Manual request
ℹ️ 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 commented Aug 31, 2026

Copy link
Copy Markdown

How this change flows

4 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
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 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.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

@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: 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".

Comment thread crates/tinyagents-session/src/migrations.rs
Comment thread crates/tinyagents-session/src/lib.rs
@senamakel
senamakel merged commit efe6608 into tinyhumansai:main Aug 31, 2026
8 checks passed
@senamakel

Copy link
Copy Markdown
Member Author

@codex review\n\n@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 31, 2026

Copy link
Copy Markdown

@senamakel: I will review pull request #141.

⚠️ Action not completed

Pull request is closed.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Breezy!

Reviewed commit: efe66083ff

ℹ️ 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".

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