Skip to content

fix: avoid virtual auto-provision startup deadlock#73

Merged
jbiskur merged 8 commits intomainfrom
feat/command-poller
Apr 13, 2026
Merged

fix: avoid virtual auto-provision startup deadlock#73
jbiskur merged 8 commits intomainfrom
feat/command-poller

Conversation

@jbiskur
Copy link
Copy Markdown
Contributor

@jbiskur jbiskur commented Apr 13, 2026

Summary

  • start the leader pump before by-name virtual pathway registration in production virtual mode
  • defer virtual registration on non-leaders until leadership gain
  • add runtime pulse reconfiguration coverage for command poller and pump lifecycle

Test plan

  • deno test -A tests/pathway-builder-config.test.ts tests/provisioner.test.ts tests/pump-runtime-behavior.test.ts tests/pathway-pump.test.ts tests/cluster-manager.test.ts
  • CI green

jbiskur and others added 8 commits April 10, 2026 14:23
Replace push-based HTTP callback reset with pull-based command polling.
Virtual pathway instances now poll the CP every 5s for pending commands
instead of exposing a public reset endpoint.

New:
- CommandPoller class polls GET /api/v1/pathways/:pathwayId/commands/pending
- Reports status via POST /api/v1/pathways/:pathwayId/commands/:commandId/status
- Phase flow: acknowledged → execute resetPump() → running (or failed)
- Auto-starts when pathwayName is configured and pump starts
- Configurable via commandPollingIntervalMs (default: 5000ms)

Breaking changes:
- advertisedUrl, resetSecret, resetPath constructor params deprecated (accepted but ignored)
- pathwayName no longer requires advertisedUrl or resetSecret
- processReset() on PathwayRouter deprecated (returns no-op with warning)
- virtualConfig in provision() no longer sends resetUrl or authHeaders

The library reuses its existing apiKey for polling authentication
(tenant-mode FRN auth on the CP side).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…rl/resetSecret

Remove assertThrows tests for the old validation that required
advertisedUrl + resetSecret when pathwayName is set. These fields are
now deprecated and ignored. Add test for the new commandPollingIntervalMs
option and for pathwayName without any deprecated fields.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
# Conflicts:
#	src/pathways/builder.ts
#	tests/pathway-builder-config.test.ts
@jbiskur jbiskur merged commit d6d866c into main Apr 13, 2026
1 check passed
@jbiskur jbiskur deleted the feat/command-poller branch April 13, 2026 21:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant