Commit a5871a5
authored
🤖 fix: replay SSH startup status across workspace switches (#3133)
## Summary
Persist SSH/Coder startup status in the backend session replay path so
switching away from a preparing workspace and back no longer drops the
startup barrier detail.
## Background
Pre-stream startup breadcrumbs such as runtime checks and workspace
initialization progress were only tracked in renderer state. When the
active workspace subscription switched away and later replayed that
workspace, the aggregator reset could wipe the visible startup detail
before a fresh runtime-status event arrived.
## Implementation
- retain the latest PREPARING `runtime-status` event in `AgentSession`
and replay it before `caught-up`
- keep replayed PREPARING lifecycle state visible in `WorkspaceStore`
before transcript hydration completes
- immediately apply replayed `runtime-status` events during
pre-`caught-up` buffering so reconnect UIs preserve the same startup
detail text
- add reconnect coverage in both the backend replay tests and
`WorkspaceStore` switching tests
- reduce nearby duplication by sharing lifecycle/runtime-status equality
checks in `AgentSession` and using stream event type guards in
`WorkspaceStore`
## Validation
- `bun test src/node/services/agentSession.preStreamError.test.ts`
- `bun test src/browser/stores/WorkspaceStore.test.ts`
- `make static-check`
## Risks
Low to moderate. The change is scoped to PREPARING/reconnect replay
state, but it touches the logic that decides which startup/terminal
stream status is shown while a workspace is hydrating.
---
_Generated with `mux` • Model: `openai:gpt-5.4` • Thinking: `xhigh` •
Cost: `$12.90`_
<!-- mux-attribution: model=openai:gpt-5.4 thinking=xhigh costs=12.90
-->1 parent 2c615f8 commit a5871a5
4 files changed
Lines changed: 222 additions & 25 deletions
File tree
- src
- browser/stores
- node/services
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1558 | 1558 | | |
1559 | 1559 | | |
1560 | 1560 | | |
| 1561 | + | |
| 1562 | + | |
| 1563 | + | |
| 1564 | + | |
| 1565 | + | |
| 1566 | + | |
| 1567 | + | |
| 1568 | + | |
| 1569 | + | |
| 1570 | + | |
| 1571 | + | |
| 1572 | + | |
| 1573 | + | |
| 1574 | + | |
| 1575 | + | |
| 1576 | + | |
| 1577 | + | |
| 1578 | + | |
| 1579 | + | |
| 1580 | + | |
| 1581 | + | |
| 1582 | + | |
| 1583 | + | |
| 1584 | + | |
| 1585 | + | |
| 1586 | + | |
| 1587 | + | |
| 1588 | + | |
| 1589 | + | |
| 1590 | + | |
| 1591 | + | |
| 1592 | + | |
| 1593 | + | |
| 1594 | + | |
| 1595 | + | |
| 1596 | + | |
| 1597 | + | |
| 1598 | + | |
| 1599 | + | |
| 1600 | + | |
| 1601 | + | |
| 1602 | + | |
| 1603 | + | |
| 1604 | + | |
| 1605 | + | |
| 1606 | + | |
| 1607 | + | |
| 1608 | + | |
| 1609 | + | |
| 1610 | + | |
| 1611 | + | |
| 1612 | + | |
| 1613 | + | |
| 1614 | + | |
| 1615 | + | |
| 1616 | + | |
| 1617 | + | |
| 1618 | + | |
| 1619 | + | |
| 1620 | + | |
| 1621 | + | |
| 1622 | + | |
| 1623 | + | |
| 1624 | + | |
| 1625 | + | |
| 1626 | + | |
| 1627 | + | |
| 1628 | + | |
| 1629 | + | |
| 1630 | + | |
| 1631 | + | |
| 1632 | + | |
| 1633 | + | |
| 1634 | + | |
| 1635 | + | |
| 1636 | + | |
| 1637 | + | |
| 1638 | + | |
| 1639 | + | |
| 1640 | + | |
| 1641 | + | |
| 1642 | + | |
| 1643 | + | |
| 1644 | + | |
| 1645 | + | |
| 1646 | + | |
| 1647 | + | |
| 1648 | + | |
| 1649 | + | |
| 1650 | + | |
| 1651 | + | |
| 1652 | + | |
1561 | 1653 | | |
1562 | 1654 | | |
1563 | 1655 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
31 | 32 | | |
| 33 | + | |
32 | 34 | | |
33 | 35 | | |
34 | 36 | | |
35 | 37 | | |
36 | 38 | | |
37 | 39 | | |
| 40 | + | |
38 | 41 | | |
39 | 42 | | |
40 | 43 | | |
| |||
1551 | 1554 | | |
1552 | 1555 | | |
1553 | 1556 | | |
| 1557 | + | |
| 1558 | + | |
1554 | 1559 | | |
1555 | 1560 | | |
1556 | 1561 | | |
1557 | 1562 | | |
1558 | 1563 | | |
1559 | 1564 | | |
1560 | 1565 | | |
1561 | | - | |
1562 | | - | |
| 1566 | + | |
| 1567 | + | |
| 1568 | + | |
1563 | 1569 | | |
1564 | | - | |
| 1570 | + | |
1565 | 1571 | | |
1566 | 1572 | | |
1567 | 1573 | | |
| |||
3566 | 3572 | | |
3567 | 3573 | | |
3568 | 3574 | | |
3569 | | - | |
| 3575 | + | |
3570 | 3576 | | |
3571 | 3577 | | |
3572 | 3578 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
298 | 298 | | |
299 | 299 | | |
300 | 300 | | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
301 | 350 | | |
302 | 351 | | |
303 | 352 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
| 79 | + | |
79 | 80 | | |
80 | 81 | | |
81 | 82 | | |
| |||
398 | 399 | | |
399 | 400 | | |
400 | 401 | | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
401 | 412 | | |
402 | 413 | | |
403 | 414 | | |
| |||
609 | 620 | | |
610 | 621 | | |
611 | 622 | | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
612 | 648 | | |
613 | 649 | | |
614 | 650 | | |
615 | 651 | | |
616 | 652 | | |
617 | 653 | | |
618 | | - | |
619 | | - | |
620 | | - | |
621 | | - | |
622 | | - | |
623 | | - | |
624 | | - | |
| 654 | + | |
625 | 655 | | |
626 | 656 | | |
627 | 657 | | |
| |||
653 | 683 | | |
654 | 684 | | |
655 | 685 | | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
656 | 699 | | |
657 | 700 | | |
658 | 701 | | |
| |||
1550 | 1593 | | |
1551 | 1594 | | |
1552 | 1595 | | |
| 1596 | + | |
1553 | 1597 | | |
1554 | 1598 | | |
1555 | 1599 | | |
| |||
1563 | 1607 | | |
1564 | 1608 | | |
1565 | 1609 | | |
1566 | | - | |
1567 | | - | |
1568 | | - | |
1569 | | - | |
1570 | | - | |
1571 | | - | |
1572 | | - | |
| 1610 | + | |
| 1611 | + | |
| 1612 | + | |
| 1613 | + | |
| 1614 | + | |
| 1615 | + | |
| 1616 | + | |
1573 | 1617 | | |
1574 | 1618 | | |
1575 | | - | |
1576 | | - | |
1577 | | - | |
1578 | | - | |
1579 | | - | |
1580 | | - | |
| 1619 | + | |
| 1620 | + | |
| 1621 | + | |
| 1622 | + | |
| 1623 | + | |
1581 | 1624 | | |
1582 | 1625 | | |
1583 | 1626 | | |
| |||
3902 | 3945 | | |
3903 | 3946 | | |
3904 | 3947 | | |
| 3948 | + | |
3905 | 3949 | | |
3906 | 3950 | | |
3907 | 3951 | | |
| |||
3946 | 3990 | | |
3947 | 3991 | | |
3948 | 3992 | | |
3949 | | - | |
| 3993 | + | |
| 3994 | + | |
| 3995 | + | |
| 3996 | + | |
| 3997 | + | |
| 3998 | + | |
3950 | 3999 | | |
3951 | 4000 | | |
3952 | 4001 | | |
| |||
4151 | 4200 | | |
4152 | 4201 | | |
4153 | 4202 | | |
| 4203 | + | |
4154 | 4204 | | |
4155 | 4205 | | |
4156 | 4206 | | |
| |||
0 commit comments