Profile and settings write ownership across extension-host windows (compare-and-set now, write revision as the end state)
メンテナーはふだん 3 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 20/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- typescript
調査の方向性
Read src/core/config/ProviderSettingsManager.ts, src/core/webview/ClineProvider.ts, and the linked PRs #1560, #1562, and #1565 to understand the current compare-and-set compensation. Step 1 is already implemented; the remaining work is deciding where revisions live, whether stale writes are rejected, and whether the lock spans provider re-entry. Step 2 is done when maintainers resolve those design questions and define revision behavior for existing records.
索引モデルが issue の本文から書いたものです。
説明
Why this issue exists
Twelve CodeRabbit findings across four PRs in the vps2 view-state stack were deferred for the same reason: the stack has no rule for who owns a write to a shared profile record or shared settings record when several extension-host windows (several ClineProvider instances) can write the same key, and whose write is authoritative for another window. They are not twelve independent bugs, so they are tracked here as one decision.
Covered findings (all deferred pending this decision, now unblocked by it):
- PR #1560:
4604037781(src/extension/registerCommands.ts),4604037800(src/core/task/Task.ts),4604037815,4604037826,4604037837(src/core/webview/ClineProvider.ts),4604037875(src/core/webview/webviewMessageHandler.ts),4604037924(src/extension/api.ts) - PR #1562:
4604437290(sibling write during the secondgetProfileawait),4604437299(read/save/read-back/compensation section boundary),4507542567(forward fan-out outside the hold, unordered against a sibling save) - PR #1565:
4604351737,4604351756(rollback record ownership, compensation against a concurrent profile update)
Step 1 - the rule being implemented now (compare-and-set on values)
- R1 Single writer unchanged. Every shared-store mode to profile write still goes through the one writer (
sidebarProvider.setModeConfigintoProviderSettingsManager.setModeConfig). Compensation must not bypass it, and no second write path may be introduced. - R2 Snapshot fidelity. Before any mutation set that compensation may undo, record per key the target layer and that layer's pre-write value. A window-local map write must never borrow the manager's value as its snapshot. This is the same bug class as the round-2 fix on #1565, where the rollback rewound a window-local mapping from the manager's snapshot.
- R3 Compare-and-set restore. On compensation, re-read the same layer and restore a key only when the current value still equals the recorded pre-write value:
===for strings,deepEqualfromfast-deep-equalfor records (already the repo's helper -src/core/config/ProviderSettingsManager.ts:3,src/core/webview/ClineProvider.ts:11,src/core/task-persistence/taskStoreConcurrency.ts:1, with the write-before-compare precedent atProviderSettingsManager.ts:909-910). If the value differs, another window wrote after us: skip that key, keep the rest of the compensation, and log it. If the re-read throws, treat the state as unconfirmed and do not write blind. - R4 Failure semantics must not regress. A rejected or failed store write still drops the window-local pin, still posts state, and the error is logged rather than propagated past the section boundary.
- R5 Known weakness, stated rather than hidden. Value equality cannot distinguish "wrote X" from "wrote X again". If another window rewrites the identical value, our compensation may clear that key; the outcome is still the same value, so this is acceptable for step 1. Removing the ambiguity is the job of step 2.
Step 2 - agreed end state (record-level write revision)
Give each shared record a monotonic write revision, and make compensation and fan-out compare revisions instead of values: a writer captures the revision it read, and a compensation or a forwarded fan-out applies only while the record's revision still matches. That makes "wrote the same value twice" distinguishable, removes the R5 weakness, and replaces per-key value comparisons with one integer check.
Open questions for maintainers before step 2 is scheduled:
- Where should the revision live - inside each profile record, or as a side map in the persisted store? Existing persisted state has no revision field, so a default must be defined for records written before the change.
- Should
ProviderSettingsManagerreject a stale write (a real compare-and-set at the datastore layer), or only expose the revision so callers decide? Rejecting is stronger but changes the manager contract for every caller. - Does
4604437299want the cross-instance lock to span provider re-entry after all, or should the section boundary stay as it is and rely on revisions? This issue assumes the current design (no lock across re-entry) stays.
Where step 1 is implemented
PRs #1560, #1562 and #1565 each carry their own commits for this rule and link back here. Per the stack's collision rule, no shared helper module is created for it - each PR inlines what it needs in files it already touches, so three lanes do not collide on identical new paths.
- 主要言語
- TypeScript
- スター
- 2k
- フォーク
- 301
- 平均マージ
- 3日 14時間
- マージ済み PR(30日)
- 103
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
Zoo-Code-Org/Zoo-Code のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
Zoo-Code-Org/Zoo-Code#2773 · コメント 1 件 ·
メンテナーはふだん 3 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
Zoo-Code-Org/Zoo-Code#2717 · コメント 1 件 ·
メンテナーはふだん 3 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
Zoo-Code-Org/Zoo-Code#2515 ·
メンテナーはふだん 3 日以内に返信
-
fix(scripts): stryker-diff.mjs spawns the extensionless .bin shim and cannot run on Windows対応中かも @easonLiangWorldedtech が 15 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
Zoo-Code-Org/Zoo-Code#2514 ·
メンテナーはふだん 3 日以内に返信
-
[BUG] search_files hides matching text on long lines対応中かも @DananjayaNadun が 9 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
Zoo-Code-Org/Zoo-Code#2496 · コメント 1 件 · 担当者 1 名 ·
メンテナーはふだん 3 日以内に返信
Zoo-Code-Org/Zoo-Code の issue をすべて見る
似ている issue
-
needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
EPPIcenter/sampledb3#162 ·
-
Particle-1 modelオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
tashfeenahmed/freellmapi#2169 ·
メンテナーはふだん 1 日以内に返信
-
via-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 79/100
メンテナーはふだん 1 日以内に返信
-
🎙️ task - feat(mechanic): pave git.pull.close, a close of a superseded pull with its why on recordオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
ehmpathy/rhachet-roles-ehmpathy#1576 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
vercel-labs/ui#1563 ·
メンテナーはふだん 1 日以内に返信