Skip to content

[3737 by Claude Opus 5.5] Nightly test fails on a runner that runs as root: Codex entrypoint --trust test - #3739

Merged
integry merged 1 commit into
mainfrom
3737/claude-opus-5-5-nightly-test-fails-on-a-r-20261119-2101-5hb
Nov 19, 2026
Merged

integry merged 1 commit into
mainfrom
3737/claude-opus-5-5-nightly-test-fails-on-a-r-20261119-2101-5hb

Conversation

@propr-dev

@propr-dev propr-dev Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

AI Implementation Summary

Closes #3737

Branch: 3737/claude-opus-5-5-nightly-test-fails-on-a-r-20261119-2101-5hb
Commits: ✅ Changes committed (aa883a8)


AI Processing Completed

Execution Details:

Summary:
I fixed the Codex --trust entrypoint test so it gives the same result whether it runs as root or as an ordinary user, and on hosts without su-exec or a node user. Only test/agentToolPolicyRuntime.test.ts changed. scripts/codex-entrypoint.sh is unchanged, and I found no defect in it.

What the test does now

  • Stubbed user: the per-case stub directory (already first on PATH) now has an id stub. For id -u it prints a uid the test picks; any other arguments go to the real id. A quick check confirms the stub really decides what id -u returns.
  • Stubbed su-exec: a second stub checks that its first argument is node, drops it, and runs the rest. So su-exec node env HOME=… codex exec --help reaches the stub codex.
  • Both branches: all the existing assertions run twice, once with uid 1000 (non-root branch) and once with 0 (root branch through su-exec).
  • Failing su-exec: a new assertion makes the su-exec stub fail. As root, --trust is not added and the command is otherwise unchanged; as a normal user, --trust is still added. I tested a failing su-exec, not a missing one: a host that has a real su-exec would find it on PATH anyway. In the script, a missing binary takes the same exit path as a failing one.

Other tests checked for the same problem

  • Same file, "Codex entrypoint rejects container project ancestry…": it runs a block that includes codex_exec_offers_trust, but with no arguments. The [ "${1:-}" = "codex" ] check stops it before id -u is reached, so it doesn't depend on the user. I left it as is.
  • Read-only tests: test/opencodeAgent.test.ts, test/antigravityAgent.test.ts, test/vibeAgent.test.ts, test/agentVersionManagement.test.ts, test/repoSetupWrapper.test.ts, test/agentTankImageVerification.test.ts, test/ciWorkflowDeduplication.test.mjs and packages/core/test/antigravityConfig.test.ts only read or pattern-match the entrypoint scripts and never run blocks from them, so the runner's user doesn't affect them.
  • There is no test/*entrypoint* file.

Verification

  • npx tsx --test test/agentToolPolicyRuntime.test.ts as uid 1000: 6/6 pass.

  • Not run as root: this container has no sudo, and unshare -r is not permitted. The root branch is covered only through the stubbed id.

  • Mutation checks: I broke scripts/codex-entrypoint.sh three ways, one at a time, and restored it after each:

    • su-exec nobody instead of node
    • reading the help directly as root, without su-exec
    • inverting the root check

    Each made the test fail on the expected uid.

  • npm run lint -- --max-warnings 0 and npm run typecheck pass. Neither covers test/: running eslint on the file directly just says it is ignored. So I also typechecked the file with a temporary tsconfig that extends the root one, with no errors.

There is no visual change, so I made no preview.

Review digest

Risk-tiered paths

  • High risk: none
  • Normal risk: none
  • Low risk (1 file)
    • test/agentToolPolicyRuntime.test.ts (+25/−11)

Diff size: 1 file changed, +25/−11 lines

View task for the run's logs and conversation.


This PR was created automatically by ProPR after processing issue #3737.


💡 Need changes?

Comment on this PR to request refinements — the AI agent monitors comments and will update the implementation based on your feedback. Keep iterating until you're satisfied!

…lt whether it runs as root or as an ordinary user, and on hosts without `su-exec` or a `node` user. Only `test/agentToolPolicyRuntime.test.ts` changed. `scripts/codex-entrypoint.sh` is unchanged, and I found no defect in it.

What the test does now
- Stubbed user: the per-case stub directory (already first on `PATH`) now has an `id` stub. For `id -u` it prints a uid the test picks; any other arguments go to the real `id`. A quick check confirms the stub really decides what `id -u` returns.
- Stubbed `su-exec`: a second stub checks that its first argument is `node`, drops it, and runs the rest. So `su-exec node env HOME=… codex exec --help` reaches the stub `codex`.
- Both branches: all the existing assertions run twice, once with uid `1000` (non-root branch) and once with `0` (root branch through `su-exec`).
- Failing `su-exec`: a new assertion makes the `su-exec` stub fail. As root, `--trust` is not added and the command is otherwise unchanged; as a normal user, `--trust` is still added. I tested a failing `su-exec`, not a missing one: a host that has a real `su-exec` would find it on `PATH` anyway. In the script, a missing binary takes the same exit path as a failing one.

Other tests checked for the same problem
- Same file, "Codex entrypoint rejects container project ancestry…": it runs a block that includes `codex_exec_offers_trust`, but with no arguments. The `[ "${1:-}" = "codex" ]` check stops it before `id -u` is reached, so it doesn't depend on the user. I left it as is.
- Read-only tests: `test/opencodeAgent.test.ts`, `test/antigravityAgent.test.ts`, `test/vibeAgent.test.ts`, `test/agentVersionManagement.test.ts`, `test/repoSetupWrapper.test.ts`, `test/agentTankImageVerification.test.ts`, `test/ciWorkflowDeduplication.test.mjs` and `packages/core/test/antigravityConfig.test.ts` only read or pattern-match the entrypoint scripts and never run blocks from them, so the runner's user doesn't affect them.
- There is no `test/*entrypoint*` file.

Verification
- `npx tsx --test test/agentToolPolicyRuntime.test.ts` as uid 1000: 6/6 pass.
- Not run as root: this container has no `sudo`, and `unshare -r` is not permitted. The root branch is covered only through the stubbed `id`.
- Mutation checks: I broke `scripts/codex-entrypoint.sh` three ways, one at a time, and restored it after each:
  - `su-exec nobody` instead of `node`
  - reading the help directly as root, without `su-exec`
  - inverting the root check

  Each made the test fail on the expected uid.
- `npm run lint -- --max-warnings 0` and `npm run typecheck` pass. Neither covers `test/`: running eslint on the file directly just says it is ignored. So I also typechecked the file with a temporary tsconfig that extends the root one, with no errors.

There is no visual change, so I made no preview.
@propr-dev

propr-dev Bot commented Nov 19, 2026

Copy link
Copy Markdown
Contributor Author

/ultrafix goal=8 max=3
Triggered automatically by the requested execution settings.

@propr-dev propr-dev Bot added the ultrafix label Nov 19, 2026
@propr-dev

propr-dev Bot commented Nov 19, 2026

Copy link
Copy Markdown
Contributor Author

🔄 Ultrafix loop started (goal: 8/10, max cycles: 3)

First action: /review

💡 Tip: Remove the ultrafix label from this PR to stop further ultrafix cycles.

@propr-dev

propr-dev Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ AI Code Review Complete requested by @propr-ultrafix

Posted 1 review:

View Task Details

@propr-dev

propr-dev Bot commented Nov 19, 2026

Copy link
Copy Markdown
Contributor Author

🔍 AI Code Review — codex:gpt-6-astra

Overall Evaluation

This focused test change addresses the reported runner-dependent failure by simulating both root and non-root execution. It is merge-ready within the supplied scope, conditional on pending checks completing successfully.

✅ Deterministic user branches — The id stub explicitly exercises UIDs 1000 and 0, removing dependence on the runner’s actual user.

✅ Root-path failure coverage — The su-exec stub checks the node argument, and the added failure case verifies that failed privilege switching suppresses --trust only in the root branch.

✅ Existing coverage preserved — Both simulated users exercise legacy CLI compatibility, trust opt-out, exclusive-MCP mode, resume arguments, and app-server exclusion.

This assessment uses static inspection of the supplied code; no commands were run. The issue specification is truncated, so requirements beyond its visible text could not be assessed. The supplied diff is complete. Current checks show no failures, with six pending.

Merge blockers

No merge blockers.

Suggestions

These are optional follow-ups and are not sent to /fix.

S1: 🟢 Improve subprocess failure diagnostics

In test/agentToolPolicyRuntime.test.ts, the run helper reads only subprocess stdout. Optionally assert successful exit status and include stderr in failures before comparing arguments. This would make shell or fixture failures easier to diagnose. It is not required for merge because the existing argument assertions already detect failures affecting the expected output.

Score

The change directly addresses the visible objective, preserves existing assertions, and adds meaningful coverage of both user branches and privilege-switch failure. No introduced blocker was found; pending checks still need to finish.

Score: 9/10


🤖 Review Details

  • Model: GPT-6 Astra
  • Time: 24s
  • Tokens: 32,924 (32,507 in / 417 out)
  • Cost: $0.24

View Task


💡 Next step: Comment /fix to address every F# merge blocker, /fix all for every pending blocker and suggestion, or name records explicitly, as in /fix F3 S5.
F# and S# IDs increment across review comments and remain permanent, so selectors such as /fix F3 F5 stay unambiguous across cycles. S# suggestions stay optional: they are implemented only when you name them or request /fix all, and they never relax a merge blocker.

Copy and edit to choose records from this review:

/fix S1

🤖 Review by ProPR

@propr-dev propr-dev Bot removed the ultrafix label Nov 19, 2026
propr-dev Bot pushed a commit that referenced this pull request Nov 19, 2026
…n the issue's list passed. This is metadata only, with no behaviour changes. I checked upstream `main` first; it is at `83ed9acd0` (#3730), the same commit as this branch.

Version bump (the same 19 files as the 0.9.2 preparation, #3683):
- Packages: root `package.json`, the six `@propr` packages (api, cli, client, core, local-setup, shared) and `apps/desktop` are now 0.9.3, and their internal `^0.9.2` ranges are now `^0.9.3`. `package-lock.json` has the same 19 changed lines as last time.
- Version constant and manifest: `PROPR_VERSION` is `'0.9.3'`. The launcher manifest pins version 0.9.3, the images `:0.9.3` and `git_sha` `83ed9acd0…`, the current `main` head, as 0.9.2 did.
- Left alone: independently versioned packages (docs stays 0.0.0) and the vendored `braces` tarball.

CHANGELOG:
- `## [0.9.3] - 2026-11-20` with a new empty `## [Unreleased]` above it, and the comparison links updated. Everything from `## [0.9.2]` down is byte-identical to the `v0.9.2` tag; I checked with `diff`.
- Added (missing before):
  - Follow-up comments always picked up
  - The "branch already exists" worktree fix
  - A run that didn't open its PR now ends as `publication_failed`
  - Runs that end while the agent is still waiting are flagged as unconfirmed
  - Repeated bot comments post once, with the rate-limit reset time fixed
  - Labels applied once
  - Status-line edits skipped when the App's rate limit runs low
  - The hosted UI deploy now fails when it did not deploy
  - Four web UI fixes: tap targets, Maintenance showing Running, LLM Log, and the automation run list
- Merged: the two agent CLI bump entries into one (Codex 0.170.0, Claude Code 2.1.328, Antigravity 1.5.12).
- Updated: the CI-suspension entry now says when a failure still counts as a code failure (two or more failed steps, or a step that ran after the failed one).
- Moved: Gemini 4 Neon and Carbon from Changed to Added.
- Removed: the CI-only Chromium install entry.
- Unchanged: the CI-failure comment entry already describes a dependency line, not folding. The picomatch removal was already listed.

Release notes: `release-notes/v0.9.3.md` (37 lines) has Highlights in five groups (agents and models, follow-ups and CI failures, pull requests and comments, web UI, releases), then Upgrade notes. The upgrade notes say:
- No manual steps are expected.
- The vendored picomatch builds are gone, so run `npm ci` in source checkouts.
- Runs that committed but didn't open a PR now end as failed (`publication_failed`).
- The new "unconfirmed" comment wording, which needs a summarization model.
- `reportPreview` now holds the report's first sentence instead of its title.
- Existing PRs without the `AI` label still need it added by hand.

Docs: the current-release examples in `README.md`, `apps/desktop/README.md`, `desktop-application.md`, `desktop-pairing.md` and `hosted-ui-release.md` now say 0.9.3. Historical references such as "v0.9.2 and earlier" are unchanged.

Validation results:
- `EXPECTED_VERSION=0.9.3 RELEASE_TAG=v0.9.3 RELEASE_CANDIDATE=true npm run release:verify`: `Release metadata is consistent for v0.9.3`, exit 0.
- `node --test test/releaseValidation.test.mjs`: 37 of 37 pass.
- `npx tsx --test test/orchestratorProprUrlsDrift.test.ts`: 13 of 13 pass.
- Desktop version tests (release-config, release-workflow, the macOS and signed update policies, macOS branding, release-architecture, release-publish, nightly-native-bundle, runtime-manifest, release-artifacts, preflight, Windows installer, Linux and macOS preview releases): 194 tests, 188 pass, 0 fail, 6 skipped.
- `npm run audit:runtime` and `npm run desktop:audit:packaging`: both pass.
- Lint with `--max-warnings 0` on root `src/`, core, api, cli and propr-ui: clean.
- Typechecks for root, shared, client, core, local-setup, api, cli, propr-ui and desktop: clean.
- `npm run build --prefix docs`: succeeds.
- `git diff --check`: clean.
- `THIRD_PARTY_LICENSES.md`: regenerated twice with byte-identical results, and the notice validator passes. Only the `Generated:` date and the three ProPR package versions changed. picomatch is not listed there, so its move from vendored to upstream changes nothing in the file.

Two things to know before merging:
- Generated date: the regenerated license file says `Generated: 2026-11-19`, because the lockfile change is uncommitted and the script uses today's UTC date. If this is committed after midnight UTC, the script will expect 2026-11-20 and the file will need regenerating.
- Nightly test fix: the one the issue mentions is PR #3739, which is still open and not on `main`. It only changes a test, so it needs no changelog entry, but it is not in this release yet.

Nothing was tagged, published, merged or deployed, and I made no previews because nothing here changes the UI.
@propr-dev propr-dev Bot changed the title 🔨 [3737 by Claude Opus 5.5] Nightly test fails on a runner that runs as root: Codex entrypoint --trust test ✅❾ [3737 by Claude Opus 5.5] Nightly test fails on a runner that runs as root: Codex entrypoint --trust test Nov 19, 2026
@integry
integry merged commit 4578c35 into main Nov 19, 2026
70 checks passed
@integry
integry deleted the 3737/claude-opus-5-5-nightly-test-fails-on-a-r-20261119-2101-5hb branch November 19, 2026 21:51
@propr-dev propr-dev Bot changed the title ✅❾ [3737 by Claude Opus 5.5] Nightly test fails on a runner that runs as root: Codex entrypoint --trust test [3737 by Claude Opus 5.5] Nightly test fails on a runner that runs as root: Codex entrypoint --trust test Nov 19, 2026
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.

Nightly test fails on a runner that runs as root: Codex entrypoint --trust test

1 participant