fix(gateway): backfill missing assistant transcript rows#43853
fix(gateway): backfill missing assistant transcript rows#43853rungmc357 wants to merge 1 commit into
Conversation
|
Verification review — reviewed the full diff (2 files, +157/-1). Clean port of the EXDEV/EBUSY fallback from gemini-cli#21541:
No issues found. Clean utility fix. |
|
Verification review — reviewed the full diff (2 files, +160/-0). The assistant transcript backfill guard is well-scoped:
No issues found. Clean gateway resilience fix. |
Summary
state.dbwhen agent-side DB flush misses itWhy
A gateway turn can persist the inbound user message early, return/send a visible assistant response, but skip DB fallback writes because
SessionDBexists. If the assistant row is missing from SQLite, the next gateway replay can look like a long user-only backlog, causing the agent to treat already answered messages as unresolved.This restores the invariant: if the gateway visibly sends an assistant response, replay history must contain an assistant row for that response.
Closes #43849
Test Plan
python -m pytest -q -o addopts='' tests/gateway/test_gateway_assistant_persistence.pypython -m pytest -q -o addopts='' tests/gateway/test_gateway_assistant_persistence.py tests/run_agent/test_860_dedup.py tests/gateway/test_telegram_group_gating.py