Skip to content

proxy init failure says "after 6 attempts" even when it fast-failed on attempt 2 #517

Description

@debugmcpdev

Follow-up from the review of #515 (fixes #512).

sendInitWithRetry now breaks out of the retry loop as soon as lastExitDetails is recorded — the worker has exited, so no ACK can arrive and burning the remaining ~15s of retries is pointless. Good change. But the error it throws is still built as:

let detailMessage = `Failed to initialize proxy after ${maxRetries + 1} attempts. ${...}`;

so a launch that failed fast on attempt 2 still reports "after 6 attempts". The tests assert that wording (tests/unit/proxy/proxy-manager.start.test.ts, tests/unit/proxy/proxy-manager.handshake.test.ts), so it's pinned rather than accidental.

This is a small step back from #509 ("make the proxy-init timeout say what actually stalled"): the count is the first thing a reader uses to judge how long the launch actually spent trying, and 6-vs-2 changes that read considerably.

Suggested fix

Track the attempts actually made and report that, distinguishing the two exits:

  • exhausted: Failed to initialize proxy after 6 attempts.
  • fast-fail: Failed to initialize proxy after 2 attempts (proxy exited; further retries skipped).

Then update the two asserting tests to match.

Cosmetic only — the exit details appended to the message (code=… signal=… stderr:) already carry the actionable part.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions