Skip to content

feat: upgrade Copilot SDK 1.0.0 + cloud/remote sessions + robust UI/testing#200

Merged
devartifex merged 14 commits into
masterfrom
devartifex/upgrade-copilot-sdk
Jun 10, 2026
Merged

feat: upgrade Copilot SDK 1.0.0 + cloud/remote sessions + robust UI/testing#200
devartifex merged 14 commits into
masterfrom
devartifex/upgrade-copilot-sdk

Conversation

@devartifex

Copy link
Copy Markdown
Owner

Summary

  • upgrade to @github/copilot-sdk 1.0.0 stable and migrate breaking API changes
  • switch server client to safe mode: "empty" defaults with explicit feature re-enables
  • add cloud session creation and remote session controls (Off/Export/On) with runtime toggle + GitHub URL banner
  • improve resume reliability (continuePendingWork, silent reconnect with suppressResumeEvent)
  • remove hardcoded gpt-4.1 fallback; auto-recover when a saved model is no longer available
  • update billing UI terminology to AI Credits (AIC) for UBB
  • modernize Playwright suite and CI matrix (desktop + mobile), plus additional unit coverage

Validation

  • npm run check
  • npm run test:unit
  • npx playwright test --project=desktop --project=mobile

Notes

  • branch also includes updated docs screenshots generated by the screenshot tests

devartifex and others added 13 commits June 9, 2026 23:20
- 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>
@devartifex

Copy link
Copy Markdown
Owner Author

@github-copilot review this PR and flag any issues worth fixing.

Copilot AI 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.

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_resume currently sets model from msg.model, but resume_session messages don't include a model field (see ResumeSessionMessage). This means the server will send model: '' in cold_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 thread src/hooks.server.ts
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>
@devartifex devartifex merged commit ed8a03c into master Jun 10, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants