mirror of
https://github.com/wu736139669/hapi.git
synced 2026-11-25 05:07:05 +00:00
fix(codex): start a new goal after the previous one completes (#2338)
This commit is contained in:
@@ -640,9 +640,16 @@ export class SharedCodexRoot {
|
||||
if (slash.kind === 'passthrough') return text;
|
||||
if (slash.kind === 'goal') {
|
||||
const params = { threadId: this.threadId };
|
||||
const goal = slash.action === 'set'
|
||||
? record(record(await this.client.request('thread/goal/get', params)).goal) : null;
|
||||
if (goal?.status === 'complete') {
|
||||
await this.client.request('thread/goal/clear', params);
|
||||
}
|
||||
const response = slash.action === 'show' ? await this.client.request('thread/goal/get', params)
|
||||
: slash.action === 'clear' ? await this.client.request('thread/goal/clear', params)
|
||||
: await this.client.request('thread/goal/set', { ...params, ...(slash.action === 'set' ? { objective: slash.objective } : { status: slash.action === 'pause' ? 'paused' : 'active' }) });
|
||||
: await this.client.request('thread/goal/set', { ...params, ...(slash.action === 'set'
|
||||
? { objective: slash.objective, ...(goal?.status === 'complete' ? { status: 'active' } : {}) }
|
||||
: { status: slash.action === 'pause' ? 'paused' : 'active' }) });
|
||||
this.notice(JSON.stringify(response)); return null;
|
||||
}
|
||||
if (slash.updates?.proactiveMultiAgent !== undefined) throw new Error('This Codex version uses Ultra reasoning effort instead of a multi-agent toggle');
|
||||
|
||||
Reference in New Issue
Block a user