Repository navigation
PR6a: Renew Shell and Playground sign-in without interruption - #1133
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Pre-review F1 fixed. Successful Shell and Playground sign-in accepts the confirmed post-sign-in epoch and still rejects superseded actions. No command is replayed. Fix commit. |
|
Pre-review F2 fixed. An explicit Playground re-pick unblocks the next deliberate Run for that document, without interrupting another document. Fix commit. |
|
Pre-review F3 fixed. A healthy Shell keeps its session state across host-only invalidation, including an unchanged save. Fix commit. |
|
Pre-review F4 fixed. An obsolete relay on an attached worker cancels the operation and discards that worker without publishing the old token or diagnostics. Fix commit. |
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved critical defects allow token requests through changed authorities and Playground account switches without re-picking after Save As or failed startup.
8 open issues
Reject cloud or authority drift during relay authentication · New Persist learned account binding before propagating startup failure · New Preserve learned account binding when Save As moves the connection · New Include destination metadata on every execution · New Report explicit recovery with its own telemetry context · New Allow validated recovered identity through host startup guards · New Check environment changes even when session lookup fails · New Preserve actionable host configuration errors · New
What changed in this PR
Extends the connection-lifecycle work in #1130 to Shell and Query Playground workers, supporting same-account Microsoft Entra renewal and explicit recovery without closing the surface or automatically replaying interrupted commands.
Changes:
- Centralizes worker token renewal with pinned identities, destination checks, and lifecycle safeguards.
- Adds non-modal Sign in again actions and controlled replacement of failed workers.
- Adds document-level Playground bindings, regression coverage, and implementation-review records.
The PR reports Case 1 build and 534 focused tests passed. Full Case 2 checks, including prettier-fix, remain deferred until the draft is ready for review.
| File | Description |
|---|---|
src/documentdb/shell/ShellSessionManager.ts |
Adds pinned renewal and recovery safeguards. |
src/documentdb/shell/ShellSessionManager.test.ts |
Covers renewal, respawn, and invalidation. |
src/documentdb/shell/DocumentDBShellPty.ts |
Adds actionable Shell sign-in recovery. |
src/documentdb/shell/DocumentDBShellPty.test.ts |
Tests non-modal recovery and stale actions. |
src/documentdb/playground/workerTypes.ts |
Defines bounded authentication failure messages. |
src/documentdb/playground/WorkerSessionManager.ts |
Supervises failed workers and invalidated requests. |
src/documentdb/playground/WorkerSessionManager.test.ts |
Covers error reconstruction and lifecycle cancellation. |
src/documentdb/playground/types.ts |
Adds document identity and replacement bindings. |
src/documentdb/playground/playgroundWorker.ts |
Preserves callback failures across worker boundaries. |
src/documentdb/playground/playgroundWorker.test.ts |
Tests authentication failures during startup and execution. |
src/documentdb/playground/PlaygroundService.ts |
Captures host and worker document bindings. |
src/documentdb/playground/PlaygroundService.test.ts |
Tests binding capture and explicit re-picks. |
src/documentdb/playground/PlaygroundEvaluator.ts |
Enforces pinned execution and controlled worker replacement. |
src/documentdb/playground/PlaygroundEvaluator.test.ts |
Covers identity checks and recovery without replay. |
src/documentdb/ClustersClient.ts |
Computes fingerprints from current credentials. |
src/documentdb/ClustersClient.test.ts |
Tests password-free, identity-qualified fingerprints. |
src/documentdb/auth/WorkerTokenRelay.ts |
Shares host-side token acquisition between workers. |
src/commands/signInAgain/signInAgain.ts |
Adds same-account worker recovery entry points. |
src/commands/signInAgain/signInAgain.test.ts |
Tests account rejection and worker-only recovery. |
src/commands/playground/newPlayground.ts |
Captures host bindings for new documents. |
src/commands/playground/executePlaygroundCode.ts |
Displays bounded failures and offers recovery. |
src/commands/playground/executePlaygroundCode.test.ts |
Tests recovery ownership and result preservation. |
src/commands/playground/connectDatabase.ts |
Captures bindings after explicit connection selection. |
docs/ai-and-plans/features/connection-lifecycle/iterations/01-pr6a-worker-token-relays-review.md |
Records pre-review findings, decisions, and validation. |
docs/ai-and-plans/features/connection-lifecycle/iterations/01-dev-plan.md |
Updates relay implementation and live-validation status. |
Review effort: Max
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Addresses Copilot review comment 4704909901. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Addresses Copilot review comment 4704909945. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
✅ CI passed: standard tier (ready PR)Commit
Full run: add the Code quality
Build sizeNo size data for Artifacts: VSIX | Bundle-reports-45809885922 | L1-manifest-report-45809885922 All graphs (exact bytes)
Packaged bytes. Shared chunks count in every graph that loads them, so rows do not add up. Updated in place on every run. |
724127d
into
feature/connection-lifecycle


What changed
Shell and Query Playground can renew Microsoft Entra tokens silently with the account that opened them. When that account needs attention, Sign in again is an explicit, non-modal action. It keeps the terminal or query open, does not switch accounts, and does not rerun the interrupted command.
Why
The deferred WI-2 closes the renewal gap between the extension and its isolated workers. Keeping the worker bound to its original identity avoids silently treating a saved edit or a different account as a reconnect. As in the approved WI-2 plan, new, user-initiated sessions without a verified account may authenticate on their first relay; an existing pinned session never prompts from a relay (A1).
Scope
Based on
feature/connection-lifecycleafter #1130 merged: WI-4 supplies the verified identity and WI-7 supplies the disconnect latch (OP-5 cleared). Saved-edit retirement remains unchanged for open webviews. The worker relay is delivered intact, with a separate Playground sign-in event; renewal metrics and the user manual are in PR7.Validation
f5b79a3e9.Part of #1102. See the WI-2 plan.