Skip to content

feat(codex): disable analytics in generated runs#27427

Closed
Copilot wants to merge 1 commit intomainfrom
copilot/configure-codex-disable-analytics
Closed

feat(codex): disable analytics in generated runs#27427
Copilot wants to merge 1 commit intomainfrom
copilot/configure-codex-disable-analytics

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 20, 2026

  • Investigate current Codex execution command generation and confirm where -c config flags are assembled
  • Verify Codex analytics disable setting from upstream Codex configuration schema/docs
  • Add Codex CLI config flag to disable analytics in generated execution command
  • Add/adjust unit tests to validate analytics disable flag is present
  • Update engine docs to note analytics is disabled by default
  • Run targeted tests and formatting checks
  • Run make agent-finish pre-commit validation and capture existing unrelated failures
  • Commit and push changes
  • Run parallel validation (Code Review + CodeQL)
  • Open/update PR with summary


✨ PR Review Safe Output Test - Run 24690506212

💥 [THE END] — Illustrated by Smoke Claude · ● 201.7K ·

Agent-Logs-Url: https://github.com/github/gh-aw/sessions/d6b3bde3-c2a8-418d-944b-73c948531eb1

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Copy Markdown
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

Adds a default Codex CLI override to disable analytics for generated workflow runs, with supporting tests and documentation updates.

Changes:

  • Add -c analytics.enabled=false to the Codex execution command generated by CodexEngine.
  • Add a unit test asserting analytics are disabled by default.
  • Update engine reference docs and multiple locked workflow fixtures to include the analytics-disable flag.
Show a summary per file
File Description
pkg/workflow/codex_engine.go Appends -c analytics.enabled=false to the generated codex exec command.
pkg/workflow/codex_engine_test.go Adds test coverage ensuring the analytics-disable flag is present by default.
docs/src/content/docs/reference/engines.md Documents that Codex analytics are disabled by default in workflow runs.
.github/workflows/smoke-codex.lock.yml Updates Codex invocations in smoke workflow to include analytics-disable flag.
.github/workflows/smoke-call-workflow.lock.yml Updates Codex invocations to include analytics-disable flag.
.github/workflows/schema-feature-coverage.lock.yml Updates Codex invocations to include analytics-disable flag.
.github/workflows/issue-arborist.lock.yml Updates Codex invocations to include analytics-disable flag.
.github/workflows/grumpy-reviewer.lock.yml Updates Codex invocations to include analytics-disable flag.
.github/workflows/duplicate-code-detector.lock.yml Updates Codex invocations to include analytics-disable flag.
.github/workflows/daily-observability-report.lock.yml Updates Codex invocations to include analytics-disable flag.
.github/workflows/daily-fact.lock.yml Updates Codex invocations to include analytics-disable flag.
.github/workflows/codex-github-remote-mcp-test.lock.yml Updates Codex invocation to include analytics-disable flag.
.github/workflows/changeset.lock.yml Updates Codex invocation to include analytics-disable flag.
.github/workflows/ai-moderator.lock.yml Updates Codex invocation to include analytics-disable flag.

Copilot's findings

Tip

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

  • Files reviewed: 14/14 changed files
  • Comments generated: 1

# shellcheck disable=SC1003
sudo -E awf --container-workdir "${GITHUB_WORKSPACE}" --mount "${RUNNER_TEMP}/gh-aw:${RUNNER_TEMP}/gh-aw:ro" --mount "${RUNNER_TEMP}/gh-aw:/host${RUNNER_TEMP}/gh-aw:ro" --env-all --exclude-env CODEX_API_KEY --exclude-env GH_AW_GH_TOKEN --exclude-env GITHUB_MCP_SERVER_TOKEN --exclude-env MCP_GATEWAY_API_KEY --exclude-env OPENAI_API_KEY --allow-domains '*.githubusercontent.com,172.30.0.1,api.openai.com,api.snapcraft.io,archive.ubuntu.com,azure.archive.ubuntu.com,cdn.playwright.dev,codeload.github.com,crl.geotrust.com,crl.globalsign.com,crl.identrust.com,crl.sectigo.com,crl.thawte.com,crl.usertrust.com,crl.verisign.com,crl3.digicert.com,crl4.digicert.com,crls.ssl.com,docs.github.com,github-cloud.githubusercontent.com,github-cloud.s3.amazonaws.com,github.blog,github.com,github.githubassets.com,go.dev,golang.org,goproxy.io,host.docker.internal,json-schema.org,json.schemastore.org,keyserver.ubuntu.com,lfs.github.com,objects.githubusercontent.com,ocsp.digicert.com,ocsp.geotrust.com,ocsp.globalsign.com,ocsp.identrust.com,ocsp.sectigo.com,ocsp.ssl.com,ocsp.thawte.com,ocsp.usertrust.com,ocsp.verisign.com,openai.com,packagecloud.io,packages.cloud.google.com,packages.microsoft.com,pkg.go.dev,playwright.download.prss.microsoft.com,ppa.launchpad.net,proxy.golang.org,raw.githubusercontent.com,s.symcb.com,s.symcd.com,security.ubuntu.com,storage.googleapis.com,sum.golang.org,ts-crl.ws.symantec.com,ts-ocsp.ws.symantec.com,www.googleapis.com' --log-level info --proxy-logs-dir /tmp/gh-aw/sandbox/firewall/logs --audit-dir /tmp/gh-aw/sandbox/firewall/audit --enable-host-access --allow-host-ports 80,443,8080 --image-tag 0.25.25 --skip-pull --enable-api-proxy \
-- /bin/bash -c 'export PATH="$(find /opt/hostedtoolcache -maxdepth 4 -type d -name bin 2>/dev/null | tr '\''\n'\'' '\'':'\'')$PATH"; [ -n "$GOROOT" ] && export PATH="$GOROOT/bin:$PATH" || true && INSTRUCTION="$(cat /tmp/gh-aw/aw-prompts/prompt.txt)" && codex ${GH_AW_MODEL_AGENT_CODEX:+-c model="$GH_AW_MODEL_AGENT_CODEX" }exec -c web_search="disabled" --dangerously-bypass-approvals-and-sandbox --skip-git-repo-check "$INSTRUCTION"' 2>&1 | tee -a /tmp/gh-aw/agent-stdio.log
-- /bin/bash -c 'export PATH="$(find /opt/hostedtoolcache -maxdepth 4 -type d -name bin 2>/dev/null | tr '\''\n'\'' '\'':'\'')$PATH"; [ -n "$GOROOT" ] && export PATH="$GOROOT/bin:$PATH" || true && INSTRUCTION="$(cat /tmp/gh-aw/aw-prompts/prompt.txt)" && codex ${GH_AW_MODEL_AGENT_CODEX:+-c model="$GH_AW_MODEL_AGENT_CODEX" }exec -c web_search="disabled" -c analytics.enabled=false --dangerously-bypass-approvals-and-sandbox --skip-git-repo-check "$INSTRUCTION"' 2>&1 | tee -a /tmp/gh-aw/agent-stdio.log
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.

Good observation! The smoke workflow currently doesn't disable fetch, while the CodexEngine does so by default when web-fetch is not declared. Adding -c fetch="disabled" here would keep the smoke workflow consistent with engine defaults and reduce network surface area.

📰 BREAKING: Report filed by Smoke Copilot · ● 1.6M

@github-actions github-actions bot mentioned this pull request Apr 20, 2026
@github-actions
Copy link
Copy Markdown
Contributor

🧪 Test Quality Sentinel Report

Test Quality Score: 60/100

⚠️ Acceptable, with suggestions

Metric Value
New/modified tests analyzed 1
✅ Design tests (behavioral contracts) 1 (100%)
⚠️ Implementation tests (low value) 0 (0%)
Tests with error/edge cases 0 (0%)
Duplicate test clusters 0
Test inflation detected Yes (2.43:1 ratio)
🚨 Coding-guideline violations None

Test Classification Details

Test File Classification Issues Detected
TestCodexEngineAnalytics pkg/workflow/codex_engine_test.go:861 ✅ Design No error/edge case; test inflation (17 test lines vs 7 production lines)

Flagged Tests — Requires Review

⚠️ TestCodexEngineAnalytics (pkg/workflow/codex_engine_test.go:861)

Classification: Design test (behavioral contract) — but missing edge cases

What design invariant does this test enforce? It enforces that Codex workflows always include -c analytics.enabled=false in the generated execution command, ensuring analytics is disabled by default for all workflow runs.

What would break if deleted? A regression removing the analytics-disable flag would go completely undetected.

Issues:

  1. No edge case coverage — only happy-path tested. Consider adding a case that verifies the flag appears exactly once, or that it can be overridden via customArgs if that's a valid scenario.
  2. Test inflation — 17 lines added to the test file vs. 7 lines added to production (codex_engine.go), a 2.43:1 ratio exceeding the 2:1 threshold.

Suggested improvement: The test is solid for its scope. To add edge-case value, consider verifying the flag position relative to other flags (e.g., that it doesn't conflict with customArgs that might also set analytics), or that it appears in all codex command variants (different models, web-search enabled, etc.).


Language Support

Tests analyzed:

  • 🐹 Go (*_test.go): 1 test — unit (//go:build !integration) ✅
  • 🟨 JavaScript (*.test.cjs, *.test.js): 0 tests

Verdict

Check passed. 0% of new tests are implementation tests (threshold: 30%). No coding-guideline violations detected. Score of 60/100 is in the acceptable range, with the main gap being absence of error/edge-case coverage and minor test inflation.


📖 Understanding Test Classifications

Design Tests (High Value) verify what the system does:

  • Assert on observable outputs, return values, or state changes
  • Cover error paths and boundary conditions
  • Would catch a behavioral regression if deleted
  • Remain valid even after internal refactoring

Implementation Tests (Low Value) verify how the system does it:

  • Assert on internal function calls (mocking internals)
  • Only test the happy path with typical inputs
  • Break during legitimate refactoring even when behavior is correct
  • Give false assurance: they pass even when the system is wrong

Goal: Shift toward tests that describe the system's behavioral contract — the promises it makes to its users and collaborators.

References: §24690192959

🧪 Test quality analysis by Test Quality Sentinel · ● 886.9K ·

Copy link
Copy Markdown
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

✅ Test Quality Sentinel: 60/100. Test quality is acceptable — 0% of new tests are implementation tests (threshold: 30%). TestCodexEngineAnalytics correctly enforces the behavioral contract that analytics is disabled by default in Codex workflow runs. Minor suggestion: add edge-case coverage to reach a higher score.

@pelikhan pelikhan added the smoke label Apr 20, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 20, 2026

⚠️ Smoke Crush failed. Crush encountered unexpected challenges...

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 20, 2026

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

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 20, 2026

🌑 The shadows whisper... Smoke Codex failed. The oracle requires further meditation...

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 20, 2026

⚠️ Smoke Gemini failed. Gemini encountered unexpected challenges...

@github-actions
Copy link
Copy Markdown
Contributor

📰 BREAKING: Smoke Copilot is now investigating this pull request. Sources say the story is developing...

@github-actions github-actions bot removed the smoke label Apr 20, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Hey @pelikhan 👋 — great work on the Codex analytics flag! Disabling telemetry by default in all generated Codex runs is a thoughtful privacy improvement, and the PR is cleanly implemented across all the right surfaces.

The contribution checks all look good:

  • ✅ On-topic and aligned with the project's agentic workflow tooling
  • ✅ Single-purpose and focused (one consistent change propagated across all lock files + source + test + docs)
  • ✅ Unit tests added in codex_engine_test.go
  • ✅ Docs updated in engines.md
  • ✅ No new dependencies introduced
  • ✅ Follows the core-team-via-agent process

This PR looks ready for maintainer review! 🟢

Generated by Contribution Check · ● 2M ·

@github-actions
Copy link
Copy Markdown
Contributor

Agent Container Tool Check

Tool Status Version
bash 5.2.21
sh available
git 2.53.0
jq 1.7
yq v4.52.5
curl 8.5.0
gh 2.89.0
node v20.20.2
python3 3.12.3
go 1.24.13
java openjdk 21.0.10
dotnet 10.0.201

Result: 12/12 tools available ✅ — PASS

🔧 Tool validation by Agent Container Smoke Test · ● 198.6K ·

@github-actions
Copy link
Copy Markdown
Contributor

Smoke Test §24690506196: ✅ PASS

Test
GitHub MCP
MCP Scripts GH CLI
Serena CLI
Playwright CLI
Web Fetch
File Writing + Bash
Discussion Interaction
Build gh-aw
Artifact Upload
Discussion Creation
Workflow Dispatch
PR Review

All 13 tests passed. PR author: @Copilot. Assignees: @pelikhan, @Copilot.

📰 BREAKING: Report filed by Smoke Copilot · ● 1.6M ·

Copy link
Copy Markdown
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

This PR correctly adds -c analytics.enabled=false to Codex execution commands and includes a new test. Two minor suggestions: define the flag as a named constant, and add an argument-order assertion to the test. Overall a clean, well-tested change.

📰 BREAKING: Report filed by Smoke Copilot · ● 1.6M

// Disable Codex analytics by default for workflow runs.
// Codex config schema supports [analytics] enabled = false, which maps to
// -c analytics.enabled=false for CLI overrides.
analyticsParam := " -c analytics.enabled=false"
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.

The analytics flag is hardcoded as a constant string here. Consider defining this as a named constant (e.g., codexAnalyticsDisabledFlag = " -c analytics.enabled=false") to make it easier to update if the Codex CLI flag syntax changes in the future.

})
}

func TestCodexEngineAnalytics(t *testing.T) {
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.

Good test coverage for the analytics flag. Consider also adding a test case that verifies the analytics flag appears before fullAutoParam in the command string, since argument ordering matters for the Codex CLI and the fmt.Sprintf format string reflects a specific order.

@github-actions
Copy link
Copy Markdown
Contributor

Smoke Test 24690506212 — Claude Engine ✅ PARTIAL PASS

Core Tests Status
#1 GitHub MCP (merged PRs)
#2 GH CLI (pr list)
#3 Serena MCP (13 symbols)
#4 Make build
#5 Playwright (github.com)
#6 Tavily search
#7 File write
#8 Bash verify
#9 Discussion comment
#10 AW MCP status ❌ Tool error
#11 Slack safe output
#12 Code scanning alert
PR Review Tests Status
#13 Update PR body
#14 Review comments (×2)
#15 Submit review
#16 Resolve thread
#17 Add reviewer
#18 Push to branch
#19 Close PR ⚠️ Skipped

💥 [THE END] — Illustrated by Smoke Claude · ● 201.7K ·

Copy link
Copy Markdown
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

💥 Automated smoke test review - all systems nominal! This PR correctly adds -c analytics.enabled=false consistently across all affected workflow lock files.

💥 [THE END] — Illustrated by Smoke Claude · ● 201.7K

@@ -774,7 +774,7 @@ jobs:
(umask 177 && touch /tmp/gh-aw/agent-stdio.log)
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.

✅ Smoke test review comment #1 — The -c analytics.enabled=false flag addition looks correct and consistent with the PR's intent to disable Codex analytics in generated runs.

@@ -793,7 +793,7 @@ jobs:
(umask 177 && touch /tmp/gh-aw/agent-stdio.log)
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.

✅ Smoke test review comment #2 — The analytics flag is consistently applied here too. Good cross-workflow consistency.

@github-actions
Copy link
Copy Markdown
Contributor

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

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.

3 participants