Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

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

Open
#915 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
48/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Domain
api, backend

Research direction

Start at the TypeScript ResumeSessionConfig and the resumeSession(sessionId, ...) entry point, then compare its customAgents handling with createSession. Trace the session.resume path and timeout error formatting. Done means customAgents behavior on resume is supported or explicitly rejected, and timeout messages show a numeric value instead of [object Object].

Written by the indexing model from the issue text.

Description

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
Dominant language
Java
Stars
10.5k
Forks
1.5k
Avg merge
1d 9h
Merged PRs (30d)
131

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from github/copilot-sdk

All issues in github/copilot-sdk

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.