Commit 0835a61
fix(broker): route all delivery through Relaycast + honor spawn startup timeout (#1221)
* fix(harness-driver): poll broker handshake for full startupTimeoutMs
HarnessDriverClient.spawn() polled the broker's startup handshake for a
fixed 10 attempts × 1s (~10s), ignoring the caller's startupTimeoutMs.
When the Relaycast handshake took longer than ~10s on a cold or slow
network, the loop exhausted its attempts and threw the broker's
retryable "Broker is starting" 503 even though the broker was healthy
and still warming up. This failed the release smoke tests, which skipped
the internal @agent-relay/* publish jobs, which then made "Publish Main
Package" time out waiting for deps that were never published.
Poll until the full startup budget (default 45s) elapses instead. The
brokerExited race still surfaces a dead broker immediately, so this only
extends how long we wait on a broker that is alive and warming up.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* Update CHANGELOG.md
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
* fix(broker): address PR review — workspace-scoped impersonation, drive queued event, steer/thread, structured 503
- api.rs/worker.rs: gate sender impersonation on workspace membership, not just
name. `has_worker_in_workspace` requires the custodial worker to belong to the
workspace being published into, so a worker attached to workspace A can't be
impersonated (registering/rotating its token) in workspace B.
- fleet.rs: re-emit the `delivery_queued` broker event when a node delivery is
held under manual_flush. The removed local send path emitted it and
`attach --drive` counts it to show pending messages; node delivery is the only
path now, so without this queued messages were invisible until a later flush.
- ws.rs: a `Steer` send with a `thread_id` can't be honored (`AgentClient::reply`
takes no injection mode). Downgrade to a normal reply as before, but log a
warning and document it instead of dropping steer silently.
- client.ts: match the startup-handshake 503 on the structured
`HarnessDriverProtocolError` fields (`status`/`code`) with a message-regex
fallback, so a custom broker 503 body still retries.
- CHANGELOG: trim the spawn-timeout entry to impact-first per the style guide.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* fix(broker): only thread-reply on real Relaycast message ids
Since the send handler now posts via AgentClient::reply when thread_id is
present, a caller echoing back a synthetic id — the broker-minted http_*
event_id from /api/send, or a #channel / direct:* grouping key from
/api/threads — would make Relaycast reject the reply and fail the whole
send. Gate the reply path on is_relaycast_reply_target (reusing the
existing synthetic-event-id classifier plus the channel/DM grouping-key
prefixes); non-message-id thread_ids fall back to a plain post so the
message is still delivered, just unthreaded.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* style: auto-format Rust code with cargo fmt
---------
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>1 parent 7809b20 commit 0835a61
7 files changed
Lines changed: 152 additions & 13 deletions
File tree
- crates/broker/src
- relaycast
- runtime
- packages/harness-driver/src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
29 | 30 | | |
30 | 31 | | |
31 | 32 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
507 | 507 | | |
508 | 508 | | |
509 | 509 | | |
510 | | - | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
511 | 513 | | |
512 | 514 | | |
513 | 515 | | |
| |||
523 | 525 | | |
524 | 526 | | |
525 | 527 | | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
526 | 540 | | |
527 | 541 | | |
528 | 542 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
709 | 709 | | |
710 | 710 | | |
711 | 711 | | |
712 | | - | |
713 | | - | |
714 | | - | |
715 | | - | |
716 | | - | |
717 | | - | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
718 | 723 | | |
719 | 724 | | |
720 | 725 | | |
| |||
755 | 760 | | |
756 | 761 | | |
757 | 762 | | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
758 | 781 | | |
759 | 782 | | |
760 | 783 | | |
| |||
763 | 786 | | |
764 | 787 | | |
765 | 788 | | |
766 | | - | |
| 789 | + | |
767 | 790 | | |
768 | 791 | | |
769 | 792 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
215 | 215 | | |
216 | 216 | | |
217 | 217 | | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
218 | 232 | | |
219 | 233 | | |
220 | 234 | | |
| |||
903 | 917 | | |
904 | 918 | | |
905 | 919 | | |
| 920 | + | |
| 921 | + | |
| 922 | + | |
| 923 | + | |
| 924 | + | |
| 925 | + | |
| 926 | + | |
| 927 | + | |
| 928 | + | |
| 929 | + | |
| 930 | + | |
| 931 | + | |
| 932 | + | |
| 933 | + | |
| 934 | + | |
| 935 | + | |
| 936 | + | |
| 937 | + | |
| 938 | + | |
| 939 | + | |
| 940 | + | |
| 941 | + | |
| 942 | + | |
| 943 | + | |
| 944 | + | |
| 945 | + | |
| 946 | + | |
| 947 | + | |
| 948 | + | |
| 949 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
435 | 435 | | |
436 | 436 | | |
437 | 437 | | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
438 | 457 | | |
439 | 458 | | |
440 | 459 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
209 | 209 | | |
210 | 210 | | |
211 | 211 | | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
212 | 231 | | |
213 | 232 | | |
214 | 233 | | |
| |||
1568 | 1587 | | |
1569 | 1588 | | |
1570 | 1589 | | |
| 1590 | + | |
| 1591 | + | |
| 1592 | + | |
| 1593 | + | |
| 1594 | + | |
| 1595 | + | |
| 1596 | + | |
1571 | 1597 | | |
1572 | 1598 | | |
1573 | 1599 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
374 | 374 | | |
375 | 375 | | |
376 | 376 | | |
377 | | - | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
378 | 385 | | |
379 | 386 | | |
380 | 387 | | |
381 | 388 | | |
382 | | - | |
383 | | - | |
384 | | - | |
385 | | - | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
386 | 398 | | |
387 | 399 | | |
388 | 400 | | |
| |||
0 commit comments