Skip to content

fix(wework): preserve Codex model instructions - #1857

Merged
qdaxb merged 1 commit into
mainfrom
agent/fix-codex-personality-commentary
Jul 10, 2026
Merged

qdaxb merged 1 commit into
mainfrom
agent/fix-codex-personality-commentary

Conversation

@qdaxb

@qdaxb qdaxb commented Jul 10, 2026 •

Copy link
Copy Markdown
Contributor

What changed

  • add Friendly and Pragmatic Codex personality selection under Context settings
  • persist personality through Codex app-server config/batchWrite instead of localStorage or per-turn overrides
  • normalize the Wework Codex config.toml before app-server startup
  • migrate legacy instructions to developer_instructions so model base instructions remain intact
  • merge embedded-browser routing with user developer instructions
  • add diagnostics for streamed item/fileChange/patchUpdated events
  • document the Wework Codex runtime config lifecycle in Chinese and English

Why

Codex CLI 0.144.x treats instructions as a complete base-instruction override. Wework stored custom instructions there, which removed model-provided personality, commentary, and progress-update rules. Personality state was also duplicated between localStorage, config, and thread requests. The new flow makes Codex config the source of truth and safely normalizes legacy config before startup.

Impact

  • new and existing Wework Codex sessions retain the model's built-in instruction template
  • users can select interaction style from Context settings
  • existing Wework Codex config is migrated automatically and atomically
  • streamed patch diagnostics make Codex editing regressions observable

Validation

  • Wework ESLint, TypeScript, and unit tests
  • Executor cargo fmt --check
  • Executor cargo test --all-features --lib
  • Executor cargo clippy
  • focused config migration, personality, and patch-update mapping tests

Summary by CodeRabbit

  • New Features

    • Added Codex interaction style settings with Friendly and Pragmatic options.
    • Added Chinese and English translations for the new settings.
    • Added support for reading and saving custom Codex instructions and interaction style.
  • Bug Fixes

    • Automatically normalizes Codex configuration and migrates legacy instruction settings.
    • Improved handling and diagnostics for Codex file-change updates.
  • Documentation

    • Documented Codex configuration normalization, instruction management, and interaction style behavior.

@coderabbitai

coderabbitai Bot commented Jul 10, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 1a2b9d21-b986-49ac-bd59-7d5b268d52d1

📥 Commits

Reviewing files that changed from the base of the PR and between 2f65b89 and 173669e.

⛔ Files ignored due to path filters (1)
  • executor/Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (14)
  • docs/en/developer-guide/wework-codex-plugins.md
  • docs/zh/developer-guide/wework-codex-plugins.md
  • executor/Cargo.toml
  • executor/src/agents/codex.rs
  • executor/src/agents/mod.rs
  • executor/src/runtime_work/events.rs
  • executor/src/runtime_work/handler.rs
  • wework/src/components/settings/CodexPersonalitySettings.tsx
  • wework/src/components/settings/ContextSettingsPage.tsx
  • wework/src/components/settings/MobileSettingsPage.test.tsx
  • wework/src/features/model-settings/localCodexSettings.test.ts
  • wework/src/features/model-settings/localCodexSettings.ts
  • wework/src/i18n/locales/en/common.json
  • wework/src/i18n/locales/zh-CN/common.json

📝 Walkthrough

Walkthrough

Codex startup now normalizes config.toml, migrates instruction fields, and stores personality centrally. Runtime RPCs expose instruction and personality configuration, while the settings UI provides localized personality selection. Patch-update event logging also gains structured diagnostics.

Changes

Codex configuration and personality

Layer / File(s) Summary
Config normalization and instruction migration
executor/Cargo.toml, executor/src/agents/codex.rs, docs/*/developer-guide/wework-codex-plugins.md
Codex config normalization creates or updates config.toml, migrates instructions to developer_instructions, sets default personality, preserves permissions, and removes thread-level instruction overrides.
Runtime instruction and personality RPCs
executor/src/agents/mod.rs, executor/src/runtime_work/handler.rs
Runtime RPCs read and write developer instructions and validated personality values through Codex configuration operations.
Interaction style settings UI
wework/src/components/settings/*, wework/src/features/model-settings/*, wework/src/i18n/locales/*
Context settings adds a localized personality selector backed by local executor RPCs, with persistence and test coverage.

Patch update event logging

Layer / File(s) Summary
Patch mapping diagnostics
executor/src/agents/codex.rs, executor/src/runtime_work/events.rs
Patch mapping success and drop outcomes emit structured executor events, and item/fileChange/patchUpdated raw logging is suppressed outside stream debug mode.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant CodexPersonalitySettings
  participant localCodexSettings
  participant RuntimeWorkRpcHandler
  participant CodexAppServer
  User->>CodexPersonalitySettings: Select interaction style
  CodexPersonalitySettings->>localCodexSettings: saveLocalCodexPersonality
  localCodexSettings->>RuntimeWorkRpcHandler: runtime.codex.personality.write
  RuntimeWorkRpcHandler->>CodexAppServer: config/batchWrite personality
  CodexAppServer-->>RuntimeWorkRpcHandler: Saved configuration
  RuntimeWorkRpcHandler-->>localCodexSettings: personality and configPath
  localCodexSettings-->>CodexPersonalitySettings: normalized personality
Loading

Possibly related PRs

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch agent/fix-codex-personality-commentary

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@qdaxb
qdaxb marked this pull request as ready for review July 10, 2026 08:40
@qdaxb
qdaxb merged commit 2fbb4a5 into main Jul 10, 2026
10 of 11 checks passed
@qdaxb
qdaxb deleted the agent/fix-codex-personality-commentary branch July 10, 2026 08:40
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