Skip to content

feat(codex): /personality slash + in-session app-server params - #1265

Merged
tiann merged 2 commits into
tiann:mainfrom
swear01:fix/issue-1003-codex-personality-slash
Aug 1, 2026
Merged

feat(codex): /personality slash + in-session app-server params#1265
tiann merged 2 commits into
tiann:mainfrom
swear01:fix/issue-1003-codex-personality-slash

Conversation

@swear01

@swear01 swear01 commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Intercept /personality in the Codex slash layer (autocomplete + help), keep the value in CLI memory only for the live session
  • Forward personality on app-server thread/start and turn/start when set; omit when unset so Codex config/thread defaults apply
  • No Hub DB, composer UI, REST routes, or three-state session persistence (replaces closed feat(codex): expose personality controls #1009)

Fixes #1003

Usage

  • /personality — show current override (or default if unset)
  • /personality friendly|pragmatic|none — set override
  • /personality default|auto|clear — clear override (omit param)

Test plan

  • cli vitest: slashCommands.test.ts, appServerConfig.test.ts
  • bun run typecheck
  • Remote Codex session: /personality pragmatic then send a turn; confirm style changes
  • /personality default then send a turn; confirm inherits config.toml / thread default
  • Autocomplete shows personality in composer slash menu

Made with Cursor

Intercept /personality in the Codex slash layer, keep the value in CLI
memory only, and forward it on thread/turn start when set. Unset means
omit the field so Codex config/thread defaults apply—no Hub DB or web UI.

Co-authored-by: Cursor <cursoragent@cursor.com>

@github-actions github-actions 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.

Findings

  • [Major] /personality default does not restore the configured/thread personality. Codex treats turn/start.personality as a thread setting for the current and subsequent turns. After an override is sent, mapping the clear request to undefined at cli/src/codex/runCodex.ts:174 makes buildTurnStartParams omit the field at cli/src/codex/utils/appServerConfig.ts:299; omission leaves the previous override active, while the UI reports that it was cleared.

    Suggested fix:

    // Capture the effective personality before the first HAPI override.
    const nextPersonality = updates.personality === null
        ? inheritedThreadPersonality
        : updates.personality;
    currentPersonality = nextPersonality;

    The inherited value must be an explicit effective personality (for example from the initial thread/settings/updated state), not undefined. If that baseline cannot be obtained, do not expose default|auto|clear as a successful clear operation.

Summary

  • Review mode: initial
  • One Major correctness issue: clearing a personality override is currently a no-op for an existing Codex thread.

Testing

  • Not run locally (review automation; PR code was not executed). The repository test check passed.
  • Add an integration regression covering set pragmatic -> send turn -> clear/default -> send turn and assert the second turn restores the initial effective personality.

HAPI Bot

Comment thread cli/src/codex/runCodex.ts Outdated
currentProactiveMultiAgent = updates.proactiveMultiAgent;
}
if (updates.personality !== undefined) {
currentPersonality = updates.personality ?? undefined;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[MAJOR] default leaves the prior personality sticky

Codex documents turn/start.personality as an override for this turn and subsequent turns. After pragmatic or friendly has been sent, converting the clear sentinel to undefined only causes the next turn/start to omit personality; omission does not undo the thread setting. The command therefore says "cleared" while later turns keep the old personality.

Cache the effective personality that the thread inherited before the first HAPI override and explicitly restore that value on clear:

const nextPersonality = updates.personality === null
    ? inheritedThreadPersonality
    : updates.personality;
currentPersonality = nextPersonality;

inheritedThreadPersonality must be an explicit effective value (for example captured from the initial thread/settings/updated notification), not undefined. If HAPI cannot obtain that baseline, the clear aliases should not report success. Please add a set -> turn -> clear -> turn regression test; the current builder test only proves omission.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Agreed — omit-after-override is a no-op under Codex sticky semantics.

Fixed by refusing default|auto|clear instead of claiming a clear: personality is sticky on the thread, and without a captured thread/settings/updated baseline we cannot honestly restore config.toml. Users must set an explicit friendly|pragmatic|none.

turn/start.personality sticks for later turns; omitting the field does not
restore config.toml. Drop default|auto|clear success paths and require an
explicit friendly|pragmatic|none instead.

Co-authored-by: Cursor <cursoragent@cursor.com>

@github-actions github-actions 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.

Findings

  • No Blocker/Major/Minor/Nit findings at ≥80% confidence.

Summary

Review mode: follow-up after new commits

No high-confidence issues found in the latest full diff. The prior Major concerning a fake clear operation is no longer present: default, auto, and clear are rejected instead of being reported as successful.

Residual testing gap: the added tests cover slash parsing and request builders separately, but do not exercise the full /personality pragmatic → queued user message → turn/start.personality path or thread resume/fork propagation.

Testing

  • Not run (automation; PR code was not executed).
  • GitHub test check pending at review time.

HAPI Bot

@tiann
tiann merged commit bbe99f5 into tiann:main Aug 1, 2026
3 checks passed
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.

feat(codex): expose CLI personality selection in remote sessions

2 participants