Skip to content

Commit b68b726

Browse files
authored
Merge pull request #11 from MiroMindAI/test/yfd
feat(agent): add rollback retry and exceed max turn summary
2 parents e75d487 + 713a527 commit b68b726

19 files changed

+907
-164
lines changed

config/benchmark/default.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,7 @@ data:
88

99
execution:
1010
max_tasks: null # null means no limit
11-
max_concurrent: 5
12-
pass_at_k: 1
11+
max_concurrent: 5
12+
pass_at_k: 1
13+
max_retry: 1
14+
exceed_max_turn_summary: false

config/benchmark/gaia-validation-text-only.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ data:
1111
execution:
1212
max_tasks: null
1313
max_concurrent: 3
14-
pass_at_k: 3
15-
stop_condition: "valid_box" # Options: "correct", "valid_box", "max_turn"
16-
enable_failure_experience: true
14+
pass_at_k: 1
15+
max_retry: 5
16+
exceed_max_turn_summary: true
1717

1818
openai_api_key: "${oc.env:OPENAI_API_KEY,???}"
1919
openai_base_url: "${oc.env:OPENAI_BASE_URL,https://api.openai.com/v1}"

config/binwang_fangda_agent_gaia-validation-text-only_mirothinker_single_agent_rollback_new_tools_toolblacklist.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,14 @@ main_agent:
2626
output_processor:
2727
- ${output-summary}
2828
- ${output-final-answer-extraction}
29-
- ${output-failure-experience}
29+
- ${output-exceed-max-turn-summary}
3030

3131
input-message-generator:
3232
type: InputMessageGenerator
3333
output-summary:
3434
type: SummaryGenerator
35-
output-failure-experience:
36-
type: FailureExperienceSummaryGenerator
35+
output-exceed-max-turn-summary:
36+
type: ExceedMaxTurnSummaryGenerator
3737
prompt: config/prompts/fangda_prompt_main_agent.yaml
3838
llm:
3939
_base_: config/llm/base_mirothinker.yaml

config/fangda_agent_gaia-validation-text-only_mirothinker_single_agent_rollback.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ main_agent:
2121
output_processor:
2222
- ${output-summary}
2323
- ${output-final-answer-extraction}
24-
- ${output-failure-experience}
24+
- ${output-exceed-max-turn-summary}
2525

2626
input-message-generator:
2727
type: InputMessageGenerator
@@ -32,8 +32,8 @@ output-final-answer-extraction:
3232
prompt: config/prompts/fangda_prompt_main_agent.yaml
3333
llm:
3434
_base_: config/llm/base_mirothinker.yaml
35-
output-failure-experience:
36-
type: FailureExperienceSummaryGenerator
35+
output-exceed-max-turn-summary:
36+
type: ExceedMaxTurnSummaryGenerator
3737
prompt: config/prompts/fangda_prompt_main_agent.yaml
3838
llm:
3939
_base_: config/llm/base_mirothinker.yaml

config/fangda_agent_gaia-validation-text-only_mirothinker_single_agent_rollback_new_tools.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@ main_agent:
2121
output_processor:
2222
- ${output-summary}
2323
- ${output-final-answer-extraction}
24-
- ${output-failure-experience}
24+
- ${output-exceed-max-turn-summary}
2525

2626
input-message-generator:
2727
type: InputMessageGenerator
2828
output-summary:
2929
type: SummaryGenerator
30-
output-failure-experience:
31-
type: FailureExperienceSummaryGenerator
30+
output-exceed-max-turn-summary:
31+
type: ExceedMaxTurnSummaryGenerator
3232
prompt: config/prompts/fangda_prompt_main_agent.yaml
3333
llm:
3434
_base_: config/llm/base_mirothinker.yaml

config/prompts/fangda_prompt_main_agent.yaml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -303,9 +303,9 @@ template:
303303
304304
Extract the final answer in \boxed{} format:
305305
306-
failure_summary_prompt:
306+
exceed_max_turn_summary_prompt:
307307
components:
308-
- basic_failure_summary_prompt
308+
- basic_exceed_max_turn_summary_prompt
309309

310310
required_context:
311311
- task_description
@@ -315,7 +315,7 @@ template:
315315
- final_boxed_answer
316316
- error_message
317317

318-
basic_failure_summary_prompt: |
318+
basic_exceed_max_turn_summary_prompt: |
319319
The task was not completed successfully. Do NOT call any tools. Provide a structured summary:
320320
321321
Failure type: [incomplete / blocked / misdirected / format_missed]
@@ -346,27 +346,27 @@ template:
346346
Error Encountered: {{ error_message }}
347347
{% endif %}
348348
349-
failure_experience_header:
349+
exceed_max_turn_summary_header:
350350
components:
351351
- header_text
352352

353353
header_text: |
354354
=== Previous Attempts Analysis ===
355355
The following summarizes what was tried before and why it did not work. Use this to guide a NEW approach.
356356
357-
failure_experience_item:
357+
exceed_max_turn_summary_item:
358358
components:
359359
- item_text
360360

361361
required_context:
362362
- attempt_number
363-
- failure_summary
363+
- summary
364364

365365
item_text: |
366366
[Attempt {{ attempt_number }}]
367-
{{ failure_summary }}
367+
{{ summary }}
368368
369-
failure_experience_footer:
369+
exceed_max_turn_summary_footer:
370370
components:
371371
- footer_text
372372

scripts/fangda_run_evaluate_multiple_runs_mirothinker_gaia-validation-text-only.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# Configuration parameters
88
NUM_RUNS=3
99
BENCHMARK_NAME="gaia-validation-text-only"
10-
AGENT_SET="fangda_agent_gaia-validation-text-only_mirothinker_single_agent_rollback"
10+
AGENT_SET="fangda_agent_gaia-validation-text-only_mirothinker_single_agent_rollback_new_tools"
1111
MAX_CONCURRENT=30
1212

1313
# Set results directory with timestamp

src/agents/iterative_agent.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ async def run_internal(self, ctx: AgentContext) -> AgentContext:
152152
message_history=message_history,
153153
summary=output_processor_result.get("summary", None),
154154
final_boxed_answer=output_processor_result.get("final_boxed_answer", None),
155-
failure_experience_summary=output_processor_result.get(
156-
"failure_experience_summary", None
155+
exceed_max_turn_summary=output_processor_result.get(
156+
"exceed_max_turn_summary", None
157157
),
158158
)

src/agents/iterative_agent_with_rollback.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ async def run_internal(self, ctx: AgentContext) -> AgentContext:
246246
message_history=message_history,
247247
summary=output_processor_result.get("summary", None),
248248
final_boxed_answer=output_processor_result.get("final_boxed_answer", None),
249-
failure_experience_summary=output_processor_result.get(
250-
"failure_experience_summary", None
249+
exceed_max_turn_summary=output_processor_result.get(
250+
"exceed_max_turn_summary", None
251251
),
252252
)

src/io_processor/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
"""IO processor module for input/output handling."""
66

77
from src.io_processor.base import BaseIOProcessor
8-
from src.io_processor.failure_experience_generator import (
9-
FailureExperienceSummaryGenerator,
8+
from src.io_processor.exceed_max_turn_summary_generator import (
9+
ExceedMaxTurnSummaryGenerator,
1010
)
1111

1212
__all__ = [
1313
"BaseIOProcessor",
14-
"FailureExperienceSummaryGenerator",
14+
"ExceedMaxTurnSummaryGenerator",
1515
]

0 commit comments

Comments
 (0)