Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
2bd9d95
refactor(session): simplify transcript history handling
senamakel Oct 15, 2026
4469f66
refactor(session): extract transcript history helpers
senamakel Oct 15, 2026
4d3949f
feat(session): adopt existing agent transcripts into sessions
senamakel Oct 15, 2026
7a2a7ad
refactor(session): simplify transcript entry handling
senamakel Oct 15, 2026
a6541c0
chore: The diff for this file is empty, so there is no change to desc…
senamakel Oct 15, 2026
636ac4c
fix(session): release turn lock when background task is cancelled
senamakel Oct 15, 2026
4a40fcd
refactor(session): simplify background transcript handling
senamakel Oct 15, 2026
ee0601c
feat(session): track spend in transcript
senamakel Oct 15, 2026
b788e9b
fix(session): count cache read and write tokens in spend totals
senamakel Oct 15, 2026
04fde53
feat(transcript): add cached view projection for transcript rendering
senamakel Oct 15, 2026
d4a78b5
feat(session): add transcript history and projection views
senamakel Oct 15, 2026
7b82e0b
refactor(transcript): split transcript module into submodules
senamakel Oct 15, 2026
5bd6521
chore(transcript): narrow imports to what each module uses
senamakel Oct 15, 2026
c30f30b
feat(session): add transcript path helpers
senamakel Oct 15, 2026
218b5e3
test(session): cover transcript edge cases
senamakel Oct 15, 2026
9cfbbd9
test(session): add locator and view shim tests
senamakel Oct 15, 2026
9268eb4
chore: files changed crates/tinyagents-session/src/transcript.rs,crat…
senamakel Oct 15, 2026
2345509
test(session): add spend tracking and locator transcript tests
senamakel Oct 15, 2026
a5a7681
test(transcript): add imports for spend cost tests
senamakel Oct 15, 2026
42feae5
refactor(transcript): extract history helpers into dedicated module
senamakel Oct 15, 2026
0fd2d7d
test(session): add turn lock transcript tests
senamakel Oct 15, 2026
411413c
test(session): add tests for turn state mirror
senamakel Oct 15, 2026
7d3135a
refactor(session): move port tests into a dedicated module
senamakel Oct 15, 2026
8c5e570
test(session): cover legacy transcript rewrite paths
senamakel Oct 15, 2026
61aff8e
test(transcript): port background append tests to in-memory locator
senamakel Oct 15, 2026
437e492
feat(session): add background task tracking to transcripts
senamakel Oct 15, 2026
01d6214
refactor(transcript): drop unused test-only writer helper
senamakel Oct 15, 2026
ebeef1d
test(session): exercise transcript tests against the driver store
senamakel Oct 15, 2026
62e2fd1
test(session): cover legacy transcript rewrite and spend tracking
senamakel Oct 15, 2026
548b8ea
fix(session): repair unindexed transcripts before thread listing
senamakel Oct 15, 2026
9579f21
test(runtime): cover session persistence round trips
senamakel Oct 15, 2026
b8f5520
chore(runtime): add test store module
senamakel Oct 15, 2026
8f20fb9
feat(runtime): add in-memory test store
senamakel Oct 15, 2026
10a0f59
test(runtime): cover prefix refresh against the test store
senamakel Oct 15, 2026
11d12fe
refactor(tinyagents-runtime): move runtime tests into lib_tests module
senamakel Oct 15, 2026
e9b75f4
refactor(tinyagents-runtime): move runtime tests into lib_tests module
senamakel Oct 15, 2026
43e3aeb
test(runtime): add coverage for runtime store helpers
senamakel Oct 15, 2026
2d5f6dc
chore(tinyagents-runtime): add tests for runtime lib
senamakel Oct 15, 2026
af4e785
refactor(tinyagents-runtime): move runtime tests into lib_tests module
senamakel Oct 15, 2026
cc3f24e
feat(runtime): add in-memory test store for runtime tests
senamakel Oct 15, 2026
c0d4005
chore(deps): update Cargo.lock
senamakel Oct 15, 2026
4c6ffe7
chore(tinyagents-runtime): add tests for runtime lib
senamakel Oct 15, 2026
e1aed66
test(runtime): add coverage for runtime store helpers
senamakel Oct 15, 2026
a25eaad
refactor(tinyagents-runtime): rename prefix refresh test module
senamakel Oct 15, 2026
c6c5dc3
chore: I don't see an actual diff in your message — the "Diff:" secti…
senamakel Oct 15, 2026
7904526
test(session): cover driver-backed transcript history
senamakel Oct 15, 2026
5826dc9
test: drop unused TranscriptLocator imports
senamakel Oct 15, 2026
79ddea1
style: apply rustfmt formatting across session and runtime crates
senamakel Oct 15, 2026
0d4445b
chore(tinyagents-session): add crate manifest
senamakel Oct 15, 2026
0dbc961
refactor(session): extract transcript entry rendering into helpers
senamakel Oct 15, 2026
1e2a5b9
feat(session): add in-memory transcript testkit
senamakel Oct 15, 2026
8edec61
feat(session): add transcript locator parity tests
senamakel Oct 15, 2026
f9fbd9e
docs(transcript): document transcript and view modules
senamakel Oct 15, 2026
f3c94e3
docs(session): add README for tinyagents-session crate
senamakel Oct 15, 2026
797df08
docs: update transcript persistence and store port docs
senamakel Oct 15, 2026
7c44f26
docs(changelog): document removal of path-based transcript API
senamakel Oct 15, 2026
3413d2d
feat(ci): add script to compute next release version
senamakel Oct 15, 2026
b0119db
ci: run release version script tests in CI
senamakel Oct 15, 2026
cae55ae
ci(release): capture version script output before reading
senamakel Oct 15, 2026
e67446b
chore(deps): drop unused chrono dependency from integration tests
senamakel Oct 15, 2026
92495e3
chore(session): silence dead code warnings without legacy-import
senamakel Oct 15, 2026
c517f38
build(tinyagents-session): add self dev-dependency for legacy import
senamakel Oct 15, 2026
42fdeeb
fix: reject leading-zero release tags and correct stale transcript docs
senamakel Oct 15, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions .github/scripts/next-release-version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
#!/usr/bin/env bash
# Computes the next release version for the Release workflow.
#
# usage: next-release-version.sh <patch|minor|major> <workspace-version> [tag ...]
#
# The base is the highest of the workspace version and every plain `vX.Y.Z`
# tag given. The workspace version alone is not a safe base: releases are
# published from a tag, and the version in Cargo.toml can lag the latest tag
# (it sat at 2.1.4 while v2.2.0 through v2.8.0 existed, so the workflow kept
# proposing a tag that was already taken). Prints `<base> <next>`.
set -euo pipefail

bump="${1:?bump (patch|minor|major) required}"
workspace_version="${2:?workspace version required}"
shift 2

semver='^(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)$'
if ! [[ "$workspace_version" =~ $semver ]]; then
echo "Workspace version '${workspace_version}' is not X.Y.Z" >&2
exit 1
fi

base="$workspace_version"
for tag in "$@"; do
version="${tag#v}"
# Pre-release and other non-release tags never set the base.
if [[ "$tag" == v* && "$version" =~ $semver ]]; then
base="$(printf '%s\n%s\n' "$base" "$version" | sort -V | tail -n1)"
fi
done

IFS=. read -r major minor patch <<< "$base"
case "$bump" in
major)
major=$((major + 1))
minor=0
patch=0
;;
minor)
minor=$((minor + 1))
patch=0
;;
patch)
patch=$((patch + 1))
;;
*)
echo "Unsupported bump: ${bump}" >&2
exit 1
;;
esac

echo "${base} ${major}.${minor}.${patch}"
40 changes: 40 additions & 0 deletions .github/scripts/next-release-version.test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/usr/bin/env bash
# Tests for next-release-version.sh. Run: .github/scripts/next-release-version.test.sh
set -euo pipefail

script="$(cd "$(dirname "$0")" && pwd)/next-release-version.sh"
failures=0

expect() {
local name="$1" want="$2"
shift 2
local got
if got="$("$script" "$@" 2>/dev/null)"; then :; else got="error"; fi
if [[ "$got" != "$want" ]]; then
echo "FAIL ${name}: want '${want}', got '${got}'" >&2
failures=$((failures + 1))
fi
}

# The regression: a stale workspace version must not hide newer tags.
expect "stale workspace minor" "2.8.0 2.9.0" minor 2.1.4 v2.1.4 v2.2.0 v2.7.0 v2.8.0
expect "stale workspace patch" "2.8.0 2.8.1" patch 2.1.4 v2.8.0 v2.2.0
expect "stale workspace major" "2.8.0 3.0.0" major 2.1.4 v2.8.0
# Numeric, not lexical, ordering.
expect "numeric ordering" "2.10.0 2.11.0" minor 2.1.4 v2.9.0 v2.10.0
# A workspace version ahead of every tag still wins.
expect "workspace ahead" "3.0.0 3.1.0" minor 3.0.0 v2.8.0
expect "no tags" "2.1.4 2.1.5" patch 2.1.4
# Pre-release and foreign tags never set the base.
expect "prerelease ignored" "2.8.0 2.9.0" minor 2.1.4 v2.8.0 v3.0.0-rc1 nightly 9.9.9
# A leading-zero tag is not a release version (08 would be octal).
expect "leading zero ignored" "2.8.0 2.9.0" minor 2.1.4 v2.8.0 v2.08.0
# Bad input fails.
expect "bad bump" "error" hotfix 2.1.4
expect "bad workspace version" "error" minor 2.1 v2.8.0

if ((failures > 0)); then
echo "${failures} failure(s)" >&2
exit 1
fi
echo "next-release-version: ok"
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ jobs:
- name: Check formatting
run: cargo fmt --all -- --check

- name: Release version script
run: .github/scripts/next-release-version.test.sh

- name: Clippy
run: cargo clippy --workspace --all-targets -- -D warnings

Expand Down
30 changes: 8 additions & 22 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,37 +85,23 @@ jobs:
exit 1
fi

IFS=. read -r major minor patch <<< "$current_version"
case "${{ inputs.bump }}" in
major)
major=$((major + 1))
minor=0
patch=0
;;
minor)
minor=$((minor + 1))
patch=0
;;
patch)
patch=$((patch + 1))
;;
*)
echo "Unsupported bump: ${{ inputs.bump }}" >&2
exit 1
;;
esac

next_version="${major}.${minor}.${patch}"
# The workspace version can lag the latest tag (releases are cut
# from tags), so the next version is derived from the highest of
# the two; see the script.
git fetch --tags origin
mapfile -t existing_tags < <(git tag --list 'v*')
versions="$(.github/scripts/next-release-version.sh "${{ inputs.bump }}" "$current_version" "${existing_tags[@]}")"
read -r base_version next_version <<< "$versions"
tag="v${next_version}"

git fetch --tags origin
if git rev-parse --verify --quiet "refs/tags/${tag}"; then
echo "Tag ${tag} already exists" >&2
exit 1
fi

{
echo "current_version=${current_version}"
echo "base_version=${base_version}"
echo "next_version=${next_version}"
echo "tag=${tag}"
} >> "$GITHUB_OUTPUT"
Expand Down
53 changes: 51 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,55 @@
# Changelog

## Unreleased: the path-based transcript API is removed (tinyagents#453)

**Breaking.** `tinyagents-session` no longer reads or writes a workspace
directory for transcripts. Everything goes through the store port
(`TranscriptLocator`/`TranscriptHistory`/`TranscriptRead`, served by
`DriverSessionStores`, `WorkspaceStores` or `InMemorySessionStores`); the only
reader of classic `session_raw/*.jsonl` files is the one-time, read-only
`legacy::import_transcripts_once` / `WorkspaceStores`, and
`legacy::rewrite_legacy_transcripts` for pre-import fixups.

Removed from `tinyagents_session::transcript`: `FileTranscriptLocator`,
`FileTranscriptHistory`, `AgentTranscriptFiles`, `agent_transcript_root`,
`write_transcript*`, `append_transcript_turn*`, `append_interrupted_partial`,
`append_tools_record`, `read_transcript`, `read_transcript_display`,
`read_transcript_legacy_md`, `adopt_legacy_session_transcripts`,
`migrate_layout_if_needed`, `find_latest_transcript`,
`find_root_transcript_for_thread*`, `find_root_transcripts_for_thread`,
`read_thread_usage_summary` (and `ThreadUsageSummary`/`SubagentArchetypeUsage`),
`resolve_keyed_transcript_path*`, `append_background_message` and its
lock-notification variant, `TranscriptLocator::file_backing`, `view::get_page`,
`view::get_page_scoped`, `view::project_thread*`, `view::resolve_files_scoped`,
the view's projection cache, and `thread_spend`. Replacements:
`append_background_message_in`, `view::get_page_in`,
`view::project_thread_in(locator, thread_id, agent_id, lookup)`,
`spend::thread_spend_in`, `TranscriptLocator::thread_transcripts` /
`root_for_thread_scoped` / `read_session_transcript`, and
`TranscriptLocator::adopt_legacy` (driver stores).
`SessionAdoption`, `SessionTurnGuard`, `lock_session_turn` and the rest of the
locator-based surface are unchanged. The `fs2` dependency is gone.

Fixes (the two deferred tinyagents#463 findings):

- A background append's idempotency check considered every row of the head
generation's log, so a key dropped by a compaction *inside the same
generation* still reported `Duplicate` and the delivery was lost. It now
looks at the generation's live context only (rows after the last compaction
plus that compaction's replacement), which is what the contract always said:
a key a compaction dropped is appended again.
- The driver-backed thread listing read the index alone, so a root whose
index refresh failed stayed invisible until something read or wrote that
transcript again. A listing now compares written index documents with
written transcript logs and re-indexes any missing stem before it answers.
- `legacy::import_transcripts` now carries a classic line's top-level
`background` provenance onto the imported row, so an out-of-band delivery
keeps its origin and idempotency key after import.

The Release workflow derives the next version from the highest of the
workspace version and the latest `v*` tag instead of the (stale) workspace
version alone, so it no longer proposes a tag that already exists.

## Unreleased: locator-based transcript reads and writes (tinyagents#453)

Hosts can now do through a `TranscriptLocator` everything they used the
Expand Down Expand Up @@ -27,8 +77,7 @@ driver store:
- `legacy::rewrite_legacy_transcripts(workspace_dir, rewrite) ->
LegacyRewriteReport` for pre-import fixups of classic `session_raw/` files.

The path API is unchanged; `project_from_files` and `thread_spend` now share
the locator code path.
(The path API was still present at this point and was removed in the entry above.)

Review follow-ups: `rewrite_legacy_transcripts` keeps a transcript's recorded
tool declarations, counts unreadable directories and entries in `errors`
Expand Down
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion crates/tinyagents-integration-tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ publish = false
[dependencies]
anyhow = { workspace = true }
async-trait = { workspace = true }
chrono = { workspace = true }
dotenvy = "0.15"
futures = { workspace = true }
reqwest = { workspace = true }
Expand Down
Loading
Loading