Repository navigation
Conversation
A prompt turn saves an in-memory session copy read at turn start, so trust
revocations, preference changes, todo edits, plan summaries, and work-item
imports made while it ran were silently reverted when it finished. Todo
and plan commands also took the turn lock and failed after ~10s whenever
a turn was running.
- Add a ConcurrencySafeSessionStore decorator and SessionUpdateScope:
out-of-turn writers run under a short per-session snapshot lock and
record the keys they change as {start, latest}; every other save takes
the same lock and carries those edits forward into stale copies while
keeping deliberate newer changes.
- The turn resets the overlay before its in-lock re-read and after its
final save, and now persists primary-mode/approval preferences inside
the turn lock on the fresh snapshot.
- SessionPreferenceService, WorkItemService, TodoService and
PlanWorkflowService use the scope instead of the turn lock.
- Session bundle export skips lock and overlay files.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011cFNZGvspeLaq3753UM5NR
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011cFNZGvspeLaq3753UM5NR
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011cFNZGvspeLaq3753UM5NR
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011cFNZGvspeLaq3753UM5NR
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011cFNZGvspeLaq3753UM5NR
|
Entire Gates is failing on one gate only: Approvals ("No reviewers have approved this trail"). The Checks, Findings and Up-to-date gates all pass, and the GitHub Actions CI is green. A human reviewer has to approve, so no code change can fix this gate. Generated by Claude Code |
…uqka3b-session-concurrency # Conflicts: # src/SharpClaw.Code.Runtime/Orchestration/ConversationRuntime.cs
…uqka3b-session-concurrency
Summary
A prompt turn saves an in-memory copy of the session that it read when it started. Edits made while it ran were silently reverted when it finished. Affected edits:
permissions revoke-trust(a revoked plugin became trusted again)todo add/update/removework importSeparately, todo and plan commands took the turn lock. They therefore failed after about 10 s whenever a turn was running.
Approach
ConcurrencySafeSessionStore(inSessions/Concurrency) wrapsHostAwareSessionStore, so it covers both file and SQLite stores.ISessionUpdateCoordinator.RunAsync. It holds a short per-session snapshot lock and records each metadata key (and the title) changed, as{ start, latest }.ConversationRuntimeresets the overlay before its in-lock re-read and again after its final save. Its primary-mode and approval-settings saves now run inside the turn lock, on the fresh snapshot; before, they ran before the lock was taken.SessionPreferenceService,WorkItemService,TodoServiceandPlanWorkflowServicenow use the scope instead of the turn lock. The new constructor parameters are optional, so existing direct constructions keep working..turn.lockcould previously make the export fail.Validation
dotnet build SharpClawCode.sln --configuration Release --warnaserrordotnet test SharpClawCode.sln --configuration Release(unit 355, parity 20, integration 136; all passing)New tests:
ConcurrencySafeSessionStoreTests: a stale save carries the edit forward; a deliberate newer change wins; removed keys and title changes are carried; reset starts a new window.Risk and compatibility
.snapshot.lockand.metadata-overlay.json.Each session save now takes a short file lock. One limitation: a stale writer that deliberately sets a key back to its exact pre-edit value cannot be told apart from a stale copy, so the concurrent edit wins.
Generated by Claude Code