Skip to content

Missing timeout: TypeScript SDK server-manager — waitForServer() health check fetch #214

@realfishsam

Description

@realfishsam

Location

sdks/typescript/pmxt/server-manager.ts:132

Code

// waitForServer() retry loop
for (let i = 0; i < this.maxRetries; i++) {
    const info = this.getServerInfo();
    if (info) {
        try {
            const response = await fetch(`http://localhost:${info.port}/health`);

Risk

Inside waitForServer(), the health check fetch has no timeout. Each iteration of the retry loop can hang indefinitely before the retry count is checked. If the sidecar process is unresponsive (not crashing, just hung), the total wait is unbounded regardless of maxRetries.

Affected Methods

  • ServerManager.waitForServer() — called during ensureServerRunning() which gates all SDK operations

Suggested Fix

const response = await fetch(`http://localhost:${info.port}/health`, {
    signal: AbortSignal.timeout(5_000),
});

Found by automated missing timeout audit

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions