Skip to content

🧹 [Refactor] Split AgentTeamsWorkflow.run to fix Long Function issue - #75

Open
joy7758 wants to merge 3 commits into
mainfrom
fix/workflow-long-function-15222052330323076543
Open

🧹 [Refactor] Split AgentTeamsWorkflow.run to fix Long Function issue#75
joy7758 wants to merge 3 commits into
mainfrom
fix/workflow-long-function-15222052330323076543

Conversation

@joy7758

@joy7758 joy7758 commented Aug 23, 2026

Copy link
Copy Markdown
Owner

🎯 What: Extracted the pre-execution phase and post-execution phase from AgentTeamsWorkflow.run into two private helper methods (_run_pre_execution_phase and _run_post_execution_phase).
💡 Why: To fix the "Long Function" code health issue, greatly improving code readability and maintainability by splitting the orchestration logic into clear execution blocks.
Verification: Applied changes were verified to be syntactically sound via ruff, unit tests were executed with all test_workflow.py and test_workflow_runtime.py tests passing (providing correct test env variables), and milestone/governance validation scripts passed.
Result: Improved readability and clear code logic boundaries without introducing regressions.


PR created automatically by Jules for task 15222052330323076543 started by @joy7758

Co-authored-by: joy7758 <138868899+joy7758@users.noreply.github.com>
@google-labs-jules

Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1e6482f56a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

self.handoffs.add("workflow-lead", "request-analyst", request["request_id"], "NORMALIZE_REQUEST", request)
self.service.submit_action_request(request, caller_token=self.caller_token)

def _run_pre_execution_phase(

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Update the recommendation gate before refactoring

This commit performs development without updating governance/agent-recommendation-gate.json; the retained gate still describes the earlier CLOSE_FINAL_THREE_MERGE_GATE_P1_FINDINGS task, branch, and base commit, so it does not record the recommendation, evidence, remaining gaps, or stop conditions for this workflow refactor as required by the repository's pre-development gate. Update that governance record for this task before landing the code change.

AGENTS.md reference: AGENTS.md:L23-L27

Useful? React with 👍 / 👎.

google-labs-jules Bot and others added 2 commits August 23, 2026 02:15
Co-authored-by: joy7758 <138868899+joy7758@users.noreply.github.com>
Co-authored-by: joy7758 <138868899+joy7758@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant