Skip to content

PIR: Add broker step action handler logic#8282

Open
landomen wants to merge 3 commits into
feature/domen/pir-email-flexibility-state-engine-modelsfrom
feature/domen/pir-email-flexibility-step-action
Open

PIR: Add broker step action handler logic#8282
landomen wants to merge 3 commits into
feature/domen/pir-email-flexibility-state-engine-modelsfrom
feature/domen/pir-email-flexibility-step-action

Conversation

@landomen
Copy link
Copy Markdown
Contributor

@landomen landomen commented Apr 15, 2026

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 the PIR broker-step action execution flow to trigger email generation explicitly via a new GenerateEmail action and adjusts the GetEmailForProfile side-effect contract, which could affect opt-out/scan/email-confirmation runs if misrouted.

Overview
Adds handling for the new BrokerAction.GenerateEmail so broker scripts can explicitly request email generation; when encountered, the runner switches to PirStage.EMAIL_GENERATE and emits SideEffect.GetEmailForProfile.

Simplifies GetEmailForProfile by removing embedded profile/query data (now only actionId and brokerName), and updates unit/integration tests to cover GenerateEmail across scan/opt-out/email-confirmation steps and the new side-effect shape.

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

Copy link
Copy Markdown
Contributor Author

landomen commented Apr 15, 2026

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,
)

Copy link
Copy Markdown
Contributor

@cursor cursor Bot left a comment

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
Copy link
Copy Markdown
Collaborator

@daxmobile daxmobile left a comment

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
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.

3 participants