Fix shared retrieval deadlock, run start time and interrupted-run notice #223

Merged
weichen merged 2 commits from fix/multiuser-project-collab into main 2026-10-20 05:53:11 +00:00
Owner

Why: 8788 multi-user verification found that a project member's shared knowledge retrieval hangs the whole service (SQLite single connection held by an open result set while the authorization callback queries the store), runs report a zero start time, and runs interrupted by a restart leave no visible reply.

Changes:

  • Shared knowledge scans (vector, FTS, LIKE, Postgres) read and close candidate rows before applying authorization callbacks.
  • CreateRun / CreateRunAccountChecked default a zero CreatedAt to now and persist the same value.
  • SealInterrupted writes one assistant message with a run.interrupted error part in the same transaction when the seal wins (no duplicate when an assistant message exists); settle message insertion shared via insertSettledMessageTx.

Evidence: go test ./internal/store ./internal/runmgr -count=1 ok (local, SELF); authority is CI on the PR HEAD.
Impact: Backend store/runmgr only.
Refs: Dev task fix/multiuser-project-collab; agent-exec transport 60f37ad (agy).

Why: 8788 multi-user verification found that a project member's shared knowledge retrieval hangs the whole service (SQLite single connection held by an open result set while the authorization callback queries the store), runs report a zero start time, and runs interrupted by a restart leave no visible reply. Changes: - Shared knowledge scans (vector, FTS, LIKE, Postgres) read and close candidate rows before applying authorization callbacks. - `CreateRun` / `CreateRunAccountChecked` default a zero `CreatedAt` to now and persist the same value. - `SealInterrupted` writes one assistant message with a `run.interrupted` error part in the same transaction when the seal wins (no duplicate when an assistant message exists); settle message insertion shared via `insertSettledMessageTx`. Evidence: `go test ./internal/store ./internal/runmgr -count=1` ok (local, SELF); authority is CI on the PR HEAD. Impact: Backend store/runmgr only. Refs: Dev task fix/multiuser-project-collab; agent-exec transport 60f37ad (agy).
weichen added 1 commit 2026-10-20 03:54:28 +00:00
agent-exec transport 9b5caca2968f510a4f81402ca7dfdb4c/f6d16260d971
governance / governance (pull_request) Successful in 20s
ci / vet-and-test (pull_request) Successful in 1m27s
60f37adc04
weichen added 1 commit 2026-10-20 04:18:08 +00:00
Merge branch 'main' into fix/multiuser-project-collab
governance / governance (pull_request) Successful in 15s
ci / vet-and-test (pull_request) Successful in 1m15s
377e965265
weichen merged commit b5eb89c557 into main 2026-10-20 05:53:11 +00:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: weichen/Agent-System-Backend#223