Skip to content

Bypass agent ENTRYPOINT in rootless artifact permission repair#6342

Merged
lpcox merged 3 commits into
mainfrom
copilot/rootless-artifact-permission-repair
Jul 18, 2026
Merged

Bypass agent ENTRYPOINT in rootless artifact permission repair#6342
lpcox merged 3 commits into
mainfrom
copilot/rootless-artifact-permission-repair

Conversation

Copilot AI commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Rootless artifact permission repair was invoking the agent image without overriding its ENTRYPOINT, so the repair command never ran and each directory incurred a deterministic ~30s timeout. This change routes the repair through sh directly so chown/chmod executes as intended and preserves actionable failure details when errors are emitted on stdout.

  • Repair path correction (core fix)

    • In fixArtifactPermissionsForRootless(), docker run now sets --entrypoint sh.
    • The command is passed directly as -c 'chown ...; chmod ...', avoiding entrypoint.sh/iptables wait logic entirely.
  • Failure observability

    • Non-zero exits now report stderr, with fallback to stdout when stderr is empty.
    • This surfaces timeout text from stdout-only failure modes instead of logging an empty-detail warning.
  • Contract coverage updates

    • Updated tests to assert the new invocation shape (--entrypoint sh, -c ... command).
    • Added coverage for stdout-only failure logging behavior.
// before: image ENTRYPOINT intercepted this
docker run ... <agent-image> sh -c 'chown ...; chmod ...'

// after: run repair command directly in shell
docker run ... --entrypoint sh <agent-image> -c 'chown -R "$TUID:$TGID" /fix 2>/dev/null; chmod -R a+rwX /fix'

Copilot AI changed the title [WIP] Fix rootless artifact permission repair execution issue Bypass agent ENTRYPOINT in rootless artifact permission repair Jul 18, 2026
Copilot finished work on behalf of lpcox July 18, 2026 04:37
Copilot AI requested a review from lpcox July 18, 2026 04:37
@lpcox
lpcox marked this pull request as ready for review July 18, 2026 05:03
Copilot AI review requested due to automatic review settings July 18, 2026 05:04

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.

Pull request overview

Fixes rootless artifact permission repair by bypassing the agent image entrypoint and improves failure diagnostics.

Changes:

  • Runs repair commands directly through sh.
  • Falls back to stdout when stderr is empty.
  • Updates invocation and logging tests.
Show a summary per file
File Description
src/artifact-permissions.ts Corrects repair execution and error reporting.
src/artifact-permissions.test.ts Tests shell invocation and stdout fallback.
src/artifact-preservation-errors.test.ts Updates preservation contract expectations.

Review details

Tip

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

  • Files reviewed: 3/3 changed files
  • Comments generated: 0
  • Review effort level: Medium

@github-actions

Copy link
Copy Markdown
Contributor

✅ Copilot review passed with no inline comments.

@copilot Add the ready-for-aw label to this PR to trigger agentic CI smoke tests.

@github-actions

github-actions Bot commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

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

@github-actions

github-actions Bot commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

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

@github-actions

github-actions Bot commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Smoke Copilot BYOK completed. Copilot BYOK mode operational. 🔓

@github-actions

github-actions Bot commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

📡 Smoke OTel Tracing completed. All tracing scenarios validated. ✅

@github-actions

github-actions Bot commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

🔌 Smoke Services — All services reachable! ✅

@github-actions

github-actions Bot commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Smoke Copilot BYOK AOAI (api-key) completed. Copilot AOAI BYOK (api-key) mode operational. 🔓

@github-actions

github-actions Bot commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

🛡️ Smoke Copilot Network Isolation confirmed the egress allowlist is enforced. ✅

@github-actions

github-actions Bot commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Chroot tests passed! Smoke Chroot - All security and functionality tests succeeded.

@github-actions

github-actions Bot commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Build Test Suite completed successfully!

@github-actions

github-actions Bot commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

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

@github-actions

github-actions Bot commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Smoke Copilot BYOK AOAI (Entra) completed. Copilot AOAI BYOK (Entra) mode operational. 🔓

@github-actions

github-actions Bot commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

🔑 Smoke Copilot PAT PAT auth validated. All systems operational. ✅

@github-actions

Copy link
Copy Markdown
Contributor

🚀 Security Guard has started processing this pull request

@github-actions

github-actions Bot commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Smoke Gemini completed. All facets verified. 💎

@github-actions

github-actions Bot commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Contribution Check completed successfully!

No comment needed: the PR includes tests for the new rootless artifact permission repair path, references the related issue, and stays within existing src/test file organization.

@github-actions

github-actions Bot commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

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

@github-actions

github-actions Bot commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

🔑 Smoke Copilot PAT PAT auth validated. All systems operational. ✅

@github-actions

github-actions Bot commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Smoke Copilot BYOK AOAI (Entra) completed. Copilot AOAI BYOK (Entra) mode operational. 🔓

@github-actions

github-actions Bot commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Smoke Copilot BYOK AOAI (api-key) completed. Copilot AOAI BYOK (api-key) mode operational. 🔓

@github-actions

github-actions Bot commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Smoke Claude passed

@github-actions

Copy link
Copy Markdown
Contributor

🚀 Security Guard has started processing this pull request

@github-actions

github-actions Bot commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Contribution Check completed successfully!

PR #6342 follows CONTRIBUTING.md: tests included, description references #6334, and changes stay in src/tests with no docs update needed.

@github-actions

Copy link
Copy Markdown
Contributor

Smoke Test: Claude Engine Validation

Check Result
API Status ✅ PASS
GH Check ✅ PASS
File Status ✅ PASS

Overall Result: PASS

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • awmgmcpg

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

network:
  allowed:
    - defaults
    - "awmgmcpg"

See Network Configuration for more information.

Generated by Smoke Claude for #6342 · 55.4 AIC · ⊞ 3.3K ·
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor

🎯 Smoke Test: Copilot BYOK (Direct) Mode

PASS — All tests successful

Test Status
GitHub MCP connectivity
GitHub.com HTTP (200)
File I/O
BYOK inference path

Running in direct BYOK mode (COPILOT_API_KEY) via api-proxy → api.githubcopilot.com

CC: @lpcox

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • awmgmcpg

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

network:
  allowed:
    - defaults
    - "awmgmcpg"

See Network Configuration for more information.

🔑 BYOK report filed by Smoke Copilot BYOK
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor

Smoke test: Copilot network isolation egress enforcement

EGRESS_RESULT allow=pass deny=pass

✅ Test 1 (allowed domain api.github.com): allowed=200
✅ Test 2 (blocked domain example.com): OK: example.com was blocked

Overall: PASS

@lpcox

Warning

Firewall blocked 2 domains

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

  • awmgmcpg
  • example.com

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

network:
  allowed:
    - defaults
    - "awmgmcpg"
    - "example.com"

See Network Configuration for more information.

🛡️ Egress verdict from Smoke Copilot Network Isolation
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor

Smoke Test Results — PAT Auth

Test Result
GitHub MCP connectivity ✅ verified
GitHub.com HTTP ⚠️ pre-step data not injected
File write/read ⚠️ pre-step data not injected

Auth mode: PAT (COPILOT_GITHUB_TOKEN)
Pre-step outputs were not expanded — smoke-data step may have failed.

Overall: INCONCLUSIVE

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • awmgmcpg

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

network:
  allowed:
    - defaults
    - "awmgmcpg"

See Network Configuration for more information.

🔑 PAT report filed by Smoke Copilot PAT
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor

🔥 Smoke Test Results

Test Status
GitHub MCP Connectivity
GitHub.com HTTP ✅ 200
File Write/Read ✅ Verified

Overall: PASS

cc @lpcox

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • awmgmcpg

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

network:
  allowed:
    - defaults
    - "awmgmcpg"

See Network Configuration for more information.

📰 BREAKING: Report filed by Smoke Copilot
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor

Smoke Test: PASS\n- fix: bypass AWF entrypoint in rootless artifact permission repair ✅\n- fix: set AWF_GEMINI_ENABLED for Vertex AI users (googleApiKey) ✅\n- GitHub title check ✅\n- file write/read ✅\n- build ✅\nOverall: PASS

Warning

Firewall blocked 2 domains

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

  • awmgmcpg
  • registry.npmjs.org

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

network:
  allowed:
    - defaults
    - "awmgmcpg"
    - "registry.npmjs.org"

See Network Configuration for more information.

🔮 The oracle has spoken through Smoke Codex
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor

Smoke Test: Services Connectivity

  • Redis (host.docker.internal:6379): ❌ DNS resolution failed
  • PostgreSQL pg_isready (host.docker.internal:5432): ❌ DNS resolution failed
  • PostgreSQL SELECT 1: ❌ DNS resolution failed

host.docker.internal does not resolve inside the AWF sandbox (no default gateway, Docker embedded DNS returns SERVFAIL).

Overall: FAIL

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • awmgmcpg

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

network:
  allowed:
    - defaults
    - "awmgmcpg"

See Network Configuration for more information.

🔌 Service connectivity validated by Smoke Services
Add label ready-for-aw to run again

@github-actions github-actions Bot mentioned this pull request Jul 18, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Smoke Test: API Proxy OpenTelemetry Tracing

Scenario Result Notes
1. Module Loading PASS otel.js loads; exports: startRequestSpan, setTokenAttributes, setBudgetAttributes, endSpan, endSpanError, shutdown, isEnabled
2. Test Suite PASS 39 tests pass (otel.test.js) + 20 tests pass (otel-fanout.test.js); 0 failures
3. Env Var Forwarding EXPECTED-PENDING No OTEL env vars forwarded in src/services/api-proxy-service.ts or src/docker-manager.ts yet
4. Token Tracker Integration PASS onUsage callback exists in token-tracker-http.js as the OTEL hook point
5. OTEL Diagnostics PASS FileSpanExporter used as fallback when no OTLP config; graceful degradation confirmed

Overall: All scenarios pass or are expected-pending during development.

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • awmgmcpg

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

network:
  allowed:
    - defaults
    - "awmgmcpg"

See Network Configuration for more information.

📡 OTel tracing validated by Smoke OTel Tracing
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor

Chroot Version Comparison Results

Runtime Host Version Chroot Version Match?
Python Python 3.12.13 Python 3.12.3 ❌ NO
Node.js v24.18.0 v22.23.1 ❌ NO
Go go1.22.12 go1.22.12 ✅ YES

Not all tests passed — smoke-chroot label not added.

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • awmgmcpg

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

network:
  allowed:
    - defaults
    - "awmgmcpg"

See Network Configuration for more information.

Tested by Smoke Chroot
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor

@lpcox Smoke Test Results

  • MCP Testing: ✅
  • GitHub.com: ✅
  • File Write/Read: ✅
  • BYOK Inference: ✅

Running direct BYOK mode (github-oidc + AWF_AUTH_AZURE_* + COPILOT_PROVIDER_BASE_URL)
Overall: PASS

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • awmgmcpg

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

network:
  allowed:
    - defaults
    - "awmgmcpg"

See Network Configuration for more information.

🪪 BYOK (AOAI Entra) report filed by Smoke Copilot BYOK AOAI (Entra)
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor

@lpcox

  • Merged PRs: pre-fetched data validated ✅
  • GitHub.com connectivity: ✅
  • File write/read test: ✅
  • BYOK inference test: ✅

Running in direct BYOK mode (COPILOT_PROVIDER_API_KEY + COPILOT_PROVIDER_BASE_URL) via api-proxy → Azure OpenAI (Foundry, o4-mini-aw)

Overall: PASS

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • awmgmcpg

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

network:
  allowed:
    - defaults
    - "awmgmcpg"

See Network Configuration for more information.

🔑 BYOK (AOAI api-key) report filed by Smoke Copilot BYOK AOAI (api-key)
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor

🔥 Smoke Test: Docker Sbx — PASS

Test Result
GitHub MCP Connectivity ✅ Connected (policy filtered)
GitHub.com HTTP
File Write/Read smoke-test-docker-sbx-29648588271.txt verified

Overall: PASS @lpcox

📰 BREAKING: Report filed by Smoke Docker Sbx
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor

Build Test Suite Results

Ecosystem Project Build/Install Tests Status
Bun elysia Yes 1/1 passed PASS
Bun hono Yes 1/1 passed PASS
C++ fmt Yes N/A PASS
C++ json Yes N/A PASS
Deno oak N/A 1/1 passed PASS
Deno std N/A 1/1 passed PASS
.NET hello-world Yes N/A PASS
.NET json-parse Yes N/A PASS
Go color Yes 1/1 passed PASS
Go env Yes 1/1 passed PASS
Go uuid Yes 1/1 passed PASS
Java gson Yes 1/1 passed PASS
Java caffeine Yes 1/1 passed PASS
Node.js clsx Yes all passed PASS
Node.js execa Yes all passed PASS
Node.js p-limit Yes all passed PASS
Rust fd Yes 1/1 passed PASS
Rust zoxide Yes 1/1 passed PASS

Overall: 8/8 ecosystems passed - PASS

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • awmgmcpg

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

network:
  allowed:
    - defaults
    - "awmgmcpg"

See Network Configuration for more information.

Generated by Build Test Suite for #6342 · 153.7 AIC · ⊞ 6.9K ·
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor

Smoke Test Results

  • GitHub MCP Testing: ❌ (Secrecy policy blocked access)
  • GitHub.com Connectivity: ❌ (Network unreachable)
  • File Writing Testing: ✅
  • Bash Tool Testing: ✅

Overall Status: FAIL

Last 2 PRs (from git log):

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • localhost

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

network:
  allowed:
    - defaults
    - "localhost"

See Network Configuration for more information.

💎 Faceted by Smoke Gemini
Add label ready-for-aw to run again

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment