refactor: unify oper transaction dispatch

This commit is contained in:
jxxghp
2026-08-24 00:04:35 +08:00
parent e9a226af02
commit 25ad924aac
5 changed files with 26 additions and 11 deletions
@@ -366,7 +366,8 @@ def test_agenttask_oper_reads_with_explicit_session(db, monkeypatch):
task_id = AgentTask.add_task(db.session, **_task("canonical", user_id="alice"))
monkeypatch.setattr(
"app.db.oper.agenttask.run_sync_transaction",
db_base,
"run_sync_transaction",
lambda _query: pytest.fail("显式 Session 查询不应创建兼容事务"),
)