fix(runner): keep stopped provider checkpoint closed
This commit is contained in:
parent
a55b6e6409
commit
65c204f060
|
|
@ -971,7 +971,11 @@ impl AcpxCommandExecutor {
|
|||
.as_mut()
|
||||
.expect("ACPX state remains available after provider termination");
|
||||
state.active_turn_id = None;
|
||||
state.lifecycle = "suspended".to_owned();
|
||||
// Keep the provider checkpoint closed while runnerd drains the
|
||||
// already-persisted event suffix. `suspended` is a recoverable ACPX
|
||||
// lifecycle and would make the following runner.drain command restart
|
||||
// the provider generation that turn.stop just proved terminated.
|
||||
state.lifecycle = "prepared".to_owned();
|
||||
self.save_state()?;
|
||||
Ok(CommandExecution::result(json!({
|
||||
"status": "stopped",
|
||||
|
|
|
|||
|
|
@ -2183,7 +2183,10 @@ impl CodexCommandExecutor {
|
|||
state.active_provider_result_fingerprint = None;
|
||||
state.active_provider_result_disposition = None;
|
||||
state.last_agent_message = None;
|
||||
state.lifecycle = "provider_exited".to_owned();
|
||||
// Do not let the runner.drain command that follows turn.stop restore a
|
||||
// fresh provider process. `prepared` retains the durable thread while
|
||||
// deferring the only authorized restart to the successor run.attach.
|
||||
state.lifecycle = "prepared".to_owned();
|
||||
self.save_state()?;
|
||||
Ok(CommandExecution::result(json!({
|
||||
"status": "stopped",
|
||||
|
|
|
|||
|
|
@ -2129,7 +2129,7 @@ it("persists an active provider as settled before bounded suspension", async ()
|
|||
),
|
||||
) as Record<string, unknown>;
|
||||
expect(providerState).toMatchObject({
|
||||
lifecycle: "provider_exited",
|
||||
lifecycle: "prepared",
|
||||
activeProviderTurnId: null,
|
||||
});
|
||||
} finally {
|
||||
|
|
|
|||
Loading…
Reference in New Issue