Commit 1910cd9
refactor(agentex): single canonical terminal/non-terminal task-status sets
Define NON_TERMINAL_TASK_STATUSES ({RUNNING, INTERRUPTED}) and its complement
TERMINAL_TASK_STATUSES once on the TaskStatus entity, and reference them from
both call sites instead of duplicating the membership:
- streams_use_case: imports TERMINAL_TASK_STATUSES (was a local frozenset).
- tasks_use_case: _TERMINAL_TRANSITION_SOURCES now = NON_TERMINAL_TASK_STATUSES
(was an inline (RUNNING, INTERRUPTED) tuple).
A newly added status is terminal by default unless explicitly added to the
non-terminal set, keeping the two views consistent by construction.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 438d828 commit 1910cd9
3 files changed
Lines changed: 27 additions & 20 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
32 | 45 | | |
33 | 46 | | |
34 | 47 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | 25 | | |
38 | 26 | | |
39 | 27 | | |
| |||
129 | 117 | | |
130 | 118 | | |
131 | 119 | | |
132 | | - | |
| 120 | + | |
133 | 121 | | |
134 | 122 | | |
135 | 123 | | |
| |||
169 | 157 | | |
170 | 158 | | |
171 | 159 | | |
172 | | - | |
| 160 | + | |
173 | 161 | | |
174 | 162 | | |
175 | 163 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
7 | 12 | | |
8 | 13 | | |
9 | 14 | | |
| |||
132 | 137 | | |
133 | 138 | | |
134 | 139 | | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
139 | 145 | | |
140 | 146 | | |
141 | 147 | | |
| |||
0 commit comments