Fix campaign project URL resolution in issue updates#11238
Conversation
- Export temporary_project_map from project handler manager - Pass project map to regular handler via GH_AW_TEMPORARY_PROJECT_MAP - Add replaceTemporaryProjectReferences function in temporary_id.cjs - Apply project URL replacement in update_issue before body processing - Update compiler to wire up project map outputs and inputs Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
- Only add env var when project-related safe outputs are enabled - Fixes tests that verify exact YAML structure - Add tests for replaceTemporaryProjectReferences - Add tests for loadTemporaryProjectMap - Update TypeScript types for safe_output_project_handler_manager Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
|
@copilot There should be no temporary map needed, update project comes after create project as a step. |
Could you clarify what you mean? The agent calls Are you suggesting we should change the approach - perhaps by having the agent NOT include project URLs in the issue body, or by changing how |
|
@copilot We should be able to use the project number information from the |
I think there might be a misunderstanding about the flow. Here's what happens:
The agent can't know the actual project URL during its execution because the project hasn't been created yet. The MCP handler only returns a temporary_id. Are you suggesting we should:
|
|
@copilot Make sure that the projectURL that lands in the final issue update is the real projectURL not the temporary id. |
Yes, that's exactly what my implementation does. Here's how it works: Before (what agent writes): After (what lands in the issue): The code in |
Campaign generator was passing temporary project IDs (e.g.,
#aw_abc123def456) instead of actual project URLs toupdate_issue, leaving unresolved references in issue bodies.Root Cause
The project handler manager creates projects and maintains a
temporary_id → project_urlmapping locally, but this mapping was never shared with the regular handler manager whereupdate_issueruns.Changes
JavaScript
temporary_project_mapas step output fromsafe_output_project_handler_manager.cjsloadTemporaryProjectMap()andreplaceTemporaryProjectReferences()totemporary_id.cjsupdate_issue.cjsbefore body processingGo Compiler
temporary_project_mapto safe outputs job outputsGH_AW_TEMPORARY_PROJECT_MAPenv var to handler manager step (only when project handlers are enabled)Flow
Temporary project IDs in issue text are now resolved to actual project URLs before the issue is updated.
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.