fix(graph): preserve completion-ready runs on lead settlement - #1127
Merged
Conversation
Avoid cancelling Graph runs whose completion gates already passed when the owning Lead turn settles incidentally; resume finalization instead of force-cancel. Co-authored-by: Cursor <cursoragent@cursor.com>
XingYu-Zhong
added a commit
that referenced
this pull request
Aug 7, 2026
* feat(explore_agent): enhance tool descriptions and establish exploration as the first step for repository investigations * feat: implement thread snapshot caching and state management - Added a thread snapshot cache to optimize thread state retrieval and management. - Introduced functions to snapshot thread projections, retrieve snapshots, and invalidate them. - Enhanced thread actions to utilize the new snapshot cache for improved performance. - Updated chat store types to include a loading state for threads. - Added tests for thread snapshot caching behavior and limits. - Introduced new API endpoints for retrieving thread states. - Updated existing actions and tests to accommodate the new snapshot caching mechanism. * feat(chromium-cookies): add cookie reading and decryption functionality for Chromium browsers * feat: add tool cancellation functionality - Implemented `cancelToolCall` function in `turns.ts` to handle tool call cancellations. - Created `ToolCancellationService` to manage cancellation requests and state. - Added new endpoint for tool cancellation in `kun-endpoints.ts`. - Updated IPC schemas to include tool cancellation. - Enhanced the chat store to support tool cancellation actions. - Added UI components for cancelling tool calls in the chat interface. - Updated localization files to include new strings for tool cancellation. - Added tests for `ToolCancellationService` to ensure correct behavior. - Modified state management to handle turn abortion and tool cancellation. * refactor: simplify telemetry pressure management and improve model request handling - Removed the `hydratePromptPressureIfCold` method from `LoopTelemetry` to streamline prompt pressure management. - Updated `HistoryCompactionService` to eliminate unnecessary telemetry calls. - Adjusted `effectiveOutputBudgetTokens` to ensure output capabilities are bounded by context capacity. - Enhanced tests to reflect changes in telemetry and model request behavior. - Modified UI components for better media preview handling and adjusted styles for consistency. - Updated localization strings for clarity in token usage descriptions. - Added new tests to ensure proper handling of compaction markers and model provider presets. * feat: add timing metrics for usage tracking - Implemented timing aggregation for thread-cumulative average time-to-first-token (TTFT) and tokens-per-second (TPS) in UsageCounter. - Updated UsageCounter to handle missing timing fields as null instead of zero. - Enhanced tests for UsageCounter to validate timing aggregation across threads and reset behavior. - Introduced new fields in CoreUsageSnapshotJson for request timing metrics and averages. - Updated mapping functions to pass through timing metrics to the UI. - Added formatting functions for displaying TTFT and TPS in a user-friendly manner. - Enhanced chat projection reducer to manage per-turn timing metrics keyed by turnId. - Updated initial state and types to accommodate new timing metrics. - Added localization strings for new timing metrics in multiple languages. * feat: enhance speech-to-text settings with credential readiness checks and improve provider API key handling * feat: enhance model handling by preventing empty primary model from overwriting current settings * fix(office): soft-fail WPS schema validate on intake Strict OpenXML validation rejected WPS etCustomData attributes on xlsx autoFilter, so drag-drop fell back to a local tool reference. Treat Schema/undeclared vendor attrs as warnings and continue text extraction; keep edit-path validation strict. Fixes #1122 Co-authored-by: Cursor <cursoragent@cursor.com> * fix(providers): keep Token Plan catalog across registry races Fetch/import could stage models before the shared connection existed, so catalog commit failed and SSE projection dropped the local provider back to presets. Connect-then-patch missing connections, retain pending local catalogs during projection, and skip AppSettings writes while a catalog drain is in flight. Fixes #1117 Co-authored-by: Cursor <cursoragent@cursor.com> * fix(runtime): recover shared Kun when discovery PID is dead Detached shared runtimes could leave a stale resolvedConnection after the process exited, so watchdog treated the host as unresponsive and waited through repeated health failures. Clear dead discovery PIDs from the adapter cache and re-check isChildRunning after health probes so recovery takes the missing/ensure path. Fixes #1116 Co-authored-by: Cursor <cursoragent@cursor.com> * feat: implement preserveRedactedProviderCredentials function and add tests for credential preservation * feat: add in-place update handling and cleanup for automatic updates * fix(models-dev-catalog): add MiniMax OpenAI-compatible /v1 endpoint aliases (#1126) Recognize api.minimax.io/v1 and api.minimaxi.com/v1 for regular and Token Plan profiles alongside the existing Anthropic endpoints. Co-authored-by: Cursor <cursoragent@cursor.com> * fix(graph): preserve completion-ready runs on lead settlement (#1127) Avoid cancelling Graph runs whose completion gates already passed when the owning Lead turn settles incidentally; resume finalization instead of force-cancel. Co-authored-by: Cursor <cursoragent@cursor.com> * fix(graph): add thread ownership gate and independent SSE observer (#1128) Keep the 5s durable snapshot fallback, but bind Graph projection atomically per thread and project SSE through an owner-scoped observer so Lead settlement and thread switches cannot paint stale Graph state. Co-authored-by: Cursor <cursoragent@cursor.com> * fix(scripts): ensure proper execution of .cmd scripts on Windows by using cmd.exe shell * fix: normalize Codex responses URL and update related endpoint handling * fix: enhance explore_agent tool provider with dynamic advertising based on Lab settings * fix(cursor): re-expose Kun-exclusive tools and exclude overlapping Cursor built-ins * feat: add explore functionality with new components and tests - Implemented explore-card-copy and explore-peek-summary components for handling explore tasks. - Added utility functions to determine tool types and resolve task titles. - Enhanced message-timeline-process to recognize explore_agent as a subagent. - Updated message-timeline-empty to differentiate between explore and subagent sessions. - Created comprehensive tests for new functionalities to ensure reliability. - Updated localization files to include new strings for explore processes and UI elements. * feat: implement ExplorePeekBody component and related tests; enhance SubagentCallCard with conclusion handling * feat: add explore_agent tool with read-only access; update related tests and documentation * feat: enhance OpenCode Go cookie handling and diagnostics - Introduced support for additional Chromium browsers (Chrome Beta, Chrome Canary, Edge Beta, Edge Canary, Brave Beta, Brave Nightly) in cookie retrieval. - Added a non-sensitive diagnosis type for cookie read operations to distinguish between success, not found, and decryption failures. - Improved cookie header filtering to handle manual Cookie headers and environment variables. - Implemented caching for OpenCode Go cookies with clear and persist functionality. - Enhanced error handling to provide specific messages for Keychain access issues and missing credentials. - Updated tests to cover new cookie handling scenarios and ensure proper functionality across different platforms. * feat: enhance explore_agent handling in tool dispatch policy and message timeline * feat: release v0.2.37 with enhancements to explore_agent, Agent Graph stability, and runtime capabilities - Introduced read-only explore_agent for parallel investigations and improved session presentation. - Enhanced Agent Graph with thread ownership controls and independent SSE observers for better concurrency. - Updated Provider credential handling and model directory stability during concurrent updates. - Added tool cancellation feature and improved usage tracking metrics. - Implemented automatic updates and cleanup for a smoother upgrade process. - Ensured compatibility for Windows script execution and refined document import validation. --------- Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Tests
cd kun && npx vitest run src/server/graph-runtime-factory.test.ts(16 pass)Made with Cursor