Files
qwen-code/packages
jinyeandClaude Opus 5.5 51bf9c3666 perf(managed-agent): take session commands off the tenant lock (#16225)
* perf(managed-agent): take session commands off the tenant lock

Fourteen Session commands no longer take the tenant placement guard:
rename delivery claim, settle, abandon and retry; session mutation and
parked rename settlement; cwd change completion; model and approval
changes; context compression; task cancel; action response admission;
and MCP and extension management checks.

Each starts with a locking read of its Session row or root, uses a
Session-scoped idempotency key or settles an existing row, checks the
storage fence before creating work migration counts, and takes no
guard later in its transaction. Rename and mutation admission (tenant
scoped keys), Session creation and lifecycle keep the guard.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* perf(managed-agent): take rename and mutation admission off the tenant lock

Rename and session mutation keys are tenant-scoped, so the tenant guard
was what serialized two Sessions reusing one key. Admission no longer
takes the guard: the receipt's unique key decides that race. A
DuplicateKeyException on the receipt insert re-reads the winner with a
locking read and answers idempotency_conflict for another Session or
digest, as the serialized path did.

The mutation replay probe becomes a nonlocking read for every kind, so
admissions of different keys no longer gap-lock the tenant-shared
receipt index and deadlock on insert without the guard.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* codex: address PR review feedback (#16225)

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
2026-11-04 10:29:48 +08:00
..