Repository navigation
Description
Problem
In a prior run on Docker Agent dev build bbe70f53 (source checked at 80bcd769), 62 sub-session database rows were observed with zero items and $0 recorded cost/usage. Logs reported Failed to persist sub-session with a SQLite UNIQUE constraint error. This is an observation, not a reproduced minimal case, and the full $80 estimated session cost was not independently measured; do not treat that figure as measured loss.
At source revision 80bcd769, SQLiteSessionStore.AddSubSession calls addSessionTx to insert the child row. A plausible diagnosis is that this attempts to insert a session row that already exists, causing the uniqueness failure and transaction rollback. This needs reproduction and confirmation by maintainers.
Related but distinct: #1738 and #2053 concern sub-agent streaming/session-history corruption, not this reported failure to persist child transcript and usage.
Reproduction to investigate
- Run a multi-agent setup that invokes
transfer_taskwith persistent SQLite sessions. - Exercise a child session that already has a persisted row before the parent attempts to add/link it (or otherwise reproduce the duplicate insert path).
- Inspect the resulting child session and persistence error.
Observed exact error class: SQLite UNIQUE constraint while logging Failed to persist sub-session; the specific constraint and a minimal reproducible sequence have not been independently verified. No transcript content, local paths, credentials, or raw logs are included.
Expected
Sub-session persistence should retain the child transcript and cost/usage and associate the child with its parent, without losing data on an insert/link failure.
Actual observation
The observed rows had no persisted items or usage, alongside the logged uniqueness failure.
Environment / limitations
- Docker Agent dev build:
bbe70f53 - Source inspected:
80bcd769 - macOS arm64
- Based on one prior-session observation; exact SQLite constraint and minimal reproduction remain unverified.
Please add a focused store/runtime regression test for an existing child row and verify atomic linking and transcript/usage persistence.
Activity