Skip to content

PIR: Add broker step action handler logic#8282

Merged
landomen merged 3 commits into
developfrom
feature/domen/pir-email-flexibility-step-action
May 26, 2026
Merged

PIR: Add broker step action handler logic#8282
landomen merged 3 commits into
developfrom
feature/domen/pir-email-flexibility-step-action

Conversation

@landomen

@landomen landomen commented Apr 15, 2026

Copy link
Copy Markdown
Contributor

Task/Issue URL: https://app.asana.com/1/137249556945/project/72649045549333/task/1213886961787939?focus=true

Description

Adds logic for the new GenerateEmail action.

Steps to test this PR

Will be testable later on the top stacked PR

UI changes

No UI changes


Note

Medium Risk
Changes PIR broker automation around email generation for opt-out/scan flows; scope is limited to the state engine handler and side-effect shape, with unit test coverage.

Overview
Adds broker step handling for the new GenerateEmail action: when that action runs, the actions runner moves to PirStage.EMAIL_GENERATE and emits GetEmailForProfile (same path as opt-out/email-confirmation steps that need an email but have none).

GetEmailForProfile is narrowed to actionId and brokerName only—extractedProfile and profileQuery are no longer passed on the side effect (call sites and tests updated accordingly).

Unit tests cover GenerateEmail on scan, opt-out, and email-confirmation steps.

Reviewed by Cursor Bugbot for commit e6537d7. Bugbot is set up for automated code reviews on this repo. Configure here.

stageStartMs = currentTimeProvider.currentTimeMillis(),
),
),
sideEffect = GetEmailForProfile(

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Note: failure is handled in the existing PirActionsRunner.handleGetEmail, which calls PirActionsRunner.onError(EmailError) which dispatches ErrorReceived which ultimately dispatches

Event.BrokerActionFailed(
    error = result.error,
    allowRetry = false,
)

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 57b9781. Configure here.

@landomen landomen force-pushed the feature/domen/pir-email-flexibility-step-action branch from 57b9781 to feb3698 Compare April 29, 2026 05:11

@daxmobile daxmobile left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit

actionlint

📝 [actionlint] reported by reviewdog 🐶
shellcheck reported issue in this script: SC2086:info:18:53: Double quote to prevent globbing and word splitting [shellcheck]


📝 [actionlint] reported by reviewdog 🐶
shellcheck reported issue in this script: SC2086:info:1:6: Double quote to prevent globbing and word splitting [shellcheck]

run: bash ${RUNNER_TEMP}/gh-aw/actions/clean_git_credentials.sh


📝 [actionlint] reported by reviewdog 🐶
shellcheck reported issue in this script: SC2086:info:1:6: Double quote to prevent globbing and word splitting [shellcheck]


📝 [actionlint] reported by reviewdog 🐶
shellcheck reported issue in this script: SC2086:info:1:6: Double quote to prevent globbing and word splitting [shellcheck]

run: bash ${RUNNER_TEMP}/gh-aw/actions/append_agent_step_summary.sh


📝 [actionlint] reported by reviewdog 🐶
shellcheck reported issue in this script: SC2086:info:1:6: Double quote to prevent globbing and word splitting [shellcheck]

run: bash ${RUNNER_TEMP}/gh-aw/actions/download_docker_images.sh ghcr.io/github/gh-aw-firewall/agent:0.25.4 ghcr.io/github/gh-aw-firewall/api-proxy:0.25.4 ghcr.io/github/gh-aw-firewall/squid:0.25.4


📝 [actionlint] reported by reviewdog 🐶
shellcheck reported issue in this script: SC2086:info:1:6: Double quote to prevent globbing and word splitting [shellcheck]

run: bash ${RUNNER_TEMP}/gh-aw/actions/install_awf_binary.sh v0.25.4


📝 [actionlint] reported by reviewdog 🐶
shellcheck reported issue in this script: SC2086:info:2:40: Double quote to prevent globbing and word splitting [shellcheck]

GH_AW_GITHUB_RUN_ID: ${{ github.run_id }}
GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }}
# poutine:ignore untrusted_checkout_exec
run: |

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

📝 [actionlint] reported by reviewdog 🐶
shellcheck reported issue in this script: SC2086:info:1:6: Double quote to prevent globbing and word splitting [shellcheck]

{"create_pull_request":{"base_branch":"develop","draft":true,"github-token":"${{ secrets.GT_DAXMOBILE }}","labels":["agentic-maintenance"],"max":1,"max_patch_size":1024,"protected_files":["package.json","bun.lockb","bunfig.toml","deno.json","deno.jsonc","deno.lock","global.json","NuGet.Config","Directory.Packages.props","mix.exs","mix.lock","go.mod","go.sum","stack.yaml","stack.yaml.lock","pom.xml","build.gradle","build.gradle.kts","settings.gradle","settings.gradle.kts","gradle.properties","package-lock.json","yarn.lock","pnpm-lock.yaml","npm-shrinkwrap.json","requirements.txt","Pipfile","Pipfile.lock","pyproject.toml","setup.py","setup.cfg","Gemfile","Gemfile.lock","uv.lock","CODEOWNERS"],"protected_path_prefixes":[".github/",".agents/"],"title_prefix":"[Android Maintenance] "},"mentions":{"enabled":false},"missing_data":{},"missing_tool":{},"noop":{"max":1,"report-as-issue":"true"}}
GH_AW_SAFE_OUTPUTS_CONFIG_876e01d037e1f83a_EOF
- name: Write Safe Outputs Tools
run: |

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

📝 [actionlint] reported by reviewdog 🐶
shellcheck reported issue in this script: SC2086:info:107:6: Double quote to prevent globbing and word splitting [shellcheck]

{"create_pull_request":{"base_branch":"develop","draft":true,"github-token":"${{ secrets.GT_DAXMOBILE }}","labels":["agentic-maintenance"],"max":1,"max_patch_size":1024,"protected_files":["package.json","bun.lockb","bunfig.toml","deno.json","deno.jsonc","deno.lock","global.json","NuGet.Config","Directory.Packages.props","mix.exs","mix.lock","go.mod","go.sum","stack.yaml","stack.yaml.lock","pom.xml","build.gradle","build.gradle.kts","settings.gradle","settings.gradle.kts","gradle.properties","package-lock.json","yarn.lock","pnpm-lock.yaml","npm-shrinkwrap.json","requirements.txt","Pipfile","Pipfile.lock","pyproject.toml","setup.py","setup.cfg","Gemfile","Gemfile.lock","uv.lock","CODEOWNERS"],"protected_path_prefixes":[".github/",".agents/"],"title_prefix":"[Android Maintenance] "},"mentions":{"enabled":false},"missing_data":{},"missing_tool":{},"noop":{"max":1,"report-as-issue":"true"}}
GH_AW_SAFE_OUTPUTS_CONFIG_876e01d037e1f83a_EOF
- name: Write Safe Outputs Tools
run: |

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

📝 [actionlint] reported by reviewdog 🐶
shellcheck reported issue in this script: SC2086:info:10:7: Double quote to prevent globbing and word splitting [shellcheck]

{"create_pull_request":{"base_branch":"develop","draft":true,"github-token":"${{ secrets.GT_DAXMOBILE }}","labels":["agentic-maintenance"],"max":1,"max_patch_size":1024,"protected_files":["package.json","bun.lockb","bunfig.toml","deno.json","deno.jsonc","deno.lock","global.json","NuGet.Config","Directory.Packages.props","mix.exs","mix.lock","go.mod","go.sum","stack.yaml","stack.yaml.lock","pom.xml","build.gradle","build.gradle.kts","settings.gradle","settings.gradle.kts","gradle.properties","package-lock.json","yarn.lock","pnpm-lock.yaml","npm-shrinkwrap.json","requirements.txt","Pipfile","Pipfile.lock","pyproject.toml","setup.py","setup.cfg","Gemfile","Gemfile.lock","uv.lock","CODEOWNERS"],"protected_path_prefixes":[".github/",".agents/"],"title_prefix":"[Android Maintenance] "},"mentions":{"enabled":false},"missing_data":{},"missing_tool":{},"noop":{"max":1,"report-as-issue":"true"}}
GH_AW_SAFE_OUTPUTS_CONFIG_876e01d037e1f83a_EOF
- name: Write Safe Outputs Tools
run: |

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

📝 [actionlint] reported by reviewdog 🐶
shellcheck reported issue in this script: SC2086:info:1:7: Double quote to prevent globbing and word splitting [shellcheck]

bash ${RUNNER_TEMP}/gh-aw/actions/start_safe_outputs_server.sh

- name: Setup MCP Scripts Config
run: |

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

📝 [actionlint] reported by reviewdog 🐶
shellcheck reported issue in this script: SC2086:info:1:10: Double quote to prevent globbing and word splitting [shellcheck]

bash ${RUNNER_TEMP}/gh-aw/actions/start_safe_outputs_server.sh

- name: Setup MCP Scripts Config
run: |

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

📝 [actionlint] reported by reviewdog 🐶
shellcheck reported issue in this script: SC2086:info:68:10: Double quote to prevent globbing and word splitting [shellcheck]

chmod +x ${RUNNER_TEMP}/gh-aw/mcp-scripts/mcp-server.cjs

- name: Setup MCP Scripts Tool Files
run: |

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

📝 [actionlint] reported by reviewdog 🐶
shellcheck reported issue in this script: SC2086:info:17:7: Double quote to prevent globbing and word splitting [shellcheck]

chmod +x ${RUNNER_TEMP}/gh-aw/mcp-scripts/mcp-server.cjs

- name: Setup MCP Scripts Tool Files
run: |

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

📝 [actionlint] reported by reviewdog 🐶
shellcheck reported issue in this script: SC2086:info:1:7: Double quote to prevent globbing and word splitting [shellcheck]

GH_AW_MCP_SCRIPTS_PORT: ${{ steps.mcp-scripts-config.outputs.mcp_scripts_port }}
GH_AW_MCP_SCRIPTS_API_KEY: ${{ steps.mcp-scripts-config.outputs.mcp_scripts_api_key }}
ASANA_ACCESS_TOKEN: ${{ secrets.ASANA_ACCESS_TOKEN }}
run: |

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

📝 [actionlint] reported by reviewdog 🐶
shellcheck reported issue in this script: SC2086:info:6:6: Double quote to prevent globbing and word splitting [shellcheck]


- name: Collect task IDs
id: collect
run: |

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

📝 [actionlint] reported by reviewdog 🐶
shellcheck reported issue in this script: SC2086:info:5:30: Double quote to prevent globbing and word splitting [shellcheck]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

📝 [actionlint] reported by reviewdog 🐶
shellcheck reported issue in this script: SC2086:info:1:1: Double quote to prevent globbing and word splitting [shellcheck]

run: ${RUNNER_TEMP}/gh-aw/actions/validate_multi_secret.sh ANTHROPIC_API_KEY 'Claude Code' https://github.github.com/gh-aw/reference/engines/#anthropic-claude-code

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

📝 [actionlint] reported by reviewdog 🐶
shellcheck reported issue in this script: SC2086:info:1:6: Double quote to prevent globbing and word splitting [shellcheck]

run: bash ${RUNNER_TEMP}/gh-aw/actions/validate_prompt_placeholders.sh

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

📝 [actionlint] reported by reviewdog 🐶
shellcheck reported issue in this script: SC2086:info:1:6: Double quote to prevent globbing and word splitting [shellcheck]

run: bash ${RUNNER_TEMP}/gh-aw/actions/print_prompt_summary.sh

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

📝 [actionlint] reported by reviewdog 🐶
shellcheck reported issue in this script: SC2086:info:1:6: Double quote to prevent globbing and word splitting [shellcheck]

run: bash ${RUNNER_TEMP}/gh-aw/actions/create_gh_aw_tmp_dir.sh

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

📝 [actionlint] reported by reviewdog 🐶
shellcheck reported issue in this script: SC2086:info:1:6: Double quote to prevent globbing and word splitting [shellcheck]

run: bash ${RUNNER_TEMP}/gh-aw/actions/configure_gh_for_ghe.sh

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

📝 [actionlint] reported by reviewdog 🐶
shellcheck reported issue in this script: SC2086:info:1:6: Double quote to prevent globbing and word splitting [shellcheck]

run: bash ${RUNNER_TEMP}/gh-aw/actions/install_awf_binary.sh v0.25.4

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

📝 [actionlint] reported by reviewdog 🐶
shellcheck reported issue in this script: SC2086:info:1:6: Double quote to prevent globbing and word splitting [shellcheck]

run: bash ${RUNNER_TEMP}/gh-aw/actions/download_docker_images.sh ghcr.io/github/gh-aw-firewall/agent:0.25.4 ghcr.io/github/gh-aw-firewall/api-proxy:0.25.4 ghcr.io/github/gh-aw-firewall/squid:0.25.4 ghcr.io/github/gh-aw-mcpg:v0.2.9 ghcr.io/github/github-mcp-server:v0.32.0 node:lts-alpine

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

📝 [actionlint] reported by reviewdog 🐶
shellcheck reported issue in this script: SC2086:info:1:10: Double quote to prevent globbing and word splitting [shellcheck]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

📝 [actionlint] reported by reviewdog 🐶
shellcheck reported issue in this script: SC2086:info:4:7: Double quote to prevent globbing and word splitting [shellcheck]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

📝 [actionlint] reported by reviewdog 🐶
shellcheck reported issue in this script: SC2086:info:9:6: Double quote to prevent globbing and word splitting [shellcheck]

@landomen landomen force-pushed the feature/domen/pir-email-flexibility-step-action branch from feb3698 to b9ac7be Compare April 29, 2026 05:13
@landomen landomen force-pushed the feature/domen/pir-email-flexibility-state-engine-models branch from 53a3685 to 1c7b095 Compare April 29, 2026 05:13
@landomen landomen requested a review from karlenDimla May 14, 2026 15:39
@landomen landomen force-pushed the feature/domen/pir-email-flexibility-step-action branch from b9ac7be to 2b18366 Compare May 15, 2026 15:49
@landomen landomen force-pushed the feature/domen/pir-email-flexibility-state-engine-models branch from 1c7b095 to 1715ba3 Compare May 15, 2026 15:49
@landomen landomen force-pushed the feature/domen/pir-email-flexibility-state-engine-models branch from 1715ba3 to e9ab186 Compare May 15, 2026 16:19
@landomen landomen force-pushed the feature/domen/pir-email-flexibility-step-action branch from 2b18366 to e974a7d Compare May 15, 2026 16:19
@landomen landomen force-pushed the feature/domen/pir-email-flexibility-state-engine-models branch from e9ab186 to a2cd8c4 Compare May 19, 2026 11:00
@landomen landomen force-pushed the feature/domen/pir-email-flexibility-step-action branch from e974a7d to 9cb269d Compare May 19, 2026 11:01
@landomen landomen force-pushed the feature/domen/pir-email-flexibility-step-action branch from 9cb269d to 81eaf81 Compare May 21, 2026 17:48
@landomen landomen force-pushed the feature/domen/pir-email-flexibility-state-engine-models branch from a2cd8c4 to 0fcf038 Compare May 21, 2026 17:48
@landomen landomen force-pushed the feature/domen/pir-email-flexibility-step-action branch from 81eaf81 to aa8e6f8 Compare May 22, 2026 06:46
@landomen landomen force-pushed the feature/domen/pir-email-flexibility-state-engine-models branch from 0fcf038 to 4a87e70 Compare May 22, 2026 06:46

@marcosholgado marcosholgado left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

landomen commented May 26, 2026

Copy link
Copy Markdown
Contributor Author

Merge activity

  • May 26, 8:20 AM UTC: A user started a stack merge that includes this pull request via Graphite.
  • May 26, 8:40 AM UTC: Graphite rebased this pull request as part of a merge.
  • May 26, 8:53 AM UTC: @landomen merged this pull request with Graphite.

@landomen landomen changed the base branch from feature/domen/pir-email-flexibility-state-engine-models to graphite-base/8282 May 26, 2026 08:21
@landomen landomen changed the base branch from graphite-base/8282 to develop May 26, 2026 08:39
@landomen landomen force-pushed the feature/domen/pir-email-flexibility-step-action branch from aa8e6f8 to e6537d7 Compare May 26, 2026 08:39
@landomen landomen merged commit 4b1f52f into develop May 26, 2026
15 checks passed
@landomen landomen deleted the feature/domen/pir-email-flexibility-step-action branch May 26, 2026 08:53
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.

4 participants