Commit 6e44ff4
fix(deploy): point harness probe at /api/v1/cloud-agents (M3) (#119)
The harness-credentials check called
`GET /api/v1/users/me/provider_credentials?model_provider=<provider>`,
which doesn't exist on cloud at all — the route was never built. Every
`agentworkforce deploy --harness-source oauth --no-prompt` therefore
failed with "credentials are not connected" even when they were, and
the auto-detect path (no --harness-source) always fell through to the
interactive prompt for the same reason.
Cloud actually exposes harness connection state via `/api/v1/cloud-agents`,
which returns one row per (user, workspace, harness). When the OAuth
completion route (`/api/v1/cli/auth/complete`) stores a credential in
S3 it marks that row `status: "connected"`. That's the single source
of truth — no second probe needed.
Changes:
* Replace `ProviderCredentialsResponse`+`providerCredentialsReady` with
`CloudAgentsListResponse`+`hasConnectedHarness`.
* Switch `isHarnessOauthConnected` to call `/api/v1/cloud-agents` and
match by harness (case-insensitive) + `status === 'connected'`.
* Rewrite the two existing harness tests for the new endpoint, plus add
two new cases: (1) a matching connected entry → probe returns true and
no connect-provider call fires; (2) entries with wrong harness or
wrong status are correctly ignored.
Plan/byok save paths still call cloud routes that don't exist either —
those need cloud-side implementation, deferred to a separate PR. Users
who already authed via `agent-relay cloud connect <provider>` (the
default flow today) are unblocked immediately by this change.
Smoke verified against `agentrelay.com/cloud` with the user's actual
Anthropic-connected workspace:
cloud: claude credentials already connected
(deploy proceeds to bundle/upload; the next failure is a separate 403
on `/workspaces/{ws}/agents` — cloud auth scope bug, not this PR.)
Co-authored-by: Ricky Schema Cascade <ricky@agent-relay.com>
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>1 parent a88cc80 commit 6e44ff4
2 files changed
Lines changed: 170 additions & 38 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
289 | 289 | | |
290 | 290 | | |
291 | 291 | | |
292 | | - | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
293 | 298 | | |
294 | 299 | | |
295 | 300 | | |
| |||
300 | 305 | | |
301 | 306 | | |
302 | 307 | | |
303 | | - | |
| 308 | + | |
| 309 | + | |
304 | 310 | | |
305 | | - | |
| 311 | + | |
306 | 312 | | |
307 | 313 | | |
308 | 314 | | |
| |||
321 | 327 | | |
322 | 328 | | |
323 | 329 | | |
| 330 | + | |
324 | 331 | | |
325 | 332 | | |
326 | | - | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
327 | 434 | | |
328 | 435 | | |
329 | 436 | | |
| |||
340 | 447 | | |
341 | 448 | | |
342 | 449 | | |
343 | | - | |
| 450 | + | |
344 | 451 | | |
345 | 452 | | |
346 | | - | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
347 | 458 | | |
348 | 459 | | |
349 | 460 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
57 | 64 | | |
58 | | - | |
59 | 65 | | |
60 | | - | |
| 66 | + | |
61 | 67 | | |
62 | 68 | | |
63 | 69 | | |
| |||
333 | 339 | | |
334 | 340 | | |
335 | 341 | | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
336 | 356 | | |
337 | 357 | | |
338 | 358 | | |
339 | 359 | | |
340 | 360 | | |
341 | 361 | | |
342 | 362 | | |
343 | | - | |
344 | | - | |
345 | | - | |
346 | | - | |
| 363 | + | |
347 | 364 | | |
348 | 365 | | |
349 | 366 | | |
350 | 367 | | |
351 | 368 | | |
352 | | - | |
| 369 | + | |
353 | 370 | | |
354 | 371 | | |
355 | 372 | | |
356 | 373 | | |
357 | | - | |
358 | | - | |
| 374 | + | |
| 375 | + | |
359 | 376 | | |
360 | 377 | | |
361 | 378 | | |
| |||
626 | 643 | | |
627 | 644 | | |
628 | 645 | | |
629 | | - | |
630 | | - | |
631 | | - | |
632 | | - | |
633 | | - | |
634 | | - | |
635 | | - | |
636 | | - | |
637 | | - | |
638 | | - | |
639 | | - | |
640 | | - | |
641 | | - | |
642 | | - | |
643 | | - | |
644 | | - | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
645 | 666 | | |
646 | 667 | | |
647 | 668 | | |
| |||
0 commit comments