Skip to content

Comments

Rename safe-outputs MCP server identifier to "safeoutputs" and update file paths#2305

Merged
pelikhan merged 7 commits intomainfrom
copilot/rename-safe-outputs-identifier
Oct 24, 2025
Merged

Rename safe-outputs MCP server identifier to "safeoutputs" and update file paths#2305
pelikhan merged 7 commits intomainfrom
copilot/rename-safe-outputs-identifier

Conversation

Copy link
Contributor

Copilot AI commented Oct 24, 2025

This PR renames the safe-outputs MCP server identifier from "safe_outputs" (with underscore) to "safeoutputs" (no separator) and updates all file paths to use the consistent naming convention, eliminating confusion between dash and underscore variations in the codebase.

Problem

The safe-outputs feature uses different naming conventions in different contexts:

  • File paths: /tmp/gh-aw/safe-outputs/ (with dash)
  • YAML frontmatter: safe-outputs: (with dash)
  • MCP server ID: "safe_outputs" (with underscore) ❌

This inconsistency created subtle bugs and confusion when developers needed to reference the MCP server identifier, as they had to remember whether to use a dash or underscore.

Solution

Standardize both the MCP server identifier and file paths to "safeoutputs" (no separator):

  • MCP server identifier: safeoutputs (no separator)
  • File system paths: /tmp/gh-aw/safeoutputs/ (no separator) - UPDATED
  • YAML frontmatter: safe-outputs: (with dash)
  • Prompt references: Use the constant value "safeoutputs" directly

Changes

1. Constant Definition

Added SafeOutputsMCPServerID = "safeoutputs" constant in pkg/constants/constants.go to centralize the identifier and prevent future inconsistencies.

2. Go Code Updates

  • mcp-config.go: Updated JSON and TOML rendering functions to use the constant
  • copilot_engine.go: Updated tool name detection in log parsing and --allow-tool argument generation
  • mcp_inspect.go: Updated filter function to use constant for filtering safe-outputs MCP servers
  • mcp.go (parser): Updated MCP server Name field assignments to use constant throughout server configuration logic
  • All workflow Go files: Updated file paths from /tmp/gh-aw/safe-outputs/ to /tmp/gh-aw/safeoutputs/
  • safe_outputs.go: Updated all prompt text to use constants.SafeOutputsMCPServerID directly

3. JavaScript Updates

  • safe_outputs_mcp_server.cjs: Changed SERVER_INFO.name from "safe-outputs-mcp-server" to "safeoutputs"
  • All JavaScript files: Updated file paths from /tmp/gh-aw/safe-outputs/ to /tmp/gh-aw/safeoutputs/

4. Path Updates

All file paths updated throughout the codebase:

  • /tmp/gh-aw/safe-outputs/config.json/tmp/gh-aw/safeoutputs/config.json
  • /tmp/gh-aw/safe-outputs/mcp-server.cjs/tmp/gh-aw/safeoutputs/mcp-server.cjs
  • /tmp/gh-aw/safe-outputs/outputs.jsonl/tmp/gh-aw/safeoutputs/outputs.jsonl
  • /tmp/gh-aw/safe-outputs/assets//tmp/gh-aw/safeoutputs/assets/

5. Prompt Text Updates

All workflow prompts now reference the MCP server by its constant ID:

  • Tool instruction text uses the constant value directly via fmt.Sprintf()
  • IMPORTANT notices reference the constant
  • All prompts consistently use "safeoutputs" (the constant value)

Examples from generated workflows:

  • "To create an issue, use the create-issue tool from safeoutputs"
  • "use the safeoutputs tools"

6. Test Updates

Updated expectations in 10 test files to use the new identifier and paths:

  • mcp_config_shared_test.go
  • copilot_engine_test.go
  • log_parser_test.go
  • safe_outputs_mcp_integration_test.go
  • mcp_config_refactor_test.go
  • logs_mcp_failure_test.go
  • mcp_inspect_test.go
  • mcp_list_tools_test.go
  • missing_tool_test.go
  • create_agent_task_integration_test.go

Example

Before:

{
  "mcpServers": {
    "safe_outputs": {
      "command": "node",
      "args": ["/tmp/gh-aw/safe-outputs/mcp-server.cjs"]
    }
  }
}

After:

{
  "mcpServers": {
    "safeoutputs": {
      "command": "node",
      "args": ["/tmp/gh-aw/safeoutputs/mcp-server.cjs"]
    }
  }
}

Generated Workflow Prompt Example:

Before:

To create an issue, use the create-issue tool from GitHub Agentic Workflows Safe Outputs

After:

To create an issue, use the create-issue tool from safeoutputs

Testing

  • ✅ All unit tests passing
  • ✅ Binary builds successfully
  • ✅ 65/65 workflows compiled successfully
  • ✅ JSON schema verified to still use "safe-outputs" (with dash) for frontmatter key
  • ✅ Comprehensive review of all safe_outputs and safe-outputs instances completed
  • ✅ Prompt text validated to use constant value in generated workflows

Impact

This change provides clearer naming conventions throughout the codebase and reduces the cognitive load when working with safe-outputs functionality. The MCP server identifier, file paths, and prompt references now use the same consistent convention (safeoutputs with no separator), while YAML frontmatter keys appropriately retain their dash-separated format ("safe-outputs").

All MCP server identifier references now consistently use the constants.SafeOutputsMCPServerID constant, all file paths use /tmp/gh-aw/safeoutputs/, and all workflow prompts reference the MCP server by its actual ID value.

Original prompt

Rename the identifer for the "safe-outputs" mcp server used in configuration to be "safeoutputs" without dash/underscore to avoid subtle safe-output vs safe_output.

Extract a constant in .go with the server id (safeoutputs) and use this constant in the all the generated code.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

…tputs

- Add SafeOutputsMCPServerID constant in pkg/constants/constants.go
- Update mcp-config.go to use constant for server ID
- Update copilot_engine.go to use constant in tool detection and allow-tool args
- Update safe_outputs_mcp_server.cjs SERVER_INFO name from "safe-outputs-mcp-server" to "safeoutputs"
- Update all test files to expect "safeoutputs" identifier instead of "safe_outputs"
  - mcp_config_shared_test.go
  - copilot_engine_test.go
  - log_parser_test.go
  - safe_outputs_mcp_integration_test.go
  - mcp_config_refactor_test.go
  - logs_mcp_failure_test.go

All unit tests passing.

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

@copilot look for all instances of safe_outputs or safe-outputs in the files and make sure it is updated.

Copilot AI changed the title [WIP] Rename identifier for safe-outputs mcp server Rename safe-outputs MCP server identifier from "safe_outputs" to "safeoutputs" Oct 24, 2025
Copilot AI requested a review from pelikhan October 24, 2025 18:29
@pelikhan
Copy link
Contributor

@copilot make sure the JSON schema / front matter still uses safe-outputs .

@pelikhan
Copy link
Contributor

@copilot

  • use /tmp/gh-aw/safeoutputs/ instead of /tmp/gh-aw/safe-outputs/ . Update all occurences.

- Update pkg/cli/mcp_inspect.go to use constants.SafeOutputsMCPServerID for filtering
- Update pkg/parser/mcp.go to use constant for MCP server Name field
- Update test files to use constant instead of hardcoded "safe-outputs" string:
  - pkg/cli/mcp_inspect_test.go
  - pkg/cli/mcp_list_tools_test.go
- Recompiled all 65 workflows successfully

This ensures all MCP server identifier references use the "safeoutputs" constant consistently throughout the codebase, while YAML frontmatter keys remain "safe-outputs" (with dash) as expected.

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

Copilot AI commented Oct 24, 2025

@copilot look for all instances of safe_outputs or safe-outputs in the files and make sure it is updated.

Done! I've reviewed all instances of safe_outputs and safe-outputs in the codebase and updated them appropriately.

Changes made in commit f590048:

  1. Updated MCP server identifier references in:

    • pkg/cli/mcp_inspect.go - filter function now uses constant
    • pkg/parser/mcp.go - server Name assignments now use constant
    • Test files: mcp_inspect_test.go and mcp_list_tools_test.go
  2. Key distinction maintained:

    • ✅ MCP server identifier (Name field): "safeoutputs" (constant)
    • ✅ YAML frontmatter keys: "safe-outputs" (with dash, unchanged)
    • ✅ File paths: /tmp/gh-aw/safe-outputs/ (with dash, unchanged)
    • ✅ User-facing text: "safe-outputs MCP" (with dash, unchanged)

All 65 workflows recompiled successfully with the new identifier. All unit tests passing.

@pelikhan
Copy link
Contributor

@copilot use facing text should be "GitHub Agentic Workflows Safe Outputs"

…tmp/gh-aw/safeoutputs/

- Updated all Go files in pkg/workflow/ to use new path
- Updated all JavaScript files in pkg/workflow/js/ to use new path
- Updated test files to use new path
- Recompiled all 65 workflows successfully
- JSON schema still correctly uses "safe-outputs" (with dash) for frontmatter key

Path changes:
- /tmp/gh-aw/safe-outputs/ → /tmp/gh-aw/safeoutputs/
- /tmp/gh-aw/safe-outputs/config.json → /tmp/gh-aw/safeoutputs/config.json
- /tmp/gh-aw/safe-outputs/mcp-server.cjs → /tmp/gh-aw/safeoutputs/mcp-server.cjs
- /tmp/gh-aw/safe-outputs/outputs.jsonl → /tmp/gh-aw/safeoutputs/outputs.jsonl
- /tmp/gh-aw/safe-outputs/assets/ → /tmp/gh-aw/safeoutputs/assets/

All unit tests passing.

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

Copilot AI commented Oct 24, 2025

@copilot make sure the JSON schema / front matter still uses safe-outputs .

Verified ✅ - The JSON schema in pkg/parser/schemas/main_workflow_schema.json and pkg/parser/schemas/included_file_schema.json correctly uses "safe-outputs" (with dash) for the frontmatter key. This remains unchanged and matches the YAML frontmatter convention.

@copilot

  • use /tmp/gh-aw/safeoutputs/ instead of /tmp/gh-aw/safe-outputs/ . Update all occurences.

Done! All file paths updated from /tmp/gh-aw/safe-outputs/ to /tmp/gh-aw/safeoutputs/ in commit 39041ba.

Updated paths:

  • /tmp/gh-aw/safeoutputs/config.json
  • /tmp/gh-aw/safeoutputs/mcp-server.cjs
  • /tmp/gh-aw/safeoutputs/outputs.jsonl
  • /tmp/gh-aw/safeoutputs/assets/

Files updated:

  • All Go files in pkg/workflow/
  • All JavaScript files in pkg/workflow/js/
  • All test files

All 65 workflows recompiled successfully. All unit tests passing.

Copilot AI changed the title Rename safe-outputs MCP server identifier from "safe_outputs" to "safeoutputs" Rename safe-outputs MCP server identifier to "safeoutputs" and update file paths Oct 24, 2025
…rkflows Safe Outputs"

- Updated all instruction text in pkg/workflow/safe_outputs.go
- Updated comment in pkg/workflow/js.go
- Recompiled all 65 workflows with new user-facing text

Changes user-facing references from "safe-outputs MCP" to the more descriptive "GitHub Agentic Workflows Safe Outputs" throughout all generated workflow prompts.

All unit tests passing.

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

Copilot AI commented Oct 24, 2025

@copilot use facing text should be "GitHub Agentic Workflows Safe Outputs"

Done! Updated all user-facing text from "safe-outputs MCP" to "GitHub Agentic Workflows Safe Outputs" in commit 5e3c304.

Changes:

  • Updated all tool instruction text in workflow prompts
  • Updated IMPORTANT notice text
  • Updated function comment documentation

Examples from generated workflows:

  • "To create an issue, use the create-issue tool from GitHub Agentic Workflows Safe Outputs"
  • "use the GitHub Agentic Workflows Safe Outputs tools"

All 65 workflows recompiled with the new user-facing text.

Copilot AI changed the title Rename safe-outputs MCP server identifier to "safeoutputs" and update file paths Rename safe-outputs MCP server identifier to "safeoutputs", update file paths, and improve user-facing text Oct 24, 2025
yaml.WriteString("\n")
yaml.WriteString(" \n")
yaml.WriteString(" **IMPORTANT**: To do the actions mentioned in the header of this section, use the **safe-outputs** tools, do NOT attempt to use `gh`, do NOT attempt to use the GitHub API. You don't have write access to the GitHub repo.\n")
yaml.WriteString(" **IMPORTANT**: To do the actions mentioned in the header of this section, use the **GitHub Agentic Workflows Safe Outputs** tools, do NOT attempt to use `gh`, do NOT attempt to use the GitHub API. You don't have write access to the GitHub repo.\n")
Copy link
Contributor

Choose a reason for hiding this comment

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

@copilot you should use the MCP server if constant here since it is a prompt.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done! Updated to use constants.SafeOutputsMCPServerID in commit 1a3e00a. The prompt now shows "use the safeoutputs tools" instead of the hardcoded text.

yaml.WriteString(" **Adding a Comment to an Issue or Pull Request**\n")
yaml.WriteString(" \n")
yaml.WriteString(" To add a comment to an issue or pull request, use the add-comments tool from the safe-outputs MCP\n")
yaml.WriteString(" To add a comment to an issue or pull request, use the add-comments tool from GitHub Agentic Workflows Safe Outputs\n")
Copy link
Contributor

Choose a reason for hiding this comment

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

@copilot use safeoutputs mcp server id constant

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done! Updated to use constants.SafeOutputsMCPServerID in commit 1a3e00a.

yaml.WriteString(" **Creating an Issue**\n")
yaml.WriteString(" \n")
yaml.WriteString(" To create an issue, use the create-issue tool from the safe-outputs MCP\n")
yaml.WriteString(" To create an issue, use the create-issue tool from GitHub Agentic Workflows Safe Outputs\n")
Copy link
Contributor

Choose a reason for hiding this comment

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

@copilot use safeouputs mcp server constant

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done! Updated to use constants.SafeOutputsMCPServerID in commit 1a3e00a.

yaml.WriteString(" **Creating an Agent Task**\n")
yaml.WriteString(" \n")
yaml.WriteString(" To create a GitHub Copilot agent task, use the create-agent-task tool from the safe-outputs MCP\n")
yaml.WriteString(" To create a GitHub Copilot agent task, use the create-agent-task tool from GitHub Agentic Workflows Safe Outputs\n")
Copy link
Contributor

Choose a reason for hiding this comment

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

Use MCP server constant ID here @copilot

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done! Updated to use constants.SafeOutputsMCPServerID in commit 1a3e00a.

yaml.WriteString(" 3. Add and commit your changes to the branch. Be careful to add exactly the files you intend, and check there are no extra files left un-added. Check you haven't deleted or changed any files you didn't intend to.\n")
yaml.WriteString(" 4. Do not push your changes. That will be done by the tool.\n")
yaml.WriteString(" 5. Create the pull request with the create-pull-request tool from the safe-outputs MCP\n")
yaml.WriteString(" 5. Create the pull request with the create-pull-request tool from GitHub Agentic Workflows Safe Outputs\n")
Copy link
Contributor

Choose a reason for hiding this comment

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

@copilot use MCP server constant here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done! Updated to use constants.SafeOutputsMCPServerID in commit 1a3e00a.

yaml.WriteString(" **Adding Labels to Issues or Pull Requests**\n")
yaml.WriteString(" \n")
yaml.WriteString(" To add labels to an issue or a pull request, use the add-labels tool from the safe-outputs MCP\n")
yaml.WriteString(" To add labels to an issue or a pull request, use the add-labels tool from GitHub Agentic Workflows Safe Outputs\n")
Copy link
Contributor

Choose a reason for hiding this comment

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

@copilot Use MCP server, constant ID when referring to safe outputs in these prompts

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done! All prompt references now use constants.SafeOutputsMCPServerID in commit 1a3e00a. Generated workflows show "use the create-issue tool from safeoutputs" and similar for all other tools.

…ed strings

- Import constants package in safe_outputs.go
- Replace all "GitHub Agentic Workflows Safe Outputs" text with constants.SafeOutputsMCPServerID
- Updated test expectations in missing_tool_test.go and create_agent_task_integration_test.go
- Recompiled all 65 workflows

Now prompts use "safeoutputs" (the MCP server ID constant) instead of the descriptive product name, making it consistent with how the MCP server is actually named in the configuration.

All unit tests passing.

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
@pelikhan pelikhan marked this pull request as ready for review October 24, 2025 20:33
Copilot AI review requested due to automatic review settings October 24, 2025 20:33
Copilot AI changed the title Rename safe-outputs MCP server identifier to "safeoutputs", update file paths, and improve user-facing text Rename safe-outputs MCP server identifier to "safeoutputs" and update file paths Oct 24, 2025
@github-actions
Copy link
Contributor

Agentic Changeset Generator triggered by this pull request.

Copilot AI requested a review from pelikhan October 24, 2025 20:33
Copy link
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 renames the safe-outputs MCP server identifier from "safe-outputs" (with hyphen) to "safeoutputs" (no separator) throughout the codebase to eliminate ambiguity between "safe-output" and "safe_output" variations. The changes introduce a new constant SafeOutputsMCPServerID = "safeoutputs" in pkg/constants/constants.go and update all references across Go source files, JavaScript files, test files, and generated workflow lock files to use this consistent identifier. File paths are also updated from /tmp/gh-aw/safe-outputs/ to /tmp/gh-aw/safeoutputs/, and user-facing prompt text now directly references the MCP server by its ID rather than using descriptive names.

Reviewed Changes

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

Show a summary per file
File Description
pkg/constants/constants.go Adds SafeOutputsMCPServerID constant
pkg/workflow/safe_outputs.go Updates prompt generation to use constant
pkg/workflow/mcp-config.go Updates MCP config rendering to use constant
pkg/workflow/copilot_engine.go Updates tool name detection and arguments
pkg/parser/mcp.go Updates MCP server name assignments
pkg/cli/mcp_inspect.go Updates server filtering logic
pkg/workflow/js/safe_outputs_mcp_server.cjs Updates server name and file paths
Test files (multiple) Updates test expectations to use new identifier and paths
Lock files (.github/workflows/*.lock.yml) Generated workflow files with updated paths and identifiers

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

@pelikhan pelikhan enabled auto-merge (squash) October 24, 2025 20:45
@pelikhan pelikhan merged commit a24de46 into main Oct 24, 2025
4 checks passed
@pelikhan pelikhan deleted the copilot/rename-safe-outputs-identifier branch October 24, 2025 20:45
Copilot AI added a commit that referenced this pull request Oct 24, 2025
Mossaka added a commit that referenced this pull request Oct 24, 2025
* Initial plan

* Create smoke-copilot.firewall.md workflow with firewall enabled

Co-authored-by: Mossaka <5447827+Mossaka@users.noreply.github.com>

* Update .github/workflows/smoke-copilot.firewall.md

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Add changeset for smoke-copilot.firewall workflow

* Fix safe-outputs parameter and add smoke-copilot.firewall to smoke-detector

Co-authored-by: Mossaka <5447827+Mossaka@users.noreply.github.com>

* Rename safe-outputs MCP server identifier to "safeoutputs" and update file paths (#2305)

* Fix CI test failure by updating to safeoutputs identifier

Co-authored-by: Mossaka <5447827+Mossaka@users.noreply.github.com>

* Co-authored-by: Mossaka <5447827+Mossaka@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Mossaka <5447827+Mossaka@users.noreply.github.com>
Co-authored-by: Jiaxiao Zhou <duibao55328@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
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.

2 participants