Repository navigation
Commit 1a5d85a
committed
fix(workspace): arm the retry flag synchronously, and report unexpected failures
Codex round 7. Two findings, both verified; each new test was confirmed to fail
with only its own fix reverted.
**A repair retry is marked non-blocking before the entry is published.** The
session entry is registered synchronously, because whenAttached reads it on the
very next line — but the flag that makes a retry non-blocking was set after an
await, so the timer was already armed by the time it ran. A retry that hung then
charged the turn the full 15 seconds, which is exactly what that flag exists to
prevent. Whether a turn is a repair retry depends only on the previous outcome,
which is known synchronously; the workspace comparison is what needs the await.
Deliberately conservative: if the binding also changed, the fresh attach may lose
its wait for one turn. Failing to wait costs that turn's tools and is repaired by
tools/list_changed; waiting wrongly costs every turn the full cap.
The existing test for this passed for the wrong reason. Its retry settled
immediately, so whenAttached returned on settle whatever the flag said. It now
hangs the retry, which is the only way the flag is under test, and it fails
against the old ordering.
**An unexpected attach error now tells the user.** Every explicit failure branch
emits guidance; a throw from outside them — an unwritable or malformed project
config reaching persist — was converted to connect-failed and only logged. The
caller discards the outcome and whenAttached returns void, so that single path
left the user with neither tools nor an explanation. It now notifies before
returning, which is what the rest of the module already promises.1 parent 18ada3e commit 1a5d85a
2 files changed
Lines changed: 57 additions & 9 deletions
File tree
- packages/opencode
- src/altimate/workspace
- test/altimate/workspace
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
763 | 763 | | |
764 | 764 | | |
765 | 765 | | |
766 | | - | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
767 | 782 | | |
768 | 783 | | |
769 | 784 | | |
| |||
839 | 854 | | |
840 | 855 | | |
841 | 856 | | |
842 | | - | |
843 | | - | |
844 | | - | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
845 | 871 | | |
846 | 872 | | |
847 | 873 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
721 | 721 | | |
722 | 722 | | |
723 | 723 | | |
724 | | - | |
725 | | - | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
726 | 731 | | |
727 | | - | |
728 | | - | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
729 | 735 | | |
730 | 736 | | |
731 | 737 | | |
732 | | - | |
| 738 | + | |
733 | 739 | | |
734 | 740 | | |
735 | 741 | | |
| |||
951 | 957 | | |
952 | 958 | | |
953 | 959 | | |
| 960 | + | |
| 961 | + | |
| 962 | + | |
| 963 | + | |
| 964 | + | |
| 965 | + | |
| 966 | + | |
| 967 | + | |
| 968 | + | |
| 969 | + | |
| 970 | + | |
| 971 | + | |
| 972 | + | |
| 973 | + | |
| 974 | + | |
| 975 | + | |
0 commit comments