mirror of
https://github.com/wu736139669/hapi.git
synced 2026-11-08 01:43:07 +00:00
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:
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user