Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

FLEET: resumeSession() with customAgents errors with malformed timeout message "[object Object]ms"

未关闭
#915 1 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
48/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
冷清
领域
api, backend

调研方向

从 TypeScript ResumeSessionConfig 和 resumeSession(sessionId, ...) 入口点开始,然后将其对 customAgents 的处理与 createSession 进行比较。跟踪 session.resume 路径和超时错误的格式化方式。完成标准是:支持恢复时的 customAgents 行为,或明确拒绝该行为,并且超时消息显示数值而不是 [object Object]。

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

描述

Summary

Calling client.resumeSession(sessionId, { customAgents: [...] }) on a live session produces a timeout error with a malformed message: "Timeout after [object Object]ms". This reveals two bugs: (1) resumeSession with customAgents fails, and (2) the timeout value is being stringified via implicit .toString() instead of extracting the numeric value.

Steps to Reproduce

import { CopilotClient, approveAll } from '@github/copilot-sdk';

const client = new CopilotClient();
await client.start();

const session = await client.createSession({ onPermissionRequest: approveAll });
const sessionId = session.id;
await session.destroy();

try {
    const resumed = await client.resumeSession(sessionId, {
        onPermissionRequest: approveAll,
        customAgents: [{
            name: 'post-creation-agent',
            displayName: 'Post Creation Agent',
            description: 'Added during resume',
            prompt: 'You are a post-creation agent.',
            tools: ['view'],
            infer: false,
        }],
    });
} catch (err) {
    console.error(err.message);
    // → "Timeout after [object Object]ms waiting for session.idle"
}

Observed Behaviour

Spike data (2026-03-17):

{
  "resumeSucceeded": false,
  "resumeError": "Timeout after [object Object]ms waiting for session.idle",
  "answer": "NO/ERROR"
}

Bug 1: resumeSession with customAgents fails

The TypeScript type ResumeSessionConfig accepts customAgents, but the CLI backend appears to reject or ignore it and the session never reaches idle. Either:

  • customAgents is not supported on resume (the type should exclude it), or
  • There is a backend defect handling customAgents in session.resume

Bug 2: Malformed timeout error message

"Timeout after [object Object]ms" is a string formatting bug. The timeout config value (likely { ms: number } or similar) is being coerced to string via .toString() instead of extracting the numeric value.

Expected: "Timeout after 30000ms waiting for session.idle"

Workaround

Only set customAgents at initial createSession time. Do not attempt to add agents via resumeSession:

// ✅ Works
const session = await client.createSession({
    onPermissionRequest: approveAll,
    customAgents: [{ name: 'my-agent', ... }],
});

// ❌ Errors with malformed timeout
const session = await client.resumeSession(id, {
    customAgents: [{ name: 'my-agent', ... }],
});

Environment

  • SDK: @github/copilot-sdk v0.1.32
  • CLI: latest
  • Node: v24.13.1
主要语言
Java
星标
10.5k
派生
1.5k
平均合并
1 天 9 小时
30 天内合并 PR
130

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

github/copilot-sdk 的其他 Issue

查看 github/copilot-sdk 的全部 Issue

相似的 Issue

更多 Java Issue

把新 issue 发到你的邮箱

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