Repository navigation
fix(agent): apply only the latest run mode save - #16753
christian-byrne merged 2 commits into
Conversation
🎨 Storybook: 🚧 Building...🎭 Playwright: ✅ 1914 passed, 0 failed · 1 flaky📊 Browser Reports
📦 Bundle: 9.68 MB gzip ⚪ 0 BDetailsSummary
Category Glance App Entry Points — 3.74 kB (baseline 3.74 kB) • ⚪ 0 BMain entry bundles and manifests Status: 1 unchanged Graph Workspace — 1.43 MB (baseline 1.43 MB) • ⚪ 0 BGraph editor runtime, canvas, workflow orchestration Status: 3 unchanged Views & Navigation — 124 kB (baseline 124 kB) • ⚪ 0 BTop-level views, pages, and routed surfaces Status: 17 unchanged Panels & Settings — 621 kB (baseline 621 kB) • ⚪ 0 BConfiguration panels, inspectors, and settings screens Status: 27 unchanged User & Accounts — 27.8 kB (baseline 27.8 kB) • ⚪ 0 BAuthentication, profile, and account management bundles Status: 11 unchanged Editors & Dialogs — 126 kB (baseline 126 kB) • ⚪ 0 BModals, dialogs, drawers, and in-app editors Status: 8 unchanged UI Components — 117 kB (baseline 117 kB) • ⚪ 0 BReusable component library chunks Status: 15 unchanged Data & Services — 3.59 MB (baseline 3.59 MB) • ⚪ 0 BStores, services, APIs, and repositories Status: 16 unchanged Utilities & Hooks — 560 kB (baseline 560 kB) • ⚪ 0 BHelpers, composables, and utility bundles Status: 36 unchanged Vendor & Third-Party — 18.1 MB (baseline 18.1 MB) • ⚪ 0 BExternal libraries and shared vendor chunks Status: 18 unchanged Other — 16.4 MB (baseline 16.4 MB) • ⚪ 0 BBundles that do not match a named category Status: 296 unchanged ⚡ Performance
|
|
Warning Review limit reachedNext included review available in 13 minutes. View limit detailsLimit details: You’ve used all 4 included reviews currently available. Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. Review configuration: ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Team Run ID: 📒 Files selected for processing (1)
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Team Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 10 included reviews per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe store now tracks applied save revisions. It ignores stale asynchronous responses, preserves 404 fallback behavior, and propagates other errors. Tests cover late earlier success and latest-save failure scenarios. ChangesAgent run mode save ordering
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to Concurrent run mode saves now retain the newest applicable result while allowing an earlier successful save to update local state if a later save fails. No current merge-readiness risk remains. Suggested reviewers: Important Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional. ❌ Failed checks (1 inconclusive)
✅ Passed checks (6 passed)
Full details: End-To-End Regression Coverage For FixesExplanation The changed files are available and show changes only under Full details: Adr Compliance For Entity/Litegraph ChangesExplanation The changed files are under ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## main #16753 +/- ##
==========================================
+ Coverage 81.04% 82.61% +1.57%
==========================================
Files 2452 2034 -418
Lines 125794 118321 -7473
Branches 31661 29835 -1826
==========================================
- Hits 101944 97746 -4198
+ Misses 23338 20398 -2940
+ Partials 512 177 -335
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 425 files with indirect coverage changes 🚀 New features to boost your workflow:
|
christian-byrne
left a comment
There was a problem hiding this comment.
Exact-head review of 61acab71c36ac7b6d040554437f45054e849ca7e: no blocking findings. The monotonic applied-revision gate handles both successful PUT responses and 404 local fallbacks, while preserving the latest successful save when a newer request fails. The two overlap tests cover the critical reversed-completion and newer-failure schedules; required checks are green on this head.
| const savedPreference = await api.putRunMode(next) | ||
| const revision = ++saveRevision | ||
| const applySaved = (savedPreference: AgentRunModePreference) => { | ||
| if (revision <= appliedSaveRevision) return |
There was a problem hiding this comment.
This comparison is the key ordering invariant: once revision N applies, every response or 404 fallback from revisions ≤ N becomes a no-op. A newer failed request does not advance appliedSaveRevision, so the latest older successful response can still become the visible preference. Verified against both overlap tests at exact head 61acab71c36ac7b6d040554437f45054e849ca7e.
CodeJuggernaut
left a comment
There was a problem hiding this comment.
Walked the diff and its blast radius against the current head; the one open thread is the author's own note on the ordering invariant, not an objection. Nothing to add.
Summary
Follow-up to #16432.
saveRevisiononly guardedload(); two overlappingsave()calls each applied their own PUT response unconditionally, so the store showed whichever response resolved last rather than the latest save. Each save now captures its own revision and applies only when newer than the last applied save. The 404 fallback goes through the same gate, so an earlier success still applies when a later save fails.Changes
agentRunModeStore.ts: per-save revision,appliedSaveRevisiongate on both the PUT response and the 404 fallback.agentRunModeStore.test.ts: two cases, "keeps the latest save when an earlier PUT resolves last" (fails on main) and "applies an earlier save when the latest one fails".Verification
pnpm test:unit src/workbench/extensions/agent/stores/agent/agentRunModeStore.test.ts(18 pass; the first new case fails without the store change).vue-tsc --noEmitclean; eslint, oxlint, oxfmt clean on both files.