Skip to content

fix(sdk): separate delivered stream cursors from watermarks - #4489

Open
ScriptedAlchemy wants to merge 4 commits into
fix/lsp-retained-diagnostic-snapshotsfrom
fix/sdk-delivered-stream-cursors
Open

ScriptedAlchemy wants to merge 4 commits into
fix/lsp-retained-diagnostic-snapshotsfrom
fix/sdk-delivered-stream-cursors

Conversation

@ScriptedAlchemy

@ScriptedAlchemy ScriptedAlchemy commented Oct 24, 2026 •

Copy link
Copy Markdown
Owner

Merge #4478 first, followed by #4526, #4510, #4524, #4489, #4485, #4527, #4528, #4530, #4531, #4529, #4534, and #4541.

This PR is number 5 of 13, based on #4524. Merge #4485 next.

#4488 has already merged into this branch.

Use merge commits. After merging a parent PR, change its child's base to master before merging the child. Auto-merge is disabled.

The SDKs treated the opening frame's publication watermark as the subscriber's delivered cursor. Rust rejected retained history, and TypeScript could skip it after a disconnect that followed only an opening frame. Rust advanced only one sequence after a gap containing several events. Both clients also mishandled replay from one sequence beyond the terminal event.

Both SDKs now track one delivery cursor, starting at the caller's requested sequence or zero. Opening a stream refreshes resume authority without advancing delivery. A validated gap advances the cursor through the full gap. A repeated terminal receipt is delivered once before the stream ends.

The clients reject inconsistent frontier and gap ranges and noncontiguous events. Retry behavior, terminal-receipt validation, correlation, and response-body disposal remain unchanged.

The change updates both installed-package conformance tests and documents manual resume. New transport regressions and production-authority HTTP tests cover live Accepted at sequence zero, completed replay, disconnects after only an opening frame, previously delivered items, retained-history gaps, and terminal replay. The HTTP tests connect OperationEventAuthority through the SSE adapter and HTTP to the Rust SDK. The extension bundle is regenerated through its build script.

The branch also includes project discovery from #4488. The ChatGPT extension can search registered projects beyond the ten recent projects. It preserves completeness metadata, cancels replaced requests, and rejects stale responses without losing the selected project or keyboard focus.

Closes #4405.

Validation

Canonical Bazel validation on the integrated parent tree (390bc3fa146a6cf8ba82482e4f2d2ed2bf886369):

  • Frozen pnpm install, own TypeScript SDK build, and maintained check:embedded passed; embedded artifacts are current with no tracked drift.
  • TypeScript SDK: 111 passed; extension adapter/discovery/picker: 38 passed; bridge lifecycle: 10 passed. Both SDK and extension typechecks passed. Fresh invocation 5843cbf8-fc9b-4ddf-9f7f-e1be39b128d3.
  • Rust SDK client::: 31 passed, 0 failed, 18 filtered; nonzero helper passed. Fresh invocation e02281de-2948-419a-8f46-2fc14ae78d61.

These results use the pinned nightly and Ubuntu-main remote runners with normal build caching and fresh test execution. No budgets, deadlines, or resource settings changed. Historical interrupted SDK attempts are not counted as test evidence.

  • Exact real-authority reconnect HTTP journey: 1 passed, 140 filtered; 3b0decb9-a017-4a27-973a-98fb162a3212.
  • Exact live Accepted-zero HTTP journey: 1 passed, 140 filtered; e5df7add-5104-4f73-b6ed-56f6e111ef0e.
  • Both exact runs passed the one-test anti-vacuity helper.

Parent integration uses a merge commit and preserves both the cursor patch and merged project-discovery changes.

Follow-up fleet failure verification

The older d7a3a91 fleet run failed the configuration acceptance fixture at code-index readiness (code_index_convergence_parked), before configuration-write assertions, and timed out the refresh-memory journey. On current d7857c6, which includes the publication-cancellation correction, the exact runtime_surface_acceptance::mcp_configuration_write_persists_and_rejects_stale_cas passed: 1 passed, 0 failed, 140 filtered, 1.68s; invocation b6be3e65-154a-409d-82ff-a72ea1fb1350. Fresh final head guard matched and checkout stayed clean. No additional source edits. The memory journey separately passed unchanged on corrected parent #4510 in 157.87s (fc944727-2cd0-4620-b7bc-86cea6ea5047); that is parent-head evidence, not a new #4489 execution or a confirmed explanation of the CI timeout.

@changeset-bot

changeset-bot Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: a93d14a

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@ScriptedAlchemy
ScriptedAlchemy enabled auto-merge (squash) October 24, 2026 04:48
@ScriptedAlchemy
ScriptedAlchemy enabled auto-merge (squash) October 24, 2026 05:53
@ScriptedAlchemy
ScriptedAlchemy force-pushed the fix/sdk-delivered-stream-cursors branch from aa03923 to cb46ab9 Compare October 24, 2026 15:06
@ScriptedAlchemy
ScriptedAlchemy force-pushed the fix/sdk-delivered-stream-cursors branch 2 times, most recently from 09c5eac to 62dff6d Compare October 24, 2026 23:29
@ScriptedAlchemy
ScriptedAlchemy changed the base branch from master to fix/lsp-retained-diagnostic-snapshots October 25, 2026 01:30

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

@ScriptedAlchemy
ScriptedAlchemy force-pushed the fix/sdk-delivered-stream-cursors branch from 09fa496 to 1940dd9 Compare October 26, 2026 05:37
ScriptedAlchemy and others added 2 commits October 26, 2026 07:15
* fix(extension): discover projects beyond the recent list

* fix(extension): preserve project picker button focus

* fix(extension): preserve runfile paths in DOM tests

* build(plugin): regenerate chatgpt embed from built TypeScript SDK
@ScriptedAlchemy
ScriptedAlchemy force-pushed the fix/sdk-delivered-stream-cursors branch from 1940dd9 to 1af8253 Compare October 26, 2026 07:15
…ream-cursors

Carry the deterministic crash-recovery maintenance check through the existing PR stack.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(sdk): separate delivered stream cursors from server publication watermarks

1 participant