Repository navigation
Conversation
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]>
There was a problem hiding this comment.
🔵 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.AtomicWriteFiledirectly.
| 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)
🔒 mcpg Read-Only Stress — defaultSurface coverage: MCP tool calls + proxied CLI (REST) + GraphQL mutations
Overall: INCONCLUSIVE No write leaked in any part.
|
🤖 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
sys.IsHostNetworkMode(test-only; production usessys.IsHostNetwork) and its tests.proxy.hasAliasedPRResource(production useshasAliasedPRResourceParsed) and its test-only file. Note: the alias-detection logic itself stays covered throughhasAliasedPRResourceParsedcallers; the deleted test file only exercised the thin wrapper.mcp.BuildMCPTextResponsealias; callers (proxy,server/system_tools, tests) now usemcpresult.NewTextResponse, which is already covered bymcpresult/text_response_test.go.logger.atomicWriteFilepass-through;writeJSONToFilecallsutil.AtomicWriteFiledirectly. The removedlogger/atomic_write_test.goduplicatedinternal/util/atomic_write*_test.go.No behaviour change.
Test Status
make agent-finishedpassed (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.comnonexistent.localslow.example.comthishostdoesnotexist12345.comTo allow these domains, add them to the
network.allowedlist in your workflow frontmatter:See Network Configuration for more information.
Add this agentic workflow to your repo
To install this agentic workflow, run