feat: upgrade Copilot SDK 1.0.0 + cloud/remote sessions + robust UI/testing#200
Merged
Conversation
- getMessages() -> getEvents() - configDir -> configDirectory on session/resume configs Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…failure surfacing - mode:'empty' with explicit feature re-enables (COPILOT_CLIENT_MODE escape hatch) - new_cloud_session WS handler (cloud agent sessions with repository binding) - remote_toggle WS handler via session.rpc.remote enable/disable - session.info infoType=remote -> remote_session_url message - tool.execution_complete success/error -> failed tool state in UI - onPostToolUseFailure hook -> hook_tool_failure message - continuePendingWork:true on resume Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ion wiring 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>
… toggle handlers 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>
… unavailable model, reset stale saved model Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…uests in UI Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Owner
Author
|
@github-copilot review this PR and flag any issues worth fixing. |
Contributor
There was a problem hiding this comment.
Pull request overview
Upgrades the app to @github/copilot-sdk v1.0.0 and adapts the server/client to new APIs while adding first-class remote session publishing/steering and GitHub cloud-agent sessions, plus broader UI and test-suite hardening.
Changes:
- Migrate SDK integration to v1.0.0 with safer
mode: "empty"defaults and updated config fields (e.g.,configDirectory), plus improved resume behavior. - Add remote sessions (Off/Export/On) including runtime toggling and a GitHub URL banner; add “cloud session” creation against a repo/branch.
- Modernize/expand Playwright + unit tests and update UI terminology to “AI Credits (AIC)”.
Reviewed changes
Copilot reviewed 55 out of 68 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/settings.spec.ts | Updates settings E2E to new sidebar helper + “Additional Instructions” + new sections. |
| tests/session-management.spec.ts | Uses openSidebar() to stabilize Sessions sheet navigation. |
| tests/responsive.spec.ts | Blocks service workers and refactors overflow checks into a helper. |
| tests/responsive-chat.spec.ts | Aligns responsive assertions with updated toolbar/sidebar structure. |
| tests/remote-cloud-sessions.spec.ts | New E2E coverage for remote sessions + cloud session creation UX. |
| tests/model-selection.spec.ts | Adjusts model selection E2E expectations for updated connection flow. |
| tests/helpers.ts | Adds openSidebar() helper; updates mock agent shape; imports Playwright expect. |
| tests/error-handling.spec.ts | Updates connectivity assertions and new-chat navigation via sidebar. |
| tests/chat.spec.ts | Updates /health endpoint expectations to new JSON shape. |
| tests/chat-messaging.spec.ts | Aligns toolbar selector + usage event ordering. |
| tests/auth-flow.spec.ts | Updates device-flow E2E to block SWs, new layout data shape, and sidebar access. |
| src/routes/+page.svelte | Adds remote banner, remote/cloud session wiring, silent resume, and removes hardcoded model fallback. |
| src/lib/types/server-messages.ts | Extends message union for tool failures + remote/cloud session events. |
| src/lib/types/quota.ts | Prefers AI Credits quota keys/labels and updates display naming. |
| src/lib/types/config.ts | Makes model optional, introduces RemoteSessionMode, and adds cloud-session config type. |
| src/lib/types/client-messages.ts | Makes model optional and adds new_cloud_session + remote_toggle + resume_session.silent. |
| src/lib/types/chat.ts | Adds tool error fields to message/tool state types. |
| src/lib/stores/ws.svelte.ts | Adds newCloudSession() and remoteToggle(); supports silent resume. |
| src/lib/stores/settings.test.ts | Updates default settings snapshot to include remoteSession: 'off'. |
| src/lib/stores/settings.svelte.ts | Persists/validates remoteSession setting and adds getters/setters. |
| src/lib/stores/chat.test.ts | Updates AIC terminology in expected info messages. |
| src/lib/stores/chat.svelte.ts | Tracks remote URL + cloud-session state; surfaces tool failures; updates AIC label. |
| src/lib/server/ws/session-events.ts | Forwards tool success/error, and converts session.info remote URL into a dedicated message. |
| src/lib/server/ws/message-handlers/session-management.ts | Migrates history retrieval from getMessages() to getEvents(). |
| src/lib/server/ws/message-handlers/resume-session.ts | Uses empty-mode defaults and adds continuePendingWork + silent reconnect support. |
| src/lib/server/ws/message-handlers/remote.ts | New handler to enable/disable remote export/steering via session.rpc.remote. |
| src/lib/server/ws/message-handlers/remote.test.ts | Unit coverage for remote toggle handler behavior. |
| src/lib/server/ws/message-handlers/new-session.ts | Adds model-unavailable fallback retry and threads remote session option. |
| src/lib/server/ws/message-handlers/new-session.test.ts | Unit coverage for model fallback logic. |
| src/lib/server/ws/message-handlers/index.ts | Registers new_cloud_session and remote_toggle handlers. |
| src/lib/server/ws/message-handlers/cloud-session.ts | New handler for creating GitHub cloud-agent sessions with repo validation. |
| src/lib/server/ws/message-handlers/cloud-session.test.ts | Unit coverage for cloud session handler validation + creation flow. |
| src/lib/server/ws/constants.ts | Whitelists and rate-limits new_cloud_session/remote_toggle. |
| src/lib/server/copilot/session.ts | Implements empty-mode defaults, adds cloud session options, and updates SDK config keys. |
| src/lib/server/copilot/session.test.ts | Updates expectations for configDirectory and “no hardcoded model”. |
| src/lib/server/copilot/session-empty-mode.test.ts | New unit tests ensuring empty-mode explicitly re-enables required features. |
| src/lib/server/copilot/client.ts | Sets SDK client mode and resolves baseDirectory consistently. |
| src/lib/server/config.ts | Adds COPILOT_CLIENT_MODE env handling with empty default. |
| src/lib/components/settings/SettingsModal.svelte | Adds “Remote Sessions” accordion section and wiring. |
| src/lib/components/settings/RemoteSessionPanel.svelte | New settings panel UI for remote session mode + apply-to-session. |
| src/lib/components/settings/QuotaPanel.svelte | Updates wording from “requests” to “credits”. |
| src/lib/components/sessions/SessionsSheet.svelte | Adds cloud session creation form + improves indicator accessibility labels. |
| src/lib/components/sessions/SessionPreview.svelte | Displays remote/cloud source metadata. |
| src/lib/components/layout/Sidebar.svelte | Updates AIC terminology in session totals display. |
| src/lib/components/layout/RemoteBanner.svelte | New banner linking to GitHub remote session URL. |
| src/lib/components/layout/EnvInfo.svelte | Updates AIC terminology in environment info panel. |
| src/lib/components/chat/ToolCall.svelte | Displays tool error details when a tool call fails. |
| src/lib/components/chat/ChatMessage.svelte | Updates usage tooltip label from premium → AIC; threads tool errors into ToolCall. |
| src/hooks.server.ts | Adds env-gated option to disable rate limiting for E2E runs. |
| README.md | Documents SDK v1.0.0, remote sessions UI, cloud sessions, and new env vars. |
| playwright.config.ts | Sets E2E_DISABLE_RATE_LIMIT=true for Playwright runs. |
| package.json | Upgrades @github/copilot-sdk to ^1.0.0. |
| package-lock.json | Locks updated SDK + @github/copilot binaries. |
| docs/ARCHITECTURE.md | Updates architecture docs for SDK v1.0.0 and empty-mode/remote/cloud sessions. |
| .github/workflows/ci.yml | Runs Playwright in a desktop/mobile matrix + caches browsers. |
| .github/copilot-instructions.md | Updates repo instructions to SDK v1.0.0 + empty-mode defaults. |
Comments suppressed due to low confidence (1)
src/lib/server/ws/message-handlers/resume-session.ts:156
cold_resumecurrently setsmodelfrommsg.model, butresume_sessionmessages don't include amodelfield (seeResumeSessionMessage). This means the server will sendmodel: ''incold_resume, and the UI can lose the correct model label during resume (especially when resuming from the Sessions panel).
Comment on lines
179
to
182
| await highButton.click(); | ||
|
|
||
| await expectSentMessage( | ||
| sentMessages, | ||
| (msg) => | ||
| (msg.type === 'new_session' && msg.model === 'o3' && msg.reasoningEffort === 'high') || | ||
| (msg.type === 'set_reasoning' && msg.effort === 'high') || | ||
| (msg.type === 'set_reasoning_effort' && msg.effort === 'high'), | ||
| ); | ||
| await expect(highButton).toHaveClass(/active/); | ||
| await expect(mediumButton).not.toHaveClass(/active/); |
Comment on lines
105
to
+108
| const rateLimit: Handle = async ({ event, resolve }) => { | ||
| if (process.env.E2E_DISABLE_RATE_LIMIT === 'true') { | ||
| return resolve(event); | ||
| } |
| return; | ||
| } | ||
|
|
||
| const mode = typeof msg.mode === 'string' && VALID_REMOTE_MODES.has(msg.mode) ? msg.mode : 'on'; |
| }; | ||
| } | ||
|
|
||
| export function buildSessionHooks(onHookEvent: HookEventCallback): SessionConfig['hooks'] { return { |
Comment on lines
+15
to
+16
| // Git branch: conservative allowlist (no control chars, spaces, or git-invalid sequences). | ||
| const BRANCH_RE = /^[a-zA-Z0-9](?:[a-zA-Z0-9._\/-]{0,254})$/; |
Comment on lines
+29
to
+33
| // Mirror server-side validation (cloud-session.ts) | ||
| const OWNER_RE = /^[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,37}[a-zA-Z0-9])?$/; | ||
| const REPO_RE = /^[a-zA-Z0-9._-]{1,100}$/; | ||
| const BRANCH_RE = /^[a-zA-Z0-9](?:[a-zA-Z0-9._/-]{0,254})$/; | ||
|
|
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.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
@github/copilot-sdk1.0.0 stable and migrate breaking API changesmode: "empty"defaults with explicit feature re-enablescontinuePendingWork, silent reconnect with suppressResumeEvent)gpt-4.1fallback; auto-recover when a saved model is no longer availableValidation
npm run checknpm run test:unitnpx playwright test --project=desktop --project=mobileNotes