Skip to content

[Repo Assist] refactor: remove dead helpers and pass-through aliases (#16964) - #17003

Merged
lpcox merged 1 commit into
mainfrom
repo-assist/improve-remove-dead-aliases-20261121-47b159afdc8413fd
Nov 21, 2026
Merged

lpcox merged 1 commit into
mainfrom
repo-assist/improve-remove-dead-aliases-20261121-47b159afdc8413fd

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

🤖 This is an automated PR from Repo Assist.

Addresses items 2–5 of #16964 (does not close it; items 1, 6, 7, 8 remain).

Changes

  • Remove sys.IsHostNetworkMode (test-only; production uses sys.IsHostNetwork) and its tests.
  • Remove unused proxy.hasAliasedPRResource (production uses hasAliasedPRResourceParsed) and its test-only file. Note: the alias-detection logic itself stays covered through hasAliasedPRResourceParsed callers; the deleted test file only exercised the thin wrapper.
  • Remove mcp.BuildMCPTextResponse alias; callers (proxy, server/system_tools, tests) now use mcpresult.NewTextResponse, which is already covered by mcpresult/text_response_test.go.
  • Remove logger.atomicWriteFile pass-through; writeJSONToFile calls util.AtomicWriteFile directly. The removed logger/atomic_write_test.go duplicated internal/util/atomic_write*_test.go.

No behaviour change.

Test Status

make agent-finished passed (format, build, lint, all Go tests, 730 Rust guard tests).

Warning

Firewall blocked 4 domains

The following domains were blocked by the firewall during workflow execution:

  • example.com
  • nonexistent.local
  • slow.example.com
  • thishostdoesnotexist12345.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "example.com"
    - "nonexistent.local"
    - "slow.example.com"
    - "thishostdoesnotexist12345.com"

See Network Configuration for more information.

Generated by Repo Assist · copilot · routed: sonnet55 high · ~63 AIC · ⊞ 9.5K · ◷
Comment /repo-assist to run again

Add this agentic workflow to your repo

To install this agentic workflow, run

gh aw add githubnext/agentics/workflows/repo-assist.md@851905c06e905bf362a9f6cc54f912e3df747d55

Remove sys.IsHostNetworkMode, proxy hasAliasedPRResource, mcp.BuildMCPTextResponse
(callers use mcpresult.NewTextResponse) and logger.atomicWriteFile (callers use
util.AtomicWriteFile). Partially addresses #16964.

Co-authored-by: Copilot <[email protected]>
@lpcox
lpcox marked this pull request as ready for review November 21, 2026 16:38
Copilot AI adaptive review requested due to automatic review settings November 21, 2026 16:38

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

The generic secret scan did not complete, leaving potential secret exposure unverified and requiring human review.

No open issues 🎉

What changed in this PR

This pull request removes unused test-only helpers and redundant pass-through aliases identified in issue #16964, redirecting callers to canonical implementations while preserving production behavior.

Changes:

  • Removes the unused host-network and GraphQL alias helpers and related tests.
  • Replaces the MCP response alias with mcpresult.NewTextResponse.
  • Removes the logger atomic-write pass-through and uses util.AtomicWriteFile directly.
File Description
internal/​sys/​docker.go Removes the unused IsHostNetworkMode helper.
internal/​sys/​docker_test.go Removes tests for the deleted host-network helper.
internal/​server/​system_tools.go Uses mcpresult.NewTextResponse directly.
internal/​server/​circuit_breaker_test.go Updates test response construction to use the canonical MCP result implementation.
internal/​proxy/​proxy.go Uses mcpresult.NewTextResponse directly for proxy responses.
internal/​proxy/​graphql.go Removes the unused GraphQL alias-detection wrapper.
internal/​proxy/​graphql_aliased_pr_test.go Removes tests targeting the deleted GraphQL alias wrapper.
internal/​middleware/​jqschema_test.go Updates test response construction to use mcpresult.NewTextResponse.
internal/​mcp/​tool_result.go Removes the redundant BuildMCPTextResponse alias.
internal/​mcp/​tool_result_test.go Updates tests to use mcpresult.NewTextResponse directly.
internal/​logger/​write_json_to_file_test.go Updates test documentation and descriptions for direct atomic writes.
internal/​logger/​observed_url_domains_logger_test.go Updates test documentation for direct atomic writes.
internal/​logger/​fileutil.go Calls util.AtomicWriteFile directly instead of through a logger pass-through.
internal/​logger/​atomic_write_test.go Removes duplicate tests for the deleted logger atomic-write wrapper.

Review effort: Lite (adaptive)

@github-actions

Copy link
Copy Markdown
Contributor Author

🔒 mcpg Read-Only Stress — default

Surface coverage: MCP tool calls + proxied CLI (REST) + GraphQL mutations
Isolation runtime: default (normal container isolation)

Part Surface Op Result Expected Status
A MCP reads (list_issues, list_pull_requests, get_file_contents, list_commits) data returned ALLOWED ✅
B MCP writes (star_repository, add_issue_comment, issue_write, create_branch, create_or_update_file, create_pull_request) all 6 absent from catalog, unknown tool (-32602) BLOCKED ⚠️
C CLI reads (list_issues, list_pull_requests, get_file_contents, list_commits via proxied github CLI) data returned ALLOWED ✅
D CLI REST writes (reaction/star/issue/comment) not exercised, gh unauthenticated BLOCKED ⚠️
E CLI GraphQL mutations (addReaction/addStar/createIssue) not exercised, gh unauthenticated BLOCKED ⚠️

Overall: INCONCLUSIVE

⚠️ Part B: all 6 targeted write tools were absent from the exposed GitHub MCP tool catalog (only 23 read-only tools registered), so refusal only proves gh-aw's backend GITHUB_READ_ONLY=1 config, not mcpg's independent gateway-level DIFC/guard enforcement.

⚠️ Parts D/E: gh auth status reported "not logged into any GitHub hosts", so the GitHub-token-scope boundary could not be exercised this run.

No write leaked in any part.

🔒 mcpg read-only stress (default AWF runtime) by Read-Only Stress: default runtime

@lpcox
lpcox merged commit 6ea9e25 into main Nov 21, 2026
28 checks passed
@lpcox
lpcox deleted the repo-assist/improve-remove-dead-aliases-20261121-47b159afdc8413fd branch November 21, 2026 16:57
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