Skip to content

fix(codex): avoid false project config warnings - #1000

Open
WZBbiao wants to merge 1 commit into
lidge-jun:devfrom
WZBbiao:fix/project-config-warning-false-positives
Open

fix(codex): avoid false project config warnings#1000
WZBbiao wants to merge 1 commit into
lidge-jun:devfrom
WZBbiao:fix/project-config-warning-false-positives

Conversation

@WZBbiao

@WZBbiao WZBbiao commented Aug 4, 2026

Copy link
Copy Markdown

Summary

  • Exclude the effective global Codex config from project-config discovery when a parent walk reaches $HOME/.codex/config.toml.
  • Compare canonical existing paths so symlink aliases are excluded as well, with Windows case normalization.
  • Humanize OpenCode provider ids only at an identifier boundary so opencodex-retry is not mislabeled as OpenCode.

Verification

  • bun test tests/project-config-warnings.test.ts - 20 passed, 0 failed.
  • bun run typecheck - passed.
  • bun run prepush - 8,218 passed, 8 skipped, 0 failed; typecheck, dashboard lint, full tests, and privacy scan passed.
  • Running collectProjectCodexConfigWarnings() from the real repository beneath this machine's global ~/.codex/config.toml returns [].
  • git diff --cached --check and an exact two-file staged-diff review passed before commit.

Checklist

  • Scope stays focused and avoids unrelated cleanup.
  • Docs or release notes were updated when needed (not needed; this corrects false diagnostics without changing configuration semantics).
  • Security-sensitive changes were reviewed for secrets, auth, and unsafe defaults.

Summary by CodeRabbit

  • Bug Fixes
    • Improved project configuration discovery when projects use symlinked paths or nested directories.
    • Prevented duplicate warnings when a project configuration resolves to the global configuration.
    • Improved compatibility with Windows path casing.
    • Corrected provider name display so only valid OpenCode naming patterns are recognized, avoiding incorrect matches such as “OpenCodex.”

@github-actions github-actions Bot added the bug Something isn't working label Aug 4, 2026
@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: cfa87ef8-42fe-4999-b5f5-ba8aa2f98280

📥 Commits

Reviewing files that changed from the base of the PR and between e44d234 and 3ec3bb8.

📒 Files selected for processing (2)
  • src/codex/project-config-warnings.ts
  • tests/project-config-warnings.test.ts

📝 Walkthrough

Walkthrough

Project config discovery now canonicalizes candidate paths, excludes global config aliases, and normalizes Windows path comparisons. OpenCode provider labeling now enforces approved identifier boundaries. Tests cover parent configs, symlinks, untrusted projects, and provider-name variants.

Changes

Project config warnings

Layer / File(s) Summary
Canonical config discovery and validation
src/codex/project-config-warnings.ts, tests/project-config-warnings.test.ts
Discovery uses canonical real paths with fallback resolution and Windows case normalization. Candidates matching the global config are excluded. Tests cover parent traversal, symlink aliases, and explicit warning paths.
OpenCode provider-name boundaries
src/codex/project-config-warnings.ts, tests/project-config-warnings.test.ts
OpenCode humanization accepts opencode and approved separators. Tests prevent OpenCodex and similar identifiers from being relabeled.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant ProjectConfigDiscovery
  participant Filesystem
  participant GlobalConfig
  ProjectConfigDiscovery->>Filesystem: Resolve candidate real paths
  Filesystem-->>ProjectConfigDiscovery: Return canonical or fallback paths
  ProjectConfigDiscovery->>GlobalConfig: Compare normalized identities
  GlobalConfig-->>ProjectConfigDiscovery: Return global config identity
  ProjectConfigDiscovery-->>ProjectConfigDiscovery: Exclude matching candidates
Loading

Possibly related PRs

Suggested reviewers: lidge-jun, ingwannu, wibias

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: preventing false project configuration warnings in Codex.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@WZBbiao

WZBbiao commented Aug 4, 2026

Copy link
Copy Markdown
Author

@codex review

@WZBbiao

WZBbiao commented Aug 4, 2026

Copy link
Copy Markdown
Author

Maintainer action required: GitHub is holding the fork workflows at action_required, so the PR remains UNSTABLE even though the visible target/label checks and CodeRabbit are green.\n\n- Cross-platform CI: https://github.com/lidge-jun/opencodex/actions/runs/30903632095\n- React Doctor: https://github.com/lidge-jun/opencodex/actions/runs/30903630773\n\nPlease approve and run both workflows. Exact head 3ec3bb840fcc26689fa06bf7c525f43a6484c810 passed the full repository gate locally: 8,218 passed, 8 skipped, 0 failed; focused project-config tests were 20/20, and CodeRabbit reported no actionable comments.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Bravo.

Reviewed commit: 3ec3bb840f

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

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

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant