Title: Copilot Chat BYOK turns should survive browser disconnects via server Agent Host · Issue #8046 · coder/code-server · GitHub
Open Graph Title: Copilot Chat BYOK turns should survive browser disconnects via server Agent Host · Issue #8046 · coder/code-server
X Title: Copilot Chat BYOK turns should survive browser disconnects via server Agent Host · Issue #8046 · coder/code-server
Description: Problem Copilot Chat BYOK execution in code-server can remain coupled to the browser/renderer lifecycle even when the conversation UI is backed by the server-side Agent Host. In practice, an active BYOK turn may stop when the tab becomes...
Open Graph Description: Problem Copilot Chat BYOK execution in code-server can remain coupled to the browser/renderer lifecycle even when the conversation UI is backed by the server-side Agent Host. In practice, an active...
X Description: Problem Copilot Chat BYOK execution in code-server can remain coupled to the browser/renderer lifecycle even when the conversation UI is backed by the server-side Agent Host. In practice, an active...
Opengraph URL: https://github.com/coder/code-server/issues/8046
X: @github
Domain: github.com
IPv4 address: 140.82.114.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Copilot Chat BYOK turns should survive browser disconnects via server Agent Host","articleBody":"## Problem\n\nCopilot Chat BYOK execution in code-server can remain coupled to the browser/renderer lifecycle even when the conversation UI is backed by the server-side Agent Host. In practice, an active BYOK turn may stop when the tab becomes inactive, is hard-reloaded, or the browser is closed, and the user must send another message to resume work.\n\nThis is particularly surprising for remote code-server usage: the server is still alive, the Agent Host is still available, and long-running agent work is expected to continue independently of whether a browser happens to be attached.\n\n## Why this matters\n\nRemote development sessions routinely outlive individual browser tabs. Users switch devices, lose mobile/network connectivity, reload the workbench, suspend a laptop, or intentionally close the browser while a long-running agent task is in progress. Tying BYOK model execution to the renderer means those otherwise normal client lifecycle events can terminate useful server-side work.\n\nThe goal is **not** to keep a browser renderer artificially alive. The goal is to move the ownership boundary to the component that already has the correct lifecycle for background work: the remote/server Agent Host.\n\n## Desired behavior\n\nFor BYOK providers whose semantics can be represented safely by the Copilot SDK/server Agent Host:\n\n- an active turn continues while the tab is inactive;\n- an active turn survives hard reload/reconnect;\n- an active turn survives full browser/tab detach and can be observed after reconnect;\n- no replacement user message is required merely to keep the existing turn alive.\n\n## Compatibility requirements\n\nThe server-side path must preserve provider semantics rather than force every BYOK configuration through a lossy abstraction.\n\nThe direct Agent Host path should therefore be used only when the configuration can be represented faithfully. Configurations that need renderer-only semantics should continue to use the existing renderer bridge, including cases such as:\n\n- OpenAI ZDR-specific behavior;\n- OpenRouter Anthropic Messages behavior;\n- custom request headers;\n- query-bearing/custom endpoints whose exact wire semantics matter;\n- thinking/edit-tool or other advanced custom-endpoint overrides not representable safely by the server SDK surface.\n\nUnsupported semantics should fall back to renderer ownership instead of being guessed or silently altered.\n\n## Security requirements\n\nBYOK credential material must remain ephemeral:\n\n- credentials must not be persisted into Agent Host state, replay/history, telemetry, or AHP JSONL logs;\n- the renderer-to-Agent-Host credential-bearing DTO must be strictly validated and bounded;\n- provider identities must not allow credentials/endpoints to cross provider groups;\n- no user BYOK model/provider or credential material should be hard-coded.\n\n## Related Agent Host UI correctness\n\nWhile validating browser-detached Agent Host sessions, folder-isolated sessions also exposed an adjacent scoping bug: the Changes pill could subscribe to branch-wide changes and report unrelated repository changes. Folder isolation should default to **Session Changes**; worktree isolation should retain **Branch Changes**.\n\n## Validation target\n\nThe proposed implementation has been exercised on code-server 4.140.0 / VS Code 1.140 with targeted Agent Host/BYOK tests, browser tests, full build/release verification, repository CI, and live browser-detach acceptance.\n","author":{"url":"https://github.com/khanhkit","@type":"Person","name":"khanhkit"},"datePublished":"2026-10-08T09:46:45Z","url":"https://github.com/coder/code-server/issues/8046"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:c6a5a09b-8ca7-d318-75a0-966c12b3ac8d |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E92A:313BCB:E2EFE:139A8D:6B042EE6 |
| html-safe-nonce | a18fb5bb07fe985d163a4968307178ce4e3c5279f2f4983f8585c293fb3a4f08 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFOTJBOjMxM0JDQjpFMkVGRToxMzlBOEQ6NkIwNDJFRTYiLCJ2aXNpdG9yX2lkIjoiMTQ1NTc5OTcwMTAxMzI3ODQzOCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 8e9d381d1179f0e45a95b10a17e9eef9c5ae2cd3fd17ebd052f2b3a67ba0d341 |
| hovercard-subject-tag | issue:5759548021 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/coder/code-server/8046/issue_layout |
| twitter:image | https://opengraph.githubassets.com/fabdfbf6959b3562d850aaa2fb6cff1ed6a39116609d63b8aa73c71895ed265f/coder/code-server/issues/8046 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/fabdfbf6959b3562d850aaa2fb6cff1ed6a39116609d63b8aa73c71895ed265f/coder/code-server/issues/8046 |
| og:image:alt | Problem Copilot Chat BYOK execution in code-server can remain coupled to the browser/renderer lifecycle even when the conversation UI is backed by the server-side Agent Host. In practice, an active... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | khanhkit |
| hostname | github.com |
| expected-hostname | github.com |
| None | b7a1d2b9101496921b08579fbee988d014345aef2f5bd660d1f8c7332d81560e |
| turbo-cache-control | no-preview |
| go-import | github.com/coder/code-server git https://github.com/coder/code-server.git |
| octolytics-dimension-user_id | 95932066 |
| octolytics-dimension-user_login | coder |
| octolytics-dimension-repository_id | 172953845 |
| octolytics-dimension-repository_nwo | coder/code-server |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 172953845 |
| octolytics-dimension-repository_network_root_nwo | coder/code-server |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | c3dd496c3da6ea6b77e69c09279d2b81604654f1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width