github / github/copilot-sdk

Support updating a session's `gitHubToken` without recreating the session

已关闭
#2,365 3 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
enhancement
主要语言
Java
星标
10.5k
派生
1.5k
平均合并
1 天 11 小时
30 天内合并 PR
128

描述

## Problem

`gitHubToken` can only be set at session creation (`SessionConfigBase.gitHubToken`). `session.rpc.options.update()` (rpc.d.ts) has no token/auth field, and no other RPC accepts a replacement token for a live session.

If the token backing a session rotates or is revoked externally, there's no way to refresh it in place — every subsequent turn 401s until the host closes and recreates the session, losing session continuity.

## Request

Support updating a running session's `gitHubToken`, re-resolving the GitHub identity the same way session creation does. Either:
1. Allow `gitHubToken` in `SessionUpdateOptionsParams`, or
2. A dedicated RPC (e.g. `session.rpc.auth.refresh({gitHubToken})`)

Session state (history, mode, loaded skills) should be preserved — that's the point of avoiding close+recreate.

贡献指南

打开贡献指南

调研方向

先阅读 rpc.d.ts 和 SessionConfigBase,然后跟踪 session.rpc.options.update() 以及会话创建期间使用的 token 处理。定义并实现一条受支持的实时会话更新路径,重新解析 GitHub 身份,并验证 history、mode 和已加载的 skills 仍保持不变。

由索引模型根据 Issue 内容生成。

评估

技术栈
github, typescript
领域
api, authentication, backend
Issue 类型
功能
难度
4/5
预计耗时
3-5 天
活跃度
活跃
描述清晰度
基本清楚
新手友好度
52/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。