fix: 修复 showPlan 工具交互逻辑和 JWT Token 问题

- 修复 pendingQuestions 缺失时无法提交回答的问题
- 添加 fallbackTaskId 参数支持直接发送到后端
- apiClient 自动获取 JWT Token
- 取消按钮改为中止对话而非发送消息
This commit is contained in:
XiaoFeng
2026-01-13 10:58:33 +08:00
parent 37a121c3de
commit 72a84ed9e2
10 changed files with 300 additions and 103 deletions

View File

@ -128,7 +128,15 @@ export function activate(context: vscode.ExtensionContext) {
"ic-coder.login",
async () => {
try {
await vscode.authentication.getSession("iccoder", [], { createIfNone: true });
// 检查是否有现有 session
const existingSession = await vscode.authentication.getSession("iccoder", [], { createIfNone: false });
if (existingSession) {
// 有旧 session使用 forceNewSession 强制创建新 session
await vscode.authentication.getSession("iccoder", [], { forceNewSession: true });
} else {
// 没有旧 session使用 createIfNone 创建新 session
await vscode.authentication.getSession("iccoder", [], { createIfNone: true });
}
} catch (error) {
vscode.window.showErrorMessage(`登录失败: ${error}`);
}