Skip to content

chore: save Codex config seed - #3834

Draft
risu729 wants to merge 1 commit into
mainfrom
agent/save-codex-config-seed
Draft

chore: save Codex config seed#3834
risu729 wants to merge 1 commit into
mainfrom
agent/save-codex-config-seed

Conversation

@risu729

@risu729 risu729 commented Jul 23, 2026

Copy link
Copy Markdown
Owner

Summary

  • add a tracked wsl/home/.codex/config.seed.toml containing the current safe, non-default Codex preferences
  • retain reasoning, permission, service-tier, status-line, idle-sleep, and Cloudflare MCP settings
  • keep the live ~/.codex/config.toml untracked so generated state and literal OTEL credentials cannot enter the repository

Why

Codex currently stores durable preferences alongside project trust, hook hashes, UI state, connector state, and OTEL credentials. Tracking or symlinking the live file would both dirty the repository and risk committing secrets.

This seed is the safe canonical input for a future merge/install step tracked in #3833.

Validation

  • tombi lint wsl/home/.codex/config.seed.toml
  • tombi format --check wsl/home/.codex/config.seed.toml
  • repository pre-commit hooks, including betterleaks
  • parsed the seed as TOML and compared its selected values with the live configuration

Related to #3833.

Summary by Sourcery

Enhancements:

  • Define a canonical Codex config seed with reasoning effort, sandbox/approval policy, service tier, TUI status line, idle-sleep, and Cloudflare MCP settings while keeping the live config untracked.

@sourcery-ai

sourcery-ai Bot commented Jul 23, 2026

Copy link
Copy Markdown

Reviewer's Guide

Adds a tracked Codex configuration seed file capturing safe, non-secret default preferences to be merged into the live ~/.codex/config.toml without tracking generated state or credentials.

Flow diagram for using the Codex config seed to populate live config

flowchart LR
    RepoSeed["wsl/home/.codex/config.seed.toml\n(safe, tracked preferences)"] --> MergeStep["merge/install step\n(future, #3833)"]
    LiveConfig["~/.codex/config.toml\n(untracked, includes generated state & secrets)"]

    MergeStep --> LiveConfig

    subgraph SeedContents["Key safe preferences in config.seed.toml"]
        Reasoning["model_reasoning_effort = high\nplan_mode_reasoning_effort = xhigh"]
        Sandbox["sandbox_mode = danger-full-access\napproval_policy = never"]
        ServiceTier["service_tier = default"]
        TUI["[tui].status_line"]
        Idle["[features].prevent_idle_sleep = true"]
        CloudflareMCP["[mcp_servers.cloudflare-docs]\n[mcp_servers.cloudflare-api]"]
    end

    Reasoning --> RepoSeed
    Sandbox --> RepoSeed
    ServiceTier --> RepoSeed
    TUI --> RepoSeed
    Idle --> RepoSeed
    CloudflareMCP --> RepoSeed
Loading

File-Level Changes

Change Details Files
Introduce a safe Codex configuration seed TOML capturing durable, non-secret preferences while excluding generated state and credentials.
  • Create wsl/home/.codex/config.seed.toml as a tracked TOML file documenting its role as a safe merge seed for ~/.codex/config.toml
  • Set explicit reasoning effort levels, sandbox/approval policies, and default (non-priority) service tier values
  • Configure TUI status line fields to display model, context remaining, PR number, and usage limits
  • Enable prevention of idle sleep via the features section
  • Define Cloudflare MCP server endpoints for docs and API using non-secret URLs
wsl/home/.codex/config.seed.toml

Possibly linked issues


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hey - I've found 1 issue

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="wsl/home/.codex/config.seed.toml" line_range="7-8" />
<code_context>
+model_reasoning_effort = "high"
+plan_mode_reasoning_effort = "xhigh"
+
+sandbox_mode = "danger-full-access"
+approval_policy = "never"
+
+# Explicitly use standard speed instead of the Fast/priority service tier.
</code_context>
<issue_to_address>
**🚨 issue (security):** Reconsider combining `danger-full-access` sandbox with `approval_policy = "never"` for safety-critical operations.

This setup gives the model unrestricted, fully automated access to the host without any human checks, greatly amplifying the impact of prompt injection, mis-specification, or tool bugs. If you need full-access for power users, consider keeping a stricter `approval_policy` (or using a separate high-trust profile) so that clearly sensitive or dangerous operations still require explicit confirmation.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click πŸ‘ or πŸ‘Ž on each comment and I'll use the feedback to improve your reviews.

Comment on lines +7 to +8
sandbox_mode = "danger-full-access"
approval_policy = "never"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🚨 issue (security): Reconsider combining danger-full-access sandbox with approval_policy = "never" for safety-critical operations.

This setup gives the model unrestricted, fully automated access to the host without any human checks, greatly amplifying the impact of prompt injection, mis-specification, or tool bugs. If you need full-access for power users, consider keeping a stricter approval_policy (or using a separate high-trust profile) so that clearly sensitive or dangerous operations still require explicit confirmation.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant