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

* feat(codex): support /personality via in-session override

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>

* fix(codex): refuse fake /personality clear (sticky thread setting)

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>

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
SSU-WEI HUANG
2026-08-01 23:26:32 +08:00
committed by GitHub
co-authored by Cursor
parent 0537ddf84a
commit bbe99f5c4c
7 changed files with 136 additions and 8 deletions
@@ -241,6 +241,41 @@ describe('appServerConfig', () => {
expect('serviceTier' in nullParams).toBe(false);
});
it('forwards personality only when explicitly set on the mode', () => {
const omitted = buildTurnStartParams({
threadId: 'thread-1',
message: 'hello',
cwd: '/workspace/project',
mode: { permissionMode: 'default', model: 'gpt-5.5', collaborationMode: 'default' }
});
expect('personality' in omitted).toBe(false);
const set = buildTurnStartParams({
threadId: 'thread-1',
message: 'hello',
cwd: '/workspace/project',
mode: {
permissionMode: 'default',
model: 'gpt-5.5',
collaborationMode: 'default',
personality: 'pragmatic'
}
});
expect(set.personality).toBe('pragmatic');
const thread = buildThreadStartParams({
cwd: '/workspace/project',
mode: {
permissionMode: 'default',
model: 'gpt-5.5',
collaborationMode: 'default',
personality: 'friendly'
},
mcpServers
});
expect(thread.personality).toBe('friendly');
});
it('builds turn params with mode defaults', () => {
const params = buildTurnStartParams({
threadId: 'thread-1',