feat(codex): /personality slash + in-session app-server params - #1265
Conversation
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>
There was a problem hiding this comment.
Findings
-
[Major]
/personality defaultdoes not restore the configured/thread personality. Codex treatsturn/start.personalityas a thread setting for the current and subsequent turns. After an override is sent, mapping the clear request toundefinedatcli/src/codex/runCodex.ts:174makesbuildTurnStartParamsomit the field atcli/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/updatedstate), notundefined. If that baseline cannot be obtained, do not exposedefault|auto|clearas 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
testcheck passed. - Add an integration regression covering
set pragmatic -> send turn -> clear/default -> send turnand assert the second turn restores the initial effective personality.
HAPI Bot
| currentProactiveMultiAgent = updates.proactiveMultiAgent; | ||
| } | ||
| if (updates.personality !== undefined) { | ||
| currentPersonality = updates.personality ?? undefined; |
There was a problem hiding this comment.
[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.
There was a problem hiding this comment.
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>
There was a problem hiding this comment.
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
Summary
/personalityin the Codex slash layer (autocomplete + help), keep the value in CLI memory only for the live sessionpersonalityon app-serverthread/startandturn/startwhen set; omit when unset so Codex config/thread defaults applyFixes #1003
Usage
/personality— show current override (ordefaultif unset)/personality friendly|pragmatic|none— set override/personality default|auto|clear— clear override (omit param)Test plan
clivitest:slashCommands.test.ts,appServerConfig.test.tsbun run typecheck/personality pragmaticthen send a turn; confirm style changes/personality defaultthen send a turn; confirm inherits config.toml / thread defaultpersonalityin composer slash menuMade with Cursor