Skip to content

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

Open
ScriptedAlchemy wants to merge 29 commits into
masterfrom
fix/sdk-delivered-stream-cursors
Open

ScriptedAlchemy wants to merge 29 commits into
masterfrom
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.

CI follow-up

The prior Linux fleet job exposed a recovery-test hang and a Codex native-cache activation assertion.

  • Carry the focused worker-recovery repair already validated on chore(deps): update dependency @rsbuild/core to v2.2.14 #4557: a replacement retains its recovery blocker until real progress. The regression coordinates the replacement and shuts down lease-owning workers before assertions, preserving its existing bounds and checks.
  • Align the Codex bootstrap fixture with the canonical profile data directory. Preserve all seven activation assertions and add lazy, bounded failure diagnostics for actual activation predicates, differing file fingerprints, and unexpected discovery entries.
  • The Codex failure's cause remains unproven. These diagnostics and the independent fixture correction require fresh CI evidence; they do not claim a proven production activation fix.

Independent source review, the pinned formatter, diff checks, and maintained commit hooks passed. No new native build ran locally under the workspace's memory and disk constraints. The new head requires hosted CI.

Parent #4524 has merged; this PR now targets master.

Integration with current master

Merged master fea107e80d14031c435e33915bb3e0890cf781c0 into this branch with both histories preserved. The generated server bundle was the sole textual conflict. It was rebuilt through the maintained SDK and ChatGPT extension build against the merged sources. The delivered-cursor and diagnostic-publication repairs remain intact.

All thirteen incoming source/generated-contract files match master's blobs exactly. The merged lockfile preserves master's dependency updates plus this branch's existing jsdom importer. The app bundle remains byte-identical; the server bundle is the verified regenerated output.

SDK build, plugin build, check:embedded, pinned nightly formatting, whitespace checks, normal commit hooks, and independent integration review passed. Full native suites and the new PR head still require hosted CI.

@changeset-bot

changeset-bot Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: d9af32f

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

Transfer completed diagnostic work into bounded session-owned reports so
push publication and repeated pulls share the same admitted evidence.
Fence retained reports to document and scope identity, and retire exact
operations on invalidation without claiming analyzer work has settled.

Keep incomplete results truthful and retryable, and retry publication
only for outbound backpressure rather than duplicate or oversized pushes.

Fixes #4404
@ScriptedAlchemy
ScriptedAlchemy force-pushed the fix/sdk-delivered-stream-cursors branch from 205dc7e to 09c5eac Compare October 24, 2026 19:18
@ScriptedAlchemy
ScriptedAlchemy force-pushed the fix/sdk-delivered-stream-cursors branch from 09c5eac to 62dff6d Compare October 24, 2026 23:29

@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.

Note

Newer findings are available below. Devin Review posted a newer report on this PR, in addition to the findings presented here.

✅ Devin Review: No Issues Found

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

Devin Review

Fleet logs show five complete 48,000-function generations take 53–65 seconds each. The default medium deadline kills the final refresh near 300 seconds despite steady successful publication. Declare the measured aggregate workload through the existing Cargo-to-Bazel size metadata, preserving every refresh, memory bound, and assertion.
@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 4 commits October 26, 2026 07:14
# Conflicts:
#	.github/workflows/ci.yml
* 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
Use the reader lease to fix the interrupted publication point, then track
only its abandoned temporary names through the scheduled cleanup sweep.
Keep the multi-file fixture within one bounded retention pass and derive
the observation window from the actual maintenance retry cadence.
…ream-cursors

Carry the deterministic crash-recovery maintenance check through the existing PR stack.
Keep replacement refresh workers stalled until a pass makes progress, and
synchronize the recovery regression before releasing the blocked retry.
Shut down workers before asserting the observed recovery state.

Align the Codex bootstrap fixture with the canonical profile data directory.
Preserve all native activation checks and add bounded failure diagnostics
for the actual activation stages, file fingerprints, and discovery entries.
The observed Codex activation failure still needs fresh CI evidence.
@ScriptedAlchemy
ScriptedAlchemy changed the base branch from fix/lsp-retained-diagnostic-snapshots to master October 27, 2026 04:08
devin-ai-integration[bot]

This comment was marked as resolved.

ScriptedAlchemy and others added 3 commits October 26, 2026 21:40
Retire queued diagnostic publications alongside retained snapshots when the
workspace authority changes. Preserve the bridge's in-flight frame and release
undelivered publication claims so refreshed reports can be sent.

Verified the exact regression RED/GREEN, all 268 LSP unit tests, and scoped
Clippy and Rustfmt targets.
Integrate current master into the delivered-stream cursor branch. Preserve
both authored source changes and regenerate the committed ChatGPT server
bundle with its maintained build against the merged TypeScript SDK.

The only textual merge conflict is the generated server.mjs output. Retain
master's source blobs and React Query lock entries alongside the branch's
jsdom importer. The cursor and diagnostic publication repairs are unchanged.

Validation: SDK build, plugin build and check:embedded, pinned nightly
2026-10-25 rustfmt, git diff --check, and normal commit hooks pass.
Native Rust suites still require hosted CI.
@ScriptedAlchemy
ScriptedAlchemy enabled auto-merge (squash) October 27, 2026 05:32

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