Skip to content

Add temporary ID support for create_issue safe output#4698

Merged
pelikhan merged 5 commits intomainfrom
copilot/add-temporary-id-generation
Nov 25, 2025
Merged

Add temporary ID support for create_issue safe output#4698
pelikhan merged 5 commits intomainfrom
copilot/add-temporary-id-generation

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Nov 24, 2025

Summary

This PR adds temporary ID support for the create_issue safe output, enabling agents to create parent issues and sub-issues that reference each other within the same workflow run.

Changes

  • Temporary ID generation: aw_ prefixed 12-char hex crypto IDs assigned to each issue (user-provided or auto-generated)
  • Reference resolution: #aw_ID references in issue bodies replaced with resolved issue numbers
  • Parent linking: parent field accepts temporary IDs for sub-issue linking
  • Cross-job communication: temporary_id_map job output passed to add-comment job

New shared utility

Created temporary_id.cjs with functions for ID generation, validation, normalization, and reference replacement.

Usage

[
  {
    "type": "create_issue",
    "title": "Parent Issue",
    "body": "This is the parent",
    "temporary_id": "aw_abc123def456"
  },
  {
    "type": "create_issue", 
    "title": "Sub Issue",
    "body": "References #aw_abc123def456",
    "parent": "aw_abc123def456"
  }
]

The #aw_abc123def456 resolves to #42 (actual issue number) when the sub-issue is created.

Checklist

  • Temporary ID format uses aw_ prefix
  • Update safe_outputs_tools.json schema
  • Modify types/safe-outputs.d.ts
  • Modify create_issue.cjs
  • Modify create_issue.go
  • Modify add_comment.go and add_comment.cjs
  • Add tests for all temporary ID functionality
  • Create shared temporary_id.cjs utility module
  • Merged main and recompiled workflows
Original prompt

The safe output create_issue tool should generate a temporary id that gets returned to the user. The temporary id will be resolved to the actual id in the create-issue job once the github issue is created.

  • create random temporary id (12 chars hex crypto)
  • stored in safe output json output
  • in create issues jobs, maintain a map of (temporary->issue number)
  • use map when creating an issue to update parent issue, search and replace issue references in text #...

The goal of this feature is that the agent is able to create a parent issue, then create a set of sub issues referencing the parent issue.

The map should be exposed as an output of the job so that the add-comment job is also able to use it.


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

Copilot AI and others added 2 commits November 24, 2025 22:39
- Generate 12-char hex temporary IDs for issues created via safe outputs
- Store temporary_id -> issue_number mapping in job output
- Replace #temp:ID references in issue body with resolved issue numbers
- Support parent field referencing temporary IDs for sub-issue linking
- Pass temporary_id_map to add-comment job for reference resolution
- Add comprehensive tests for temporary ID functionality

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
- Create temporary_id.cjs with shared functions for temporary ID handling
- Update create_issue.cjs and add_comment.cjs to use shared utility
- Add temporary_id.cjs to embedded JavaScript sources for bundling
- Add comprehensive tests for temporary_id.cjs module

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Add temporary ID generation for issue creation Add temporary ID support for create_issue safe output Nov 24, 2025
Copilot AI requested a review from pelikhan November 24, 2025 23:00
Comment thread .github/workflows/archie.lock.yml Outdated
@pelikhan
Copy link
Copy Markdown
Collaborator

@copilot merge main, accept all the deleted workflow lock files, recompile and finish merge.

Updated the temporary ID format from #temp:XXXXXXXXXXXX to #aw_XXXXXXXXXXXX
as requested. The new format:
- Generated IDs: aw_ prefix + 12 hex characters (e.g., aw_abc123def456)
- Reference pattern: #aw_XXXXXXXXXXXX (e.g., #aw_abc123def456)
- Case-insensitive matching for references

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI requested a review from pelikhan November 25, 2025 00:04
@pelikhan pelikhan marked this pull request as ready for review November 25, 2025 00:08
Copilot AI review requested due to automatic review settings November 25, 2025 00:08
…-id-generation

# Conflicts:
#	.github/workflows/test-ollama-threat-detection.lock.yml
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Nov 25, 2025

@copilot merge main, accept all the deleted workflow lock files, recompile and finish merge.

Merged main, accepted all deleted workflow lock files, and recompiled workflows. Commit: ba408ae

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR enables agents to create parent issues and sub-issues that reference each other within the same workflow run by implementing a temporary ID system. Issues are assigned aw_ prefixed 12-character hex cryptographic IDs that resolve to actual issue numbers after creation.

Key changes:

  • New temporary_id.cjs utility module with ID generation, validation, and reference replacement functions
  • Enhanced create_issue safe output to support temporary IDs and reference resolution
  • Modified add_comment to support temporary ID references via environment variable
  • Cross-job communication through temporary_id_map job output

Reviewed changes

Copilot reviewed 41 out of 42 changed files in this pull request and generated no comments.

Show a summary per file
File Description
pkg/workflow/js/temporary_id.cjs New utility module providing temporary ID generation, validation, normalization, and reference replacement functions
pkg/workflow/js/temporary_id.test.cjs Comprehensive test suite for temporary_id.cjs covering all functions and edge cases
pkg/workflow/js/create_issue.cjs Enhanced to generate/use temporary IDs, resolve parent references, and replace ID references in issue bodies
pkg/workflow/js/create_issue.test.cjs Added tests for temporary ID functionality including parent resolution, reference replacement, and staged mode preview
pkg/workflow/js/add_comment.cjs Modified to load and use temporary ID map for resolving references in comment bodies
pkg/workflow/js/add_comment.test.cjs Added tests for temporary ID reference replacement in comments
pkg/workflow/js.go Registered temporary_id.cjs in JavaScript sources map for bundling
pkg/workflow/create_issue.go Added temporary_id_map output to create-issue job
pkg/workflow/add_comment.go Added GH_AW_TEMPORARY_ID_MAP environment variable from create_issue job output
pkg/workflow/js/types/safe-outputs.d.ts Updated CreateIssueItem interface to include temporary_id field and allow string for parent
pkg/workflow/js/safe_outputs_tools.json Updated create_issue tool schema with temporary_id field and updated parent field description
docs/src/content/docs/labs.mdx Documentation cleanup (removed cron schedule and test workflow entry)
.github/workflows/*.lock.yml Updated all compiled workflow files with the new temporary ID functionality

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Nov 25, 2025

✅ Agentic Changeset Generator completed successfully.

@pelikhan pelikhan merged commit cb8e818 into main Nov 25, 2025
93 of 94 checks passed
@pelikhan pelikhan deleted the copilot/add-temporary-id-generation branch November 25, 2025 01:04
mnkiefer pushed a commit that referenced this pull request Nov 25, 2025
* Initial plan

* Add temporary ID support for create_issue safe output

- Generate 12-char hex temporary IDs for issues created via safe outputs
- Store temporary_id -> issue_number mapping in job output
- Replace #temp:ID references in issue body with resolved issue numbers
- Support parent field referencing temporary IDs for sub-issue linking
- Pass temporary_id_map to add-comment job for reference resolution
- Add comprehensive tests for temporary ID functionality

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>

* Extract temporary ID functions to shared utility module

- Create temporary_id.cjs with shared functions for temporary ID handling
- Update create_issue.cjs and add_comment.cjs to use shared utility
- Add temporary_id.cjs to embedded JavaScript sources for bundling
- Add comprehensive tests for temporary_id.cjs module

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>

* Change temporary ID pattern to use aw_ prefix

Updated the temporary ID format from #temp:XXXXXXXXXXXX to #aw_XXXXXXXXXXXX
as requested. The new format:
- Generated IDs: aw_ prefix + 12 hex characters (e.g., aw_abc123def456)
- Reference pattern: #aw_XXXXXXXXXXXX (e.g., #aw_abc123def456)
- Case-insensitive matching for references

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants