Skip to content

Sync runner lifecycle and display-id workflows#46

Merged
joyzoursky merged 11 commits intomainfrom
runner-fix
Mar 11, 2026
Merged

Sync runner lifecycle and display-id workflows#46
joyzoursky merged 11 commits intomainfrom
runner-fix

Conversation

@joyzoursky
Copy link
Copy Markdown
Collaborator

Summary

  • Synchronize runner stop semantics between CLI and control-plane so skytest stop runner marks the server runner offline immediately.
  • Introduce runner displayId as first-class pairing data and use it consistently in Team Runners UI and CLI workflows.
  • Reduce stale scheduling edge cases by requiring runner status ONLINE at claim time.

Changes

  • Added new authenticated endpoint POST /api/runners/v1/shutdown to set runner status to OFFLINE and return protocol compatibility metadata.
  • Extended runner protocol with shutdownRunnerRequest/Response and required displayId on pairing exchange payloads.
  • Updated CLI runtime to:
  • send shutdown notifications before local process termination (serverMarkedOffline surfaced in stop output)
  • accept --url as alias for --control-plane-url
  • resolve runner identifiers by local ID, server ID, or unique prefix across start/stop/logs/describe/unpair
  • Persisted Runner.displayId in schema/backend types/services and surfaced it via team availability + MCP inventory responses.
  • Updated Team Runners UI to:
  • treat stale as offline presentation
  • move pairing flow into guided modal with copyable commands
  • add troubleshooting command references and per-offline-runner start command snippets
  • Added/updated docs for new CLI flags and runner identifier semantics.
  • Added targeted tests for CLI parser alias and claim SQL online guard.

Validation

  • Lint: npm run lint (via npm run verify) passed
  • Tests: targeted test updates included (packages/cli-runner/src/cli-parser.test.ts, src/lib/runners/__tests__/claim-service.test.ts)
  • Audit: npm run audit (via npm run verify) passed
  • Manual: Not run in this PR flow

Breaking Changes

  • Runner.displayId is now a required database field and pairing exchange contract field.
  • Deployments with existing Runner records require a migration/backfill plan before applying this schema change.

Risks

  • Shutdown notify is best-effort; if control-plane notify fails, local stop still succeeds and UI falls back to heartbeat freshness windows.
  • Identifier prefix matching may surface ambiguity errors for similar runner IDs and requires users to provide a longer ID.

Follow-ups

  • Add integration coverage for shutdown endpoint + CLI stop path across network/error scenarios.
  • Add migration/backfill task for pre-existing runner rows in non-empty environments.

@joyzoursky joyzoursky changed the title runner: sync stop lifecycle and display-id workflows Sync runner lifecycle and display-id workflows Mar 11, 2026
@joyzoursky joyzoursky merged commit 3786598 into main Mar 11, 2026
1 check passed
@joyzoursky joyzoursky deleted the runner-fix branch March 11, 2026 13:41
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