Repository navigation
[3737 by Claude Opus 5.5] Nightly test fails on a runner that runs as root: Codex entrypoint --trust test - #3739
Conversation
…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.
|
/ultrafix goal=8 max=3 |
|
🔄 Ultrafix loop started (goal: 8/10, max cycles: 3) First action:
|
|
✅ AI Code Review Complete requested by @propr-ultrafix Posted 1 review: |
🔍 AI Code Review — codex:gpt-6-astraOverall EvaluationThis 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 ✅ Root-path failure coverage — The ✅ 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 blockersNo merge blockers. SuggestionsThese are optional follow-ups and are not sent to S1: 🟢 Improve subprocess failure diagnosticsIn ScoreThe 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
Copy and edit to choose records from this review: 🤖 Review by ProPR |
…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.
--trust test--trust test
--trust test--trust test
AI Implementation Summary
Closes #3737
Branch:
3737/claude-opus-5-5-nightly-test-fails-on-a-r-20261119-2101-5hbCommits: ✅ Changes committed (aa883a8)
AI Processing Completed
Execution Details:
--trusttest #3737Summary:
I fixed the Codex
--trustentrypoint test so it gives the same result whether it runs as root or as an ordinary user, and on hosts withoutsu-execor anodeuser. Onlytest/agentToolPolicyRuntime.test.tschanged.scripts/codex-entrypoint.shis unchanged, and I found no defect in it.What the test does now
PATH) now has anidstub. Forid -uit prints a uid the test picks; any other arguments go to the realid. A quick check confirms the stub really decides whatid -ureturns.su-exec: a second stub checks that its first argument isnode, drops it, and runs the rest. Sosu-exec node env HOME=… codex exec --helpreaches the stubcodex.1000(non-root branch) and once with0(root branch throughsu-exec).su-exec: a new assertion makes thesu-execstub fail. As root,--trustis not added and the command is otherwise unchanged; as a normal user,--trustis still added. I tested a failingsu-exec, not a missing one: a host that has a realsu-execwould find it onPATHanyway. In the script, a missing binary takes the same exit path as a failing one.Other tests checked for the same problem
codex_exec_offers_trust, but with no arguments. The[ "${1:-}" = "codex" ]check stops it beforeid -uis reached, so it doesn't depend on the user. I left it as is.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.mjsandpackages/core/test/antigravityConfig.test.tsonly read or pattern-match the entrypoint scripts and never run blocks from them, so the runner's user doesn't affect them.test/*entrypoint*file.Verification
npx tsx --test test/agentToolPolicyRuntime.test.tsas uid 1000: 6/6 pass.Not run as root: this container has no
sudo, andunshare -ris not permitted. The root branch is covered only through the stubbedid.Mutation checks: I broke
scripts/codex-entrypoint.shthree ways, one at a time, and restored it after each:su-exec nobodyinstead ofnodesu-execEach made the test fail on the expected uid.
npm run lint -- --max-warnings 0andnpm run typecheckpass. Neither coverstest/: 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
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!