Repository navigation
chat: project a provisioning cloud sandbox draft into the transcript like the Agents window - #341822
Closed
Osvaldo Ortega (osortega) wants to merge 1 commit into
Conversation
…s window While a cloud sandbox is provisioned on a draft's first send, the editor kept the prompt in the (disabled) input with only a progress row, because the chat model flow has no session until newChatSessionItem returns. The Agents window instead shows the prompt as a request with the preparation steps shimmering underneath, via a view-owned throwaway ChatModel. Do the same in ChatWidget: when a controller publishes preparation for the draft this widget is sending, accept the input, create a read-only projection model that shares the draft's resource (so pickers and session options stay put) with the prompt as its request, and stream the steps as in-transcript progress with Stop wired to cancel. The projection is dropped when the send settles: a sent request hands over to the materialized session as before, a rejected or cancelled one brings the draft back with its prompt and attachments. Preparations this widget did not send still render as a progress row.
Contributor
Author
|
Closing: this reimplemented in the widget what the platform already provides. The Copilot cloud provider handles the first send of a draft through a chat participant on the untitled session (prompt appears immediately, provisioning steps are ordinary response progress) and then commits the session via |
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
Stacked on #341697 (base branch
osortega/cloud-sandbox-transcript-progress), which is stacked on #341695.With #341697, provisioning a cloud sandbox on a draft's first send shows a shimmer progress row in the chat view, but the prompt stays in the (disabled) input until
newChatSessionItemreturns — the chat model flow has no session to put the request in before then. The Agents window feels instant because itsChatViewcreates a view-owned throwawayChatModelwith the prompt as a request and streams the preparation steps underneath (_showPreparationInput). This PR brings that experience to the editor'sChatWidget.Changes (
ChatWidgetonly)_acceptInputrecords the first send of an untitled contributed draft (_trackPendingNewSessionSend: prompt, parsed request, attachments, mode, history/focus options) aroundchatService.sendRequest.IChatSessionsService.onDidChangeNewSessionPreparationnow calls_renderNewSessionPreparation. When a preparation appears for the draft this widget is sending, it:'sent'),ChatModelthat is never registered as a session and shares the draft's resource, seeded with the draft's input state minus text/attachments, so the mode/model/permission pickers and the Cloud/repository/approval chips do not change,progressMessage(shimmer: true, stable id) plussetTranscriptProgress(…, { inTranscript: true, onCancel }), so Stop cancels provisioning and the input stays disabled.'sent'→ the existing swap to the materialized session happens and the projection is disposed.'rejected'/ thrown (including Stop →CancellationError) → the draft model is shown again with its prompt and attachments restored. Navigating away drops the projection while the send keeps running. The projection outlives the controller clearing its progress until the send settles, so there is no flicker while the real session loads.setModelkeeps its resource-equality no-op except when moving to or from the projection (same resource by design), and ignoressetModel(draft)while the draft is projected.Testing
chatWidget.test.ts(acceptInput submission harness extended): projection shows the prompt with the draft's pickers seeded and the input accepted once, steps update in place, the projection survives the controller clearing progress, hands over to the materialized session; rejected and cancelled sends restore the prompt and attachments; navigating away drops the projection; a foreign preparation renders as a progress row only.contrib/chat/test/browserfolder: 11202 passing;sessions/contrib/chattests (sharedChatWidget): 1152 passing. ESLint clean.