Skip to content

Enable template substitution and safeinputs proxying in AWMG gateway#8700

Merged
pelikhan merged 3 commits intomainfrom
copilot/apply-template-substitution
Jan 3, 2026
Merged

Enable template substitution and safeinputs proxying in AWMG gateway#8700
pelikhan merged 3 commits intomainfrom
copilot/apply-template-substitution

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Jan 3, 2026

The AWMG gateway needs to expand ${VAR} template expressions in MCP server configurations and proxy safeinputs/safeoutputs servers.

Changes

  • Template substitution: Apply os.ExpandEnv() to URL, headers, and env fields during config parsing
  • Remove safeinputs/safeoutputs filtering: Proxy these servers through the gateway like any other MCP server

Example

Configuration with template expressions:

{
  "mcpServers": {
    "safeinputs": {
      "type": "http",
      "url": "http://localhost:${GH_AW_SAFE_INPUTS_PORT}",
      "headers": {
        "Authorization": "Bearer ${GH_AW_SAFE_INPUTS_API_KEY}"
      }
    }
  }
}

With environment variables set (GH_AW_SAFE_INPUTS_PORT=3000, GH_AW_SAFE_INPUTS_API_KEY=secret), the gateway now:

  1. Expands templates to actual values
  2. Proxies safeinputs at http://localhost:8080/mcp/safeinputs
  3. Rewrites client config to point to gateway endpoint

Test Coverage

  • Template substitution for URL, headers, env fields
  • SafeInputs/safeoutputs inclusion and proxying
  • Config rewrite behavior for internal servers
Original prompt

The awmg gateway should apply the template substitution in ${name} expressions and gateway the safeinputs server.


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

Copilot AI self-assigned this Jan 3, 2026
- Apply os.ExpandEnv to URL, headers, and env fields in MCP server configs
- Remove filtering of safeinputs/safeoutputs servers - they are now proxied
- Update tests to reflect new behavior
- All tests passing

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Add template substitution for ${name} expressions Enable template substitution and safeinputs proxying in AWMG gateway Jan 3, 2026
Copilot AI requested a review from pelikhan January 3, 2026 01:39
@pelikhan pelikhan added the smoke label Jan 3, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jan 3, 2026

📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jan 3, 2026

🎉 Yo ho ho! Smoke Copilot Safe Inputs found the treasure and completed successfully! ⚓💰

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jan 3, 2026

✨ The prophecy is fulfilled... Smoke Codex has completed its mystical journey. The stars align. 🌟

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jan 3, 2026

🎬 THE ENDSmoke Claude MISSION: ACCOMPLISHED! The hero saves the day! ✨

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jan 3, 2026

✅ Firewall validation complete... Smoke Codex Firewall confirmed network sandboxing is operational. 🛡️

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jan 3, 2026

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

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jan 3, 2026

🤖 DIAGNOSTIC COMPLETE: Smoke Copilot No Firewall STATUS: ALL_UNITS_OPERATIONAL. MISSION_SUCCESS.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jan 3, 2026

📰 VERDICT: Smoke Copilot Playwright has concluded. All systems operational. This is a developing story. 🎤

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jan 3, 2026

Copilot Smoke Test Results

Last 2 merged PRs:

Test Results:

  • ✅ GitHub MCP Testing (retrieved merged PRs)
  • ✅ File Writing Testing (/tmp/gh-aw/agent/smoke-test-copilot-20670601114.txt)
  • ✅ Bash Tool Testing (verified file creation with cat)
  • ✅ GitHub MCP Default Toolset Testing (get_me tool not available - confirmed)
  • ✅ Cache Memory Testing (/tmp/gh-aw/cache-memory/smoke-test-20670601114.txt)
  • ✅ Available Tools: add_comment, add_labels, create_issue, missing_tool, noop

Overall Status: ✅ PASS

@pelikhan (PR author/assignee)

AI generated by Smoke Copilot

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jan 3, 2026

Smoke Test Results - Run 20670601131

✅ Last 2 merged PRs reviewed: #8699, #8694
✅ Test file created: /tmp/gh-aw/agent/smoke-test-copilot-20670601131.txt
✅ Playwright navigation: github.com (title verified)
✅ GitHub CLI: Listed 3 issues (#8698, #8610, #8606)

AI generated by Smoke Copilot No Firewall

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jan 3, 2026

MCP merged PR titles: Security Fix: Prevent path traversal in shell completion config file reads (Alerts #444, #443); Resolve Setup action tags to SHAs in release mode using action pin manager
✅ OpenAI curl blocked
✅ MCP merged PRs fetched
✅ File write/read
✅ Blocked domain curl blocked
Network: SANDBOXED
Overall: PASS

AI generated by Smoke Codex Firewall

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jan 3, 2026

Smoke Test Results: FAIL

Playwright MCP: Tool not available in environment
Cache Memory: File written and verified successfully
safeinputs-gh: Tool not available in environment

Status: FAIL - 1/3 tests passed

AI generated by Smoke Copilot Playwright

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jan 3, 2026

Smoke Test Results (Claude Sonnet 4.5)

Last 2 merged PRs:

Test Results:

  • ✅ GitHub MCP: Fetched PRs successfully
  • ✅ File Write: Created /tmp/gh-aw/agent/smoke-test-claude-20670601098.txt
  • ✅ Bash Tool: Verified file creation
  • ✅ Playwright MCP: Navigated to GitHub.com, title contains "GitHub"
  • ✅ Cache Memory: Created /tmp/gh-aw/cache-memory/smoke-test-20670601098.txt
  • ❌ safeinputs-gh: Tool not available in this workflow

Status: PASS (5/6 tests passed; safeinputs-gh not configured)

AI generated by Smoke Claude

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jan 3, 2026

PRs: #8699 "Security Fix: Prevent path traversal in shell completion config file reads (Alerts #444, #443)", #8694 "Resolve Setup action tags to SHAs in release mode using action pin manager"
GitHub MCP PR fetch: ✅
File write/read (/tmp/gh-aw/agent): ✅
Playwright title check (github.com): ✅
Cache memory write/read: ✅
safeinputs-gh "gh issues list --limit 3": ❌ (command not found)
Overall: FAIL

AI generated by Smoke Codex

@pelikhan pelikhan marked this pull request as ready for review January 3, 2026 02:04
@pelikhan pelikhan merged commit 0f28b67 into main Jan 3, 2026
49 checks passed
@pelikhan pelikhan deleted the copilot/apply-template-substitution branch January 3, 2026 02:05
Sign up for free to 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