add back error code description in the main prompt (#3410)

This commit is contained in:
LawyZheng
2025-09-11 23:56:28 +08:00
committed by GitHub
parent ef99a3cc99
commit 3d2b164ea8
3 changed files with 11 additions and 0 deletions

View File

@@ -2062,6 +2062,7 @@ class ForgeAgent:
current_url=current_url, current_url=current_url,
data_extraction_goal=task.data_extraction_goal, data_extraction_goal=task.data_extraction_goal,
action_history=actions_and_results_str, action_history=actions_and_results_str,
error_code_mapping_str=(json.dumps(task.error_code_mapping) if task.error_code_mapping else None),
local_datetime=datetime.now(context.tz_info).isoformat(), local_datetime=datetime.now(context.tz_info).isoformat(),
verification_code_check=verification_code_check, verification_code_check=verification_code_check,
complete_criterion=task.complete_criterion.strip() if task.complete_criterion else None, complete_criterion=task.complete_criterion.strip() if task.complete_criterion else None,

View File

@@ -30,6 +30,11 @@ Terminate Criterion:
``` ```
{{ terminate_criterion }} {{ terminate_criterion }}
```{% endif %} ```{% endif %}
{% if error_code_mapping_str %}
Use the error codes and their descriptions to surface user-defined errors. Do not return any error that's not defined by the user. User defined errors:
```
{{ error_code_mapping_str }}
```{% endif %}
User details: User details:
``` ```

View File

@@ -49,6 +49,11 @@ User goal:
``` ```
{{ navigation_goal }} {{ navigation_goal }}
``` ```
{% if error_code_mapping_str %}
Use the error codes and their descriptions to surface user-defined errors. Do not return any error that's not defined by the user. User defined errors:
```
{{ error_code_mapping_str }}
```{% endif %}
{% if data_extraction_goal %} {% if data_extraction_goal %}
User Data Extraction Goal: User Data Extraction Goal:
``` ```