fix: persist codexapp streaming state
This commit is contained in:
@@ -468,7 +468,41 @@ function startTurn(params) {
|
||||
return { turn: { id: turnId, status: 'running', items: [] } };
|
||||
}
|
||||
|
||||
const delay = /slow/i.test(text) ? 900 : 80;
|
||||
const delay = /recover/i.test(text) ? 5000 : /slow/i.test(text) ? 900 : 80;
|
||||
if (/recover/i.test(text)) {
|
||||
send({
|
||||
method: 'item/agentMessage/delta',
|
||||
params: {
|
||||
threadId: thread.id,
|
||||
turnId,
|
||||
itemId: 'agent-msg',
|
||||
delta: `partial before restart: ${text}`,
|
||||
},
|
||||
});
|
||||
send({
|
||||
method: 'item/started',
|
||||
params: {
|
||||
threadId: thread.id,
|
||||
turnId,
|
||||
startedAtMs: Date.now(),
|
||||
item: {
|
||||
id: 'recover-tool',
|
||||
type: 'commandExecution',
|
||||
command: '/bin/bash -lc echo recover',
|
||||
status: 'inProgress',
|
||||
},
|
||||
},
|
||||
});
|
||||
send({
|
||||
method: 'item/commandExecution/outputDelta',
|
||||
params: {
|
||||
threadId: thread.id,
|
||||
turnId,
|
||||
itemId: 'recover-tool',
|
||||
delta: 'recover tool output\n',
|
||||
},
|
||||
});
|
||||
}
|
||||
thread.timer = setTimeout(() => completeTurn(thread, turnId, text), delay);
|
||||
return { turn: { id: turnId, status: 'running', items: [] } };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user