Skip to content

Add title deduplication for safe output descriptions - #6088

Merged
pelikhan merged 5 commits into
mainfrom
copilot/add-remove-title-from-description-function
Dec 11, 2025
Merged

Add title deduplication for safe output descriptions#6088
pelikhan merged 5 commits into
mainfrom
copilot/add-remove-title-from-description-function

Conversation

CopilotAI commented Dec 11, 2025

Copy link
Copy Markdown
Contributor

Implementation Complete

  • Create JavaScript helper function removeDuplicateTitleFromDescription(title, description) in pkg/workflow/js/remove_duplicate_title.cjs
  • Add comprehensive test suite in pkg/workflow/js/remove_duplicate_title.test.cjs (50 tests)
  • Apply helper to create_issue.cjs, create_discussion.cjs, create_pull_request.cjs
  • Apply helper to update_issue.cjs and update_pull_request.cjs via update_runner.cjs
  • Register helper in script registry and bundler
    • Added //go:embed directive for remove_duplicate_title.cjs in pkg/workflow/js.go
    • Added entry to GetJavaScriptSources() map for bundling
    • Helper is now automatically bundled into all scripts that require it
  • All tests pass (JavaScript: 2054, Go unit tests pass)
  • Build, format, lint successful

Changes

The helper function is now properly registered in the bundler system:

  • File: pkg/workflow/js.go
  • Added //go:embed js/remove_duplicate_title.cjs directive
  • Added "remove_duplicate_title.cjs": removeDuplicateTitleScript to GetJavaScriptSources() map
  • Verified bundling works for all 5 scripts that use the helper (create_issue, create_discussion, create_pull_request, update_issue, update_pull_request)
Original prompt

When creating an issue/discussion/pull request (any item with a title and description), add a JavaScript function that removes the duplicate title in the description

If the the title is T, and description start with # T, trim out the title in the description as it is already shown with the title

Create a JavaScript helper function that takes title/description and remove title from description , add extensive test suite

Any header level can be removed as long as it is be starting text

Apply to safe outputs that have title and description


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.


Changeset

  • Type: patch
  • Description: Add JavaScript helper to remove duplicate titles from safe output descriptions and register it in the JS bundler; applied to create/update scripts for issues, discussions, and PRs.

Ahoy! This treasure was crafted by 🏴‍☠️ Changeset Generator

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

Copy link
Copy Markdown
Collaborator

@copilot register helper in script registry, bundler

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

This comment has been minimized.

CopilotAI changed the title [WIP] Add function to remove duplicate title from descriptionAdd title deduplication for safe output descriptionsDec 11, 2025
CopilotAI requested a review from pelikhanDecember 11, 2025 03:58
@pelikhan

Copy link
Copy Markdown
Collaborator

@copilot review bundling to make sure the new helper gets treated as GitHub script and bundled

@github-actions

Copy link
Copy Markdown
Contributor

Test Hide Older Comments - Run Complete ✅

Workflow Run ID: 20121471273
Timestamp: 2025-12-11T04:00:46.470Z

This comment was generated to test the hide-older-comments field. When this workflow runs again, previous comments from the same workflow should be hidden automatically.


This is an automated test comment

Ahoy! This treasure was crafted by 🏴‍☠️ Test Hide Older Comments fer issue #6088 🗺️

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

CopilotAI commented Dec 11, 2025

Copy link
Copy Markdown
ContributorAuthor

@copilot register helper in script registry, bundler

Done in cdf1997. The remove_duplicate_title.cjs helper is now registered in the script registry and bundler:

  • Added //go:embed directive in pkg/workflow/js.go
  • Added entry to GetJavaScriptSources() map
  • Helper is now automatically bundled into all scripts that use it (verified for create_issue, create_discussion, create_pull_request, update_issue, update_pull_request)

@github-actions

Copy link
Copy Markdown
Contributor

📰 BREAKING: Smoke Copilot is now investigating this pull request. Sources say the story is developing...

@github-actions

Copy link
Copy Markdown
Contributor

🔮 The ancient spirits stir... Smoke Codex awakens to divine this pull request...

@github-actions

github-actionsBot commented Dec 11, 2025

Copy link
Copy Markdown
Contributor

🎉 Yo ho ho! Changeset Generator found the treasure and completed successfully! ⚓💰

fc80ace

@github-actions

Copy link
Copy Markdown
Contributor

💥 WHOOSH!Smoke Claude springs into action on this pull request! [Panel 1 begins...]

@github-actions

Copy link
Copy Markdown
Contributor

📰 BREAKING: Smoke Copilot Playwright is now investigating this pull request. Sources say the story is developing...

@github-actions

Copy link
Copy Markdown
Contributor

📰🚀🔍👀📡🕵️ https://github.com/githubnext/gh-aw/actions/runs/20121774251

@github-actions

Copy link
Copy Markdown
Contributor

Last 2 PRs:#6073 (hide-older-comments), #6083 (runtime-import)
✅ File write: /tmp/gh-aw/agent/smoke-test-copilot-20121774263.txt
✅ Bash: File verified
✅ GitHub MCP: Listed PRs (default toolset works)
❌ get_me: Not available (expected - not in default toolset)
✅ Cache memory: /tmp/gh-aw/cache-memory/smoke-test-20121774263.txt

Status: PASS

📰 BREAKING: Report filed by Smoke Copilot fer issue #6088 🗺️

@github-actions

Copy link
Copy Markdown
Contributor

Smoke test results:

🔮 The oracle has spoken through Smoke Codex fer issue #6088 🗺️

@github-actions

Copy link
Copy Markdown
Contributor

Smoke Test Results

Recent PRs:

Test Results:

  • ✅ GitHub MCP: Retrieved 2 merged PRs
  • ✅ File Writing: Created /tmp/gh-aw/agent/smoke-test-claude-20121774250.txt
  • ✅ Bash Tool: Verified file content successfully
  • ✅ Playwright MCP: Navigated to GitHub, title contains "GitHub"
  • ✅ Cache Memory: Created /tmp/gh-aw/cache-memory/smoke-test-20121774250.txt
  • ❌ Safe Input gh Tool: Tool not available

Status: PASS (5/6 tests passed)

💥 [THE END] — Illustrated by Smoke Claude fer issue #6088 🗺️

@github-actions

Copy link
Copy Markdown
Contributor

Smoke Test Results (Run 20121774253)

Playwright MCP: Successfully navigated to https://github.com - page title verified: "GitHub · Change is constant. GitHub keeps you ahead. · GitHub"
Cache Memory: Test file created and verified at /tmp/gh-aw/cache-memory/smoke-test-20121774253.txt
Safe Inputs gh: Failed with API connection error (HTTP/HTTPS mismatch)

Status: FAIL (1/3 tests passed)

📰 BREAKING: Report filed by Smoke Copilot Playwright fer issue #6088 🗺️

@github-actions

Copy link
Copy Markdown
Contributor

Smoke Test Results (Run #20121774251)

Test Results:

  • ❌ GitHub MCP: safeinputs-gh tool failed (HTTP/HTTPS client error)
  • ✅ File Writing: Created test file successfully
  • ✅ Bash Tool: Verified file creation
  • ❌ Serena MCP: gh-aw binary not available
  • ❌ Safe Input gh: safeinputs-gh tool connectivity issue

Overall Status: FAIL

The safeinputs-gh tool has configuration issues preventing GitHub API access.

📰🔥📋 https://github.com/githubnext/gh-aw/actions/runs/20121774251 fer issue #6088 🗺️

@pelikhan
pelikhan marked this pull request as ready for review December 11, 2025 04:22
@pelikhan
pelikhan merged commit 087f2c3 into mainDec 11, 2025
8 of 10 checks passed
@pelikhan
pelikhan deleted the copilot/add-remove-title-from-description-function branch December 11, 2025 04:22
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@pelikhan