Commit a73231f
committed
🔄 synced local 'skyvern/' with remote 'skyvern/'
- Add termination detection to task v2 prompts (Phase 1)
- Handle termination in task v2 service logic (Phase 2)
- Add termination thought tracking (Phase 3)
- add tests
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit
* **New Features**
* Adds explicit termination support: tasks can end early when impossible, exposing a termination indicator and reason; plan and task type may be omitted when terminated or goal achieved.
* Thoughts and guidance now optionally include an explanation when a goal is impossible.
* Completion checks now surface page/extraction context and report nuanced outcomes (achieved, needs more steps, impossible).
* **Tests**
* Added comprehensive tests covering termination behavior, decision logic, and output fields.
<sub>✏️ Tip: You can customize this high-level summary in your review settings.</sub>
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
<!-- ELLIPSIS_HIDDEN -->
----
> [!IMPORTANT]
> Add termination handling to task v2, allowing early task termination when goals are impossible, with updates to prompts, service logic, and comprehensive tests.
>
> - **Behavior**:
> - Adds termination detection to `task_v2.j2` and `task_v2_check_completion.j2` prompts, allowing tasks to end early when goals are impossible.
> - Implements termination handling in `task_v2_service.py`, including `_handle_task_v2_termination()` function to create termination thoughts and mark tasks as terminated.
> - Updates `ThoughtType` and `ThoughtScenario` enums in `task_v2.py` to include `termination`.
> - **Tests**:
> - Adds unit tests in `test_task_v2.py` to cover termination behavior, including response parsing, decision logic, and thought creation.
>
> <sup>This description was created by </sup>[<img alt="Ellipsis" src="https://img.shields.io/badge/Ellipsis-blue?color=175173">](https://www.ellipsis.dev?ref=Skyvern-AI%2Fskyvern-cloud&utm_source=github&utm_medium=referral)<sup> for a3ffc63f5fd32acaf954738ef40f5ca3e8655389. You can [customize](https://app.ellipsis.dev/Skyvern-AI/settings/summaries) this summary. It will automatically update as commits are pushed.</sup>
<!-- ELLIPSIS_HIDDEN -->1 parent a503a19 commit a73231f
File tree
4 files changed
+195
-7
lines changed- skyvern
- forge
- prompts/skyvern
- sdk/schemas
- services
4 files changed
+195
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
9 | 36 | | |
10 | 37 | | |
11 | 38 | | |
| |||
16 | 43 | | |
17 | 44 | | |
18 | 45 | | |
19 | | - | |
| 46 | + | |
20 | 47 | | |
21 | | - | |
22 | | - | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
23 | 54 | | |
24 | 55 | | |
25 | 56 | | |
| |||
Lines changed: 17 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
12 | 16 | | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
13 | 28 | | |
14 | 29 | | |
15 | 30 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
117 | 117 | | |
118 | 118 | | |
119 | 119 | | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
120 | 127 | | |
121 | 128 | | |
122 | 129 | | |
123 | 130 | | |
124 | 131 | | |
| 132 | + | |
125 | 133 | | |
126 | 134 | | |
127 | 135 | | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
128 | 143 | | |
129 | 144 | | |
130 | 145 | | |
| |||
133 | 148 | | |
134 | 149 | | |
135 | 150 | | |
| 151 | + | |
136 | 152 | | |
137 | 153 | | |
138 | 154 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
146 | 146 | | |
147 | 147 | | |
148 | 148 | | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
149 | 223 | | |
150 | 224 | | |
151 | 225 | | |
| |||
526 | 600 | | |
527 | 601 | | |
528 | 602 | | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
529 | 613 | | |
530 | 614 | | |
531 | 615 | | |
| |||
702 | 786 | | |
703 | 787 | | |
704 | 788 | | |
| 789 | + | |
705 | 790 | | |
706 | 791 | | |
707 | 792 | | |
| |||
730 | 815 | | |
731 | 816 | | |
732 | 817 | | |
| 818 | + | |
| 819 | + | |
733 | 820 | | |
734 | 821 | | |
735 | 822 | | |
| |||
741 | 828 | | |
742 | 829 | | |
743 | 830 | | |
744 | | - | |
| 831 | + | |
| 832 | + | |
| 833 | + | |
| 834 | + | |
| 835 | + | |
| 836 | + | |
745 | 837 | | |
746 | 838 | | |
747 | 839 | | |
| |||
763 | 855 | | |
764 | 856 | | |
765 | 857 | | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
766 | 871 | | |
767 | 872 | | |
768 | 873 | | |
| |||
925 | 1030 | | |
926 | 1031 | | |
927 | 1032 | | |
| 1033 | + | |
928 | 1034 | | |
929 | 1035 | | |
930 | 1036 | | |
| |||
949 | 1055 | | |
950 | 1056 | | |
951 | 1057 | | |
| 1058 | + | |
| 1059 | + | |
952 | 1060 | | |
953 | 1061 | | |
954 | 1062 | | |
955 | 1063 | | |
956 | 1064 | | |
957 | | - | |
| 1065 | + | |
| 1066 | + | |
| 1067 | + | |
| 1068 | + | |
| 1069 | + | |
958 | 1070 | | |
959 | 1071 | | |
960 | 1072 | | |
| |||
977 | 1089 | | |
978 | 1090 | | |
979 | 1091 | | |
| 1092 | + | |
| 1093 | + | |
| 1094 | + | |
| 1095 | + | |
| 1096 | + | |
| 1097 | + | |
| 1098 | + | |
| 1099 | + | |
| 1100 | + | |
| 1101 | + | |
| 1102 | + | |
| 1103 | + | |
| 1104 | + | |
| 1105 | + | |
980 | 1106 | | |
981 | 1107 | | |
982 | 1108 | | |
| |||
0 commit comments