Skip to content

Commit 284aa53

Browse files
committed
Summarize and output only the last backport/rebase run
In case of a build failure and multiple runs of backport/rebase, only take the output of the corresponding agent from the last run. Since every run now starts from zero, we don't need the previous ones. Howeve keep storing them all for debugging purposes. Signed-off-by: Nikola Forró <[email protected]>
1 parent 7b3014e commit 284aa53

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

agents/backport_agent.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ async def run_log_agent(state):
359359
template=get_log_prompt(),
360360
input=LogInputSchema(
361361
jira_issue=state.jira_issue,
362-
changes_summary="\n".join(state.backport_log),
362+
changes_summary=state.backport_log[-1],
363363
),
364364
),
365365
expected_output=LogOutputSchema,
@@ -406,8 +406,7 @@ async def commit_push_and_open_mr(state):
406406
f"{state.log_result.description}\n\n"
407407
f"Upstream patch: {state.upstream_fix}\n\n"
408408
f"Resolves: {state.jira_issue}\n\n"
409-
"Backporting steps:\n\n"
410-
+ '\n'.join(state.backport_log)
409+
f"Backporting steps:\n\n{state.backport_log[-1]}"
411410
),
412411
available_tools=gateway_tools,
413412
commit_only=dry_run,

agents/rebase_agent.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ async def run_log_agent(state):
323323
template=get_log_prompt(),
324324
input=LogInputSchema(
325325
jira_issue=state.jira_issue,
326-
changes_summary="\n".join(state.rebase_log),
326+
changes_summary=state.rebase_log[-1],
327327
),
328328
),
329329
expected_output=LogOutputSchema,
@@ -367,8 +367,7 @@ async def commit_push_and_open_mr(state):
367367
f"{CAREFULLY_REVIEW_CHANGES}\n\n"
368368
f"{state.log_result.description}\n\n"
369369
f"Resolves: {state.jira_issue}\n\n"
370-
"Status of the rebase:\n\n"
371-
+ '\n'.join(state.rebase_log)
370+
f"Status of the rebase:\n\n{state.rebase_log[-1]}"
372371
),
373372
available_tools=gateway_tools,
374373
commit_only=dry_run,

0 commit comments

Comments
 (0)