Skip to content

fix(setup): preserve existing configuration mode - #7942

Merged
morluto merged 1 commit into
mainfrom
codex/setup-mode-preservation-7401
Oct 29, 2026
Merged

morluto merged 1 commit into
mainfrom
codex/setup-mode-preservation-7401

Conversation

@morluto

@morluto morluto commented Oct 28, 2026 •

Copy link
Copy Markdown
Owner

Summary

Fixes #7401. Refreshing an existing client registration could silently replace its mode with 0600. Setup now preserves the existing mode through the shared configuration publisher; newly created files remain private.

Problem and expected behavior

The setup caller overrode the publisher's existing-file attribute policy, so an existing 0640 Codex file became 0600 even though setup reported success and preserved its backup. Configuration updates should preserve existing mode and remain idempotent.

Change and scope

Remove the unused per-call mode override so the publisher owns attribute preservation for setup and uninstall. The publisher retains the existing mode and ownership or reports a preservation failure; new files use 0600.

Contract and boundary impact

  • Semantic owner and earliest changed stage: shared client configuration publication.
  • Contribution scope fit and linked maintainer decision: existing local setup behavior; no new authority.
  • CLI and MCP/tool-catalog contract: no schema changes.
  • Provider, bridge, target-format, or platform compatibility: POSIX mode regression tested on macOS; Windows mode semantics unverified.
  • Evidence, artifact, provenance, or reconstruction contract: configuration contents and backups retained as before.
  • Target selection, authority, upstream behavior, and cleanup details: existing transactional publication and cleanup retained.
  • Generated metadata, package, or installation impact: no generated files.

Expected effects:

  • Change process memory, registers, files, or configuration.

Evidence and regression coverage

The public Codex setup workflow checks the existing file and backup remain 0640 across refresh and aligned retry. The shared configuration boundary also checks a different client, backup bytes, repeat behavior, and 0600 for a new file. Tests run on macOS; ACLs, group-only reader access, and other operating systems were not tested.

Validation performed

  • npm run test:focused -- tests/acceptance/setup/codexToolPolicySetup.test.ts tests/boundary/filesystem/clientConfigurationTransactions.test.ts — 27 passed.
  • npm run check:fast — passed.
  • git diff --check HEAD — passed before commit.

Compatibility, safety, and release

Existing configured modes are retained rather than silently changed; new files remain private. No schema migration.

Author readiness

Human owner: @morluto

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

Before merge

  • This PR addresses a concrete problem or an agreed enhancement.
  • Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff.
  • The PR has one focused outcome and the title follows type(scope): outcome.
  • Related issue is linked, or the reason for not linking one is stated above.
  • Tests cover changed observable behavior and meaningful failure paths.
  • Owning docs, contracts, and generated metadata are updated where needed.
  • User-visible CLI/MCP changes include representative output.
  • I checked the final diff for secrets, unrelated cleanup, and unsupported claims.

@greptile-apps

greptile-apps Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; existing permissions are preserved and new files remain private.

Summary

Setup now lets ClientConfigurationPublication preserve existing permissions instead of overriding them with 0600.

  • Setup refreshes keep the configuration’s existing file mode.

Reviews (1) · Last reviewed commit: "fix(setup): preserve existing configurat..." · Reviewed by Greptile

@morluto
morluto marked this pull request as ready for review October 28, 2026 23:24
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-28T23:29:28.912220Z 2a42b4d Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@morluto
morluto merged commit 70a8325 into main Oct 29, 2026
45 of 46 checks passed
@morluto
morluto deleted the codex/setup-mode-preservation-7401 branch October 29, 2026 00:59
@morluto morluto added area: setup Setup, packaging, upgrade, install, Doctor, and client registration bug Something isn't working labels Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: setup Setup, packaging, upgrade, install, Doctor, and client registration bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] rea setup removes group-read permission from an existing Codex configuration

1 participant