Skip to content

fix(client): wait for live service contenders - #40515

Merged
kitlangton merged 1 commit into
v2from
service-contender
Aug 4, 2026
Merged

fix(client): wait for live service contenders#40515
kitlangton merged 1 commit into
v2from
service-contender

Conversation

@kitlangton

Copy link
Copy Markdown
Contributor

Summary

  • wait for a live service contender when another contender exits unsuccessfully
  • keep the Effect and Promise service clients behaviorally aligned
  • add a coordinated failed-loser fixture and regression coverage for both clients

Root cause

Concurrent service starts intentionally produce losing processes. The client inspected every contender for failure before removing finished contenders, so a normal loser exiting with code 1 could fail the entire ensure operation while another contender was still alive and becoming the registered service.

This made startup report Server process exited with code 1 even when a healthy winner was still starting.

Behavior

A contender failure is now reported only after finished contenders are removed and no live contender remains. Genuine single-contender startup failures and signal termination continue to fail normally.

Validation

  • bun test test/service.test.ts: 10 passed
  • bun test test/promise-service.test.ts: 5 passed
  • bun typecheck in packages/client
  • repository pre-push typecheck hook

@kitlangton
kitlangton marked this pull request as ready for review August 4, 2026 20:15
@kitlangton
kitlangton enabled auto-merge (squash) August 4, 2026 20:15
@kitlangton
kitlangton merged commit 1fd817f into v2 Aug 4, 2026
10 checks passed
@kitlangton
kitlangton deleted the service-contender branch August 4, 2026 20:23
github-actions Bot pushed a commit to ReStranger/opencode that referenced this pull request Aug 5, 2026
* upstream/v2: (28 commits)
  refactor(app): gate unsupported v2 capabilities (anomalyco#40381)
  fix(app): show active search details (anomalyco#40597)
  refactor(app): migrate supported v2 APIs (anomalyco#40378)
  fix(app): reconcile v2 session projections (anomalyco#40376)
  refactor(app): own rendering contracts (anomalyco#40375)
  fix(core): make xAI OAuth device-only (anomalyco#40538)
  test(app): migrate e2e fixtures to v2 (anomalyco#40374)
  fix(core): report missing shell workdir (anomalyco#40542)
  fix(ai): restore Responses tool input semantics (anomalyco#40553)
  fix(ai): classify malformed Responses tool calls (anomalyco#40549)
  feat(tui): streamline tab navigation shortcuts (anomalyco#40551)
  fix(ai): preserve Gemini tool finish semantics (anomalyco#40546)
  fix: retry empty incomplete streams (anomalyco#40535)
  fix(app): finish tool call ID rename (anomalyco#40539)
  refactor: rename tool call ID fields
  fix(client): wait for live service contenders (anomalyco#40515)
  chore(core): drop unreachable AI SDK provider packages (anomalyco#40504)
  fix(tui): update tab titles immediately (anomalyco#40318)
  fix(tui): show branch beside directory (anomalyco#40500)
  feat(vcs): publish branch updates (anomalyco#40371)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant